summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-05-19 00:45:05 +0000
committerJim Grosbach <grosbach@apple.com>2011-05-19 00:45:05 +0000
commit13733a137ccc3ea8b8faaecdfc55434d81e8aba7 (patch)
tree5aa99a71513c6bec21a411f3703a00d221d851df /llvm/lib/ExecutionEngine
parent2f1e9e618c459037c358e13193939af2096f176b (diff)
downloadbcm5719-llvm-13733a137ccc3ea8b8faaecdfc55434d81e8aba7.tar.gz
bcm5719-llvm-13733a137ccc3ea8b8faaecdfc55434d81e8aba7.zip
Avoid a Twine that referenced a tmp (which proceded to go out of scope before
the Twine was used). llvm-svn: 131612
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 09a79f64d42..4475f4d5c0d 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -104,12 +104,10 @@ void *MCJIT::getPointerToFunction(Function *F) {
// FIXME: Should we be using the mangler for this? Probably.
StringRef BaseName = F->getName();
- Twine Name;
if (BaseName[0] == '\1')
- Name = BaseName.substr(1);
- else
- Name = TM->getMCAsmInfo()->getGlobalPrefix() + BaseName;
- return (void*)Dyld.getSymbolAddress(Name.str());
+ return (void*)Dyld.getSymbolAddress(BaseName.substr(1));
+ return (void*)Dyld.getSymbolAddress((TM->getMCAsmInfo()->getGlobalPrefix()
+ + BaseName).str());
}
void *MCJIT::recompileAndRelinkFunction(Function *F) {
OpenPOWER on IntegriCloud