diff options
author | Jim Grosbach <grosbach@apple.com> | 2011-05-19 00:45:05 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2011-05-19 00:45:05 +0000 |
commit | c0ceedb6f885b1cbd3d3cea02f695afe393dfd2c (patch) | |
tree | 8e093e83ce89b041fd5529e6cf5a37dd4dcba553 /lib/ExecutionEngine | |
parent | 1f5812bd995afc97d32061c532aaa0aedbead9ff (diff) |
Avoid a Twine that referenced a tmp (which proceded to go out of scope before
the Twine was used).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine')
-rw-r--r-- | lib/ExecutionEngine/MCJIT/MCJIT.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/lib/ExecutionEngine/MCJIT/MCJIT.cpp index 09a79f64d4..4475f4d5c0 100644 --- a/lib/ExecutionEngine/MCJIT/MCJIT.cpp +++ b/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) { |