mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-14 11:32:34 +00: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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64997 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4b56f96bc6
commit
a3ac0c105d
@ -553,6 +553,8 @@ void *JIT::getPointerToFunction(Function *F) {
|
|||||||
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
if (void *Addr = getPointerToGlobalIfAvailable(F))
|
||||||
return Addr; // Check if function already code gen'd
|
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.
|
// Make sure we read in the function if it exists in this Module.
|
||||||
if (F->hasNotBeenReadFromBitcode()) {
|
if (F->hasNotBeenReadFromBitcode()) {
|
||||||
// Determine the module provider this function is provided by.
|
// Determine the module provider this function is provided by.
|
||||||
@ -578,8 +580,6 @@ void *JIT::getPointerToFunction(Function *F) {
|
|||||||
return Addr;
|
return Addr;
|
||||||
}
|
}
|
||||||
|
|
||||||
MutexGuard locked(lock);
|
|
||||||
|
|
||||||
if (F->isDeclaration()) {
|
if (F->isDeclaration()) {
|
||||||
bool AbortOnFailure = F->getLinkage() != GlobalValue::ExternalWeakLinkage;
|
bool AbortOnFailure = F->getLinkage() != GlobalValue::ExternalWeakLinkage;
|
||||||
void *Addr = getPointerToNamedFunction(F->getName(), AbortOnFailure);
|
void *Addr = getPointerToNamedFunction(F->getName(), AbortOnFailure);
|
||||||
|
Loading…
Reference in New Issue
Block a user