summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorMon P Wang <wangmp@apple.com>2008-10-10 01:47:42 +0000
committerMon P Wang <wangmp@apple.com>2008-10-10 01:47:42 +0000
commit6e5eccf86b54bc8b0cc25c263ed0cfaff8670f28 (patch)
tree536f3b6fc081442870c13e3e0b03d16dfe76836a /llvm/lib
parentdfcc1ff8f8e6f98ba7d12fa194083ff0ba3ec724 (diff)
downloadbcm5719-llvm-6e5eccf86b54bc8b0cc25c263ed0cfaff8670f28.tar.gz
bcm5719-llvm-6e5eccf86b54bc8b0cc25c263ed0cfaff8670f28.zip
Moved guard mutex upwards to guard materializing a function
in getPointerToFunction llvm-svn: 57340
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JIT.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index 383b3804758..413308c3df8 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -489,6 +489,8 @@ void *JIT::getPointerToFunction(Function *F) {
if (void *Addr = getPointerToGlobalIfAvailable(F))
return Addr; // Check if function already code gen'd
+ MutexGuard locked(lock);
+
// Make sure we read in the function if it exists in this Module.
if (F->hasNotBeenReadFromBitcode()) {
// Determine the module provider this function is provided by.
@@ -509,13 +511,11 @@ void *JIT::getPointerToFunction(Function *F) {
abort();
}
}
-
+
if (void *Addr = getPointerToGlobalIfAvailable(F)) {
return Addr;
}
- MutexGuard locked(lock);
-
if (F->isDeclaration()) {
void *Addr = getPointerToNamedFunction(F->getName());
addGlobalMapping(F, Addr);
OpenPOWER on IntegriCloud