================
@@ -1353,6 +1353,19 @@ void CodeGenFunction::EmitLifetimeEnd(llvm::Value *Size, 
llvm::Value *Addr) {
   C->setDoesNotThrow();
 }
 
+void CodeGenFunction::EmitFakeUse(Address Addr) {
+  // We do not emit a fake use if we want to apply optnone to this function,
+  // even if we might not apply it anyway due to minsize or similar attributes.
+  if (!CGM.getCodeGenOpts().DisableO0ImplyOptNone &&
+      CGM.getCodeGenOpts().OptimizationLevel == 0)
+    return;
----------------
dwblaikie wrote:

(might be worth removing "-disable-O0-optnone" as it's a bit of a hazard for 
reasons like this - if folks want optimizable IR, but without optimizations 
applied, they'd probably be better off disabling optimizations 
(`-disable-llvm-optzns`) I think?)

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

Reply via email to