summaryrefslogtreecommitdiffstats
path: root/llvm/lib/ExecutionEngine/JIT/JIT.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/ExecutionEngine/JIT/JIT.cpp')
-rw-r--r--llvm/lib/ExecutionEngine/JIT/JIT.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/ExecutionEngine/JIT/JIT.cpp b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
index 9595099c3c0..008c5907d83 100644
--- a/llvm/lib/ExecutionEngine/JIT/JIT.cpp
+++ b/llvm/lib/ExecutionEngine/JIT/JIT.cpp
@@ -475,9 +475,12 @@ GenericValue JIT::runFunction(Function *F,
/// GlobalAddress[F] with the address of F's machine code.
///
void JIT::runJITOnFunction(Function *F) {
- static bool isAlreadyCodeGenerating = false;
-
MutexGuard locked(lock);
+ runJITOnFunctionUnlocked(F, locked);
+}
+
+void JIT::runJITOnFunctionUnlocked(Function *F, const MutexGuard &locked) {
+ static bool isAlreadyCodeGenerating = false;
assert(!isAlreadyCodeGenerating && "Error: Recursive compilation detected!");
// JIT the function
@@ -537,7 +540,7 @@ void *JIT::getPointerToFunction(Function *F) {
return Addr;
}
- runJITOnFunction(F);
+ runJITOnFunctionUnlocked(F, locked);
void *Addr = getPointerToGlobalIfAvailable(F);
assert(Addr && "Code generation didn't add function to GlobalAddress table!");
OpenPOWER on IntegriCloud