summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGBuiltin.cpp
diff options
context:
space:
mode:
authorMehdi Amini <mehdi.amini@apple.com>2016-10-11 19:04:24 +0000
committerMehdi Amini <mehdi.amini@apple.com>2016-10-11 19:04:24 +0000
commit7186a4323e142301fbd858abc79a6174d83cfac9 (patch)
tree25ef1bcd4292fe57fc9139d8635a30334bfce816 /clang/lib/CodeGen/CGBuiltin.cpp
parentcdd4547607128d41b3f224b0790a761d34c000eb (diff)
downloadbcm5719-llvm-7186a4323e142301fbd858abc79a6174d83cfac9.tar.gz
bcm5719-llvm-7186a4323e142301fbd858abc79a6174d83cfac9.zip
Revert "Change Builtins name to be stored as StringRef instead of raw pointers (NFC)"
This reverts commit r283802. It introduces temporarily static initializers, because StringRef ctor isn't (yet) constexpr for string literals. I plan to get there this week, but apparently GCC is so terrible with these static initializer right now (10 min+ extra codegen time was reported) that I'll hold on to this patch till the constexpr one is ready, and land these at the same time. llvm-svn: 283920
Diffstat (limited to 'clang/lib/CodeGen/CGBuiltin.cpp')
-rw-r--r--clang/lib/CodeGen/CGBuiltin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGBuiltin.cpp b/clang/lib/CodeGen/CGBuiltin.cpp
index 89245c16003..f9b38fa5859 100644
--- a/clang/lib/CodeGen/CGBuiltin.cpp
+++ b/clang/lib/CodeGen/CGBuiltin.cpp
@@ -50,7 +50,7 @@ llvm::Value *CodeGenModule::getBuiltinLibFunction(const FunctionDecl *FD,
if (FD->hasAttr<AsmLabelAttr>())
Name = getMangledName(D);
else
- Name = Context.BuiltinInfo.getName(BuiltinID).drop_front(10);
+ Name = Context.BuiltinInfo.getName(BuiltinID) + 10;
llvm::FunctionType *Ty =
cast<llvm::FunctionType>(getTypes().ConvertType(FD->getType()));
@@ -2523,11 +2523,11 @@ RValue CodeGenFunction::EmitBuiltinExpr(const FunctionDecl *FD,
checkTargetFeatures(E, FD);
// See if we have a target specific intrinsic.
+ const char *Name = getContext().BuiltinInfo.getName(BuiltinID);
Intrinsic::ID IntrinsicID = Intrinsic::not_intrinsic;
StringRef Prefix =
llvm::Triple::getArchTypePrefix(getTarget().getTriple().getArch());
if (!Prefix.empty()) {
- StringRef Name = getContext().BuiltinInfo.getName(BuiltinID);
IntrinsicID = Intrinsic::getIntrinsicForGCCBuiltin(Prefix.data(), Name);
// NOTE we dont need to perform a compatibility flag check here since the
// intrinsics are declared in Builtins*.def via LANGBUILTIN which filter the
OpenPOWER on IntegriCloud