================
@@ -624,8 +624,15 @@ namespace {
       CallArgList Args;
       Args.add(RValue::get(Arg),
                CGF.getContext().getPointerType(Var.getType()));
-      auto Callee = CGCallee::forDirect(CleanupFn);
-      CGF.EmitCall(FnInfo, Callee, ReturnValueSlot(), Args);
+      bool HasCleanupAttr = Var.hasAttr<CleanupAttr>();
+      GlobalDecl GD = HasCleanupAttr
+                          ? (Var.getAttr<CleanupAttr>()->getFunctionDecl())
+                          : GlobalDecl();
+      SourceLocation Loc = HasCleanupAttr ? 
Var.getAttr<CleanupAttr>()->getLoc()
----------------
efriedma-quic wrote:

Instead of redoing all this computation to get the SourceLocation, can we save 
it as a member of CallCleanupFunction?

https://github.com/llvm/llvm-project/pull/152082
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to