================
@@ -1351,7 +1352,8 @@ def OSConsumesThis : InheritableAttr {
 
 def Cleanup : InheritableAttr {
   let Spellings = [GCC<"cleanup">];
-  let Args = [DeclArgument<Function, "FunctionDecl">];
+  let Args = [DeclArgument<Function, "FunctionDecl">,
+              ExprArgument<"Expr", /*opt=*/0, /*fake=*/1>];
----------------
AaronBallman wrote:

I'm not keen on this solution. There are three approaches that would be better:

1) Change to accept a `DeclRefExpr` instead, add an additional method here to 
get the `FunctionDecl` out of the expression.
2) Add an extra `SourceLocation` member here, then update `handleCleanupAttr()` 
to set the source location to the location of the expression argument.
3) Generically expose expression arguments on the `Attr` subclass.

I think #3 is where we'd ultimately like to go, but is also probably a decent 
amount of work given how many attributes we have. I think #1 may be the most 
reasonable solution here, while #2 is likely the easiest.

CC @erichkeane 

https://github.com/llvm/llvm-project/pull/140233
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to