1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00

Reapply r57340. VMKit does not presently rely on materializeFunction

being called with the lock released, and this fixes a race condition
in the JIT as used by lli.

llvm-svn: 64997
This commit is contained in:
Dan Gohman 2009-02-19 02:40:15 +00:00
parent e4786f67e6
commit d4a9fb3478

View File

@ -553,6 +553,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.
@ -578,8 +580,6 @@ void *JIT::getPointerToFunction(Function *F) {
return Addr;
}
MutexGuard locked(lock);
if (F->isDeclaration()) {
bool AbortOnFailure = F->getLinkage() != GlobalValue::ExternalWeakLinkage;
void *Addr = getPointerToNamedFunction(F->getName(), AbortOnFailure);