[PATCH] D28404: IRGen: Add optnone attribute on function during O0

Paul Robinson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 6 16:39:23 PST 2017


probinson added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:896
+      !CodeGenOpts.DisableO0ImplyOptNone && CodeGenOpts.OptimizationLevel == 0;
+  // We can't add optnone in the following cases, it won't pass the verifier
+  ShouldAddOptNone &= !D->hasAttr<MinSizeAttr>();
----------------
Period at the end of a comment.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:900
+  ShouldAddOptNone &= !D->hasAttr<AlwaysInlineAttr>();
+  if (ShouldAddOptNone) {
+    B.addAttribute(llvm::Attribute::OptimizeNone);
----------------
This block is redundant now?  The same things are added in the next if block.


https://reviews.llvm.org/D28404





More information about the cfe-commits mailing list