summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2014-10-22 23:18:42 +0000
committerLang Hames <lhames@gmail.com>2014-10-22 23:18:42 +0000
commitefe7e2267316adecf0bee20bd9e0da21924a59c7 (patch)
tree4ef983604dd16a2c2c2e42c96376289a57088dc6 /llvm/lib/ExecutionEngine
parent01aea5809f19901fc30fe40ff03b662c1bb90141 (diff)
downloadbcm5719-llvm-efe7e2267316adecf0bee20bd9e0da21924a59c7.tar.gz
bcm5719-llvm-efe7e2267316adecf0bee20bd9e0da21924a59c7.zip
[MCJIT] Make repeat calls to MCJIT::getPointerToFunction for declarations safe.
MCJIT::getPointerForFunction adds the resulting address to the global mapping. This should be done via updateGlobalMapping rather than addGlobalMapping, since the latter asserts if a mapping already exists. MCJIT::getPointerToFunction is actually deprecated - hopefully we can remove it (or more likely re-task it) entirely soon. In the mean time it should at least work as advertised. <rdar://problem/18727946> llvm-svn: 220444
Diffstat (limited to 'llvm/lib/ExecutionEngine')
-rw-r--r--llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
index 9469d108e2e..8f1662f6ee7 100644
--- a/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
+++ b/llvm/lib/ExecutionEngine/MCJIT/MCJIT.cpp
@@ -357,7 +357,7 @@ void *MCJIT::getPointerToFunction(Function *F) {
if (F->isDeclaration() || F->hasAvailableExternallyLinkage()) {
bool AbortOnFailure = !F->hasExternalWeakLinkage();
void *Addr = getPointerToNamedFunction(Name, AbortOnFailure);
- addGlobalMapping(F, Addr);
+ updateGlobalMapping(F, Addr);
return Addr;
}
OpenPOWER on IntegriCloud