[PATCH] D71193: [clang] Turn -fno-builtin flag into an IR Attribute

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Dec 10 10:37:13 PST 2019


aaron.ballman added reviewers: efriedma, tejohnson, hfinkel.
aaron.ballman added a comment.

Adding a few more reviewers who may know more about LLVM attributes.



================
Comment at: clang/lib/CodeGen/CGCall.cpp:1884
+        else {
+          const auto AddNoBuiltinAttr = [&FuncAttrs](StringRef BuiltinName) {
+            SmallString<32> AttributeName;
----------------
You can drop the top-level `const` here (we don't typically top-level `const` qualify locals).


================
Comment at: clang/lib/CodeGen/CGCall.cpp:1890-1891
+          };
+          for (StringRef BuiltinName : getLangOpts().NoBuiltinFuncs)
+            AddNoBuiltinAttr(BuiltinName);
+          if (NBA)
----------------
`llvm::for_each()`?


================
Comment at: clang/lib/CodeGen/CGCall.cpp:1893-1894
+          if (NBA)
+            for (StringRef BuiltinName : NBA->builtinNames())
+              AddNoBuiltinAttr(BuiltinName);
         }
----------------
`llvm::for_each()`?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71193/new/

https://reviews.llvm.org/D71193





More information about the cfe-commits mailing list