================
@@ -1337,9 +1337,11 @@ static void EmitNewInitializer(CodeGenFunction &CGF, 
const CXXNewExpr *E,
 static RValue EmitNewDeleteCall(CodeGenFunction &CGF,
                                 const FunctionDecl *CalleeDecl,
                                 const FunctionProtoType *CalleeType,
-                                const CallArgList &Args) {
+                                const CallArgList &Args,
+                                llvm::Constant *CalleeOverride = nullptr) {
   llvm::CallBase *CallOrInvoke;
-  llvm::Constant *CalleePtr = CGF.CGM.GetAddrOfFunction(CalleeDecl);
+  llvm::Constant *CalleePtr =
+      CalleeOverride ? CalleeOverride : CGF.CGM.GetAddrOfFunction(CalleeDecl);
----------------
dpaoliello wrote:

Yes, it's possible that there may end up being no calls to the global `operator 
delete`, however it's linkage type should prevent it from being optimized out. 
Once you get to the final binary, if there still are no calls (which there 
should be, since the CRT provides a `__global_delete` that forwards to it) then 
the linker may drop it.

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

Reply via email to