From db89e312d968c258aba3c79c1c398f5fb19267a3 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 14 Jun 2009 09:23:33 +0000 Subject: Import LLVM r73340. --- lib/ExecutionEngine/JIT/JIT.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/ExecutionEngine/JIT/JIT.cpp') diff --git a/lib/ExecutionEngine/JIT/JIT.cpp b/lib/ExecutionEngine/JIT/JIT.cpp index f8ae884..43995cb 100644 --- a/lib/ExecutionEngine/JIT/JIT.cpp +++ b/lib/ExecutionEngine/JIT/JIT.cpp @@ -563,6 +563,11 @@ void *JIT::getPointerToFunction(Function *F) { return Addr; // Check if function already code gen'd MutexGuard locked(lock); + + // Now that this thread owns the lock, check if another thread has already + // code gen'd the function. + if (void *Addr = getPointerToGlobalIfAvailable(F)) + return Addr; // Make sure we read in the function if it exists in this Module. if (F->hasNotBeenReadFromBitcode()) { -- cgit v1.1