[PATCH] D69569: isBuiltinFunc() uses StringRef instead of const char*
Guillaume Chatelet via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 29 09:39:14 PDT 2019
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG1c85a2e8dc7e: isBuiltinFunc() uses StringRef instead of const char* (authored by gchatelet).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69569/new/
https://reviews.llvm.org/D69569
Files:
clang/include/clang/Basic/Builtins.h
clang/lib/Basic/Builtins.cpp
clang/lib/Sema/SemaDeclAttr.cpp
Index: clang/lib/Sema/SemaDeclAttr.cpp
===================================================================
--- clang/lib/Sema/SemaDeclAttr.cpp
+++ clang/lib/Sema/SemaDeclAttr.cpp
@@ -1096,7 +1096,7 @@
if (!S.checkStringLiteralArgumentAttr(AL, I, BuiltinName, &LiteralLoc))
return;
- if (Builtin::Context::isBuiltinFunc(BuiltinName.data()))
+ if (Builtin::Context::isBuiltinFunc(BuiltinName))
AddBuiltinName(BuiltinName);
else
S.Diag(LiteralLoc, diag::warn_attribute_no_builtin_invalid_builtin_name)
Index: clang/lib/Basic/Builtins.cpp
===================================================================
--- clang/lib/Basic/Builtins.cpp
+++ clang/lib/Basic/Builtins.cpp
@@ -47,8 +47,7 @@
AuxTSRecords = AuxTarget->getTargetBuiltins();
}
-bool Builtin::Context::isBuiltinFunc(const char *Name) {
- StringRef FuncName(Name);
+bool Builtin::Context::isBuiltinFunc(llvm::StringRef FuncName) {
for (unsigned i = Builtin::NotBuiltin + 1; i != Builtin::FirstTSBuiltin; ++i)
if (FuncName.equals(BuiltinInfo[i].Name))
return strchr(BuiltinInfo[i].Attributes, 'f') != nullptr;
Index: clang/include/clang/Basic/Builtins.h
===================================================================
--- clang/include/clang/Basic/Builtins.h
+++ clang/include/clang/Basic/Builtins.h
@@ -224,7 +224,7 @@
/// Returns true if this is a libc/libm function without the '__builtin_'
/// prefix.
- static bool isBuiltinFunc(const char *Name);
+ static bool isBuiltinFunc(llvm::StringRef Name);
/// Returns true if this is a builtin that can be redeclared. Returns true
/// for non-builtins.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69569.226917.patch
Type: text/x-patch
Size: 1657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191029/301f700f/attachment.bin>
More information about the cfe-commits
mailing list