================
@@ -3205,6 +3205,21 @@ void CodeGenModule::ConstructAttributeList(StringRef 
Name,
     }
   }
 
+  if (const FunctionDecl *Fn = dyn_cast_or_null<FunctionDecl>(TargetDecl)) {
+    if (Fn->isReplaceableGlobalAllocationFunction()) {
+      auto Kind = Fn->getDeclName().getCXXOverloadedOperator();
+      if (Kind == OO_Delete || Kind == OO_Array_Delete) {
+        auto [IRArg, NumIRArgs] = IRFunctionArgs.getIRArgs(0);
+        assert(NumIRArgs == 1 && "Pointer should be a single argument");
+        (void)NumIRArgs;
+        // Add captures(address) to deleted pointer. The provenance is not
+        // captured, because delete destroy the provenane of the pointer. The
----------------
antoniofrighetto wrote:

```suggestion
        // captured, because delete destroy the provenance of the pointer. The
```

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

Reply via email to