[PATCH] D98175: [NFC] Remove duplicate isNoBuiltinFunc method

serge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 10 00:19:22 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rGea8e5b87acba: [NFC] Remove duplicate isNoBuiltinFunc method (authored by serge-sans-paille).
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98175

Files:
  clang/include/clang/Basic/CodeGenOptions.h
  clang/lib/Basic/CodeGenOptions.cpp
  clang/lib/CodeGen/CGCall.cpp


Index: clang/lib/CodeGen/CGCall.cpp
===================================================================
--- clang/lib/CodeGen/CGCall.cpp
+++ clang/lib/CodeGen/CGCall.cpp
@@ -1765,8 +1765,7 @@
 
   if (AttrOnCallSite) {
     // Attributes that should go on the call site only.
-    if (!CodeGenOpts.SimplifyLibCalls ||
-        CodeGenOpts.isNoBuiltinFunc(Name.data()))
+    if (!CodeGenOpts.SimplifyLibCalls || LangOpts.isNoBuiltinFunc(Name))
       FuncAttrs.addAttribute(llvm::Attribute::NoBuiltin);
     if (!CodeGenOpts.TrapFuncName.empty())
       FuncAttrs.addAttribute("trap-func-name", CodeGenOpts.TrapFuncName);
Index: clang/lib/Basic/CodeGenOptions.cpp
===================================================================
--- clang/lib/Basic/CodeGenOptions.cpp
+++ clang/lib/Basic/CodeGenOptions.cpp
@@ -20,12 +20,4 @@
   memcpy(CoverageVersion, "408*", 4);
 }
 
-bool CodeGenOptions::isNoBuiltinFunc(const char *Name) const {
-  StringRef FuncName(Name);
-  for (unsigned i = 0, e = NoBuiltinFuncs.size(); i != e; ++i)
-    if (FuncName.equals(NoBuiltinFuncs[i]))
-      return true;
-  return false;
-}
-
 }  // end namespace clang
Index: clang/include/clang/Basic/CodeGenOptions.h
===================================================================
--- clang/include/clang/Basic/CodeGenOptions.h
+++ clang/include/clang/Basic/CodeGenOptions.h
@@ -415,10 +415,6 @@
 
   CodeGenOptions();
 
-  /// Is this a libc/libm function that is no longer recognized as a
-  /// builtin because a -fno-builtin-* option has been specified?
-  bool isNoBuiltinFunc(const char *Name) const;
-
   const std::vector<std::string> &getNoBuiltinFuncs() const {
     return NoBuiltinFuncs;
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98175.329558.patch
Type: text/x-patch
Size: 1685 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210310/68ba0f43/attachment.bin>


More information about the cfe-commits mailing list