diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-03 22:39:14 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-12-03 22:39:14 +0000 |
commit | 73593eb5c68e28e0eaa4f2b6251dae167eef3a83 (patch) | |
tree | f9b0fc36bf55c0a891a71fd914ab90fef721601b | |
parent | 0be4b36830a26026726d05aae5434c6658abc65f (diff) |
Fix test failure when building Clang with g++4.7 -- don't use a Twine temporary
after its lifetime has ended!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169170 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/CGExpr.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index ef17bdc1de..0c2feda419 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -2068,11 +2068,11 @@ void CodeGenFunction::EmitCheck(llvm::Value *Checked, StringRef CheckName, // Checks that have two variants use a suffix to differentiate them bool NeedsAbortSuffix = (RecoverKind != CRK_Unrecoverable) && !CGM.getCodeGenOpts().SanitizeRecover; - Twine FunctionName = "__ubsan_handle_" + CheckName + - Twine(NeedsAbortSuffix? "_abort" : ""); - llvm::Value *Fn = CGM.CreateRuntimeFunction(FnType, FunctionName.str(), - llvm::Attributes::get(getLLVMContext(), - B)); + std::string FunctionName = ("__ubsan_handle_" + CheckName + + (NeedsAbortSuffix? "_abort" : "")).str(); + llvm::Value *Fn = + CGM.CreateRuntimeFunction(FnType, FunctionName, + llvm::Attributes::get(getLLVMContext(), B)); llvm::CallInst *HandlerCall = Builder.CreateCall(Fn, Args); if (Recover) { Builder.CreateBr(Cont); |