diff options
| author | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-11 19:04:24 +0000 |
|---|---|---|
| committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-10-11 19:04:24 +0000 |
| commit | 7186a4323e142301fbd858abc79a6174d83cfac9 (patch) | |
| tree | 25ef1bcd4292fe57fc9139d8635a30334bfce816 /clang/lib/Sema | |
| parent | cdd4547607128d41b3f224b0790a761d34c000eb (diff) | |
| download | bcm5719-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/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp index 14a1e5b86a9..013120a8bd1 100644 --- a/clang/lib/Sema/SemaChecking.cpp +++ b/clang/lib/Sema/SemaChecking.cpp @@ -3199,12 +3199,12 @@ Sema::SemaBuiltinAtomicOverloaded(ExprResult TheCallResult) { // Get the decl for the concrete builtin from this, we can tell what the // concrete integer type we should convert to is. unsigned NewBuiltinID = BuiltinIndices[BuiltinIndex][SizeIndex]; + const char *NewBuiltinName = Context.BuiltinInfo.getName(NewBuiltinID); FunctionDecl *NewBuiltinDecl; if (NewBuiltinID == BuiltinID) NewBuiltinDecl = FDecl; else { // Perform builtin lookup to avoid redeclaring it. - StringRef NewBuiltinName = Context.BuiltinInfo.getName(NewBuiltinID); DeclarationName DN(&Context.Idents.get(NewBuiltinName)); LookupResult Res(*this, DN, DRE->getLocStart(), LookupOrdinaryName); LookupName(Res, TUScope, /*AllowBuiltinCreation=*/true); @@ -6263,7 +6263,7 @@ static void emitReplacement(Sema &S, SourceLocation Loc, SourceRange Range, unsigned AbsKind, QualType ArgType) { bool EmitHeaderHint = true; const char *HeaderName = nullptr; - StringRef FunctionName; + const char *FunctionName = nullptr; if (S.getLangOpts().CPlusPlus && !ArgType->isAnyComplexType()) { FunctionName = "std::abs"; if (ArgType->isIntegralOrEnumerationType()) { @@ -6381,7 +6381,7 @@ void Sema::CheckAbsoluteValueFunction(const CallExpr *Call, // Unsigned types cannot be negative. Suggest removing the absolute value // function call. if (ArgType->isUnsignedIntegerType()) { - StringRef FunctionName = + const char *FunctionName = IsStdAbs ? "std::abs" : Context.BuiltinInfo.getName(AbsKind); Diag(Call->getExprLoc(), diag::warn_unsigned_abs) << ArgType << ParamType; Diag(Call->getExprLoc(), diag::note_remove_abs) |

