mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-15 06:29:05 +00:00
Try to fix JITTest.FarCallToKnownFunction on ARM and PPC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89410 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -736,17 +736,21 @@ void *JITEmitter::getPointerToGlobal(GlobalValue *V, void *Reference,
|
|||||||
return FnStub;
|
return FnStub;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Otherwise if we have code, go ahead and return that.
|
// If we know the target can handle arbitrary-distance calls, try to
|
||||||
void *ResultPtr = TheJIT->getPointerToGlobalIfAvailable(F);
|
// return a direct pointer.
|
||||||
if (ResultPtr) return ResultPtr;
|
if (!MayNeedFarStub) {
|
||||||
|
// If we have code, go ahead and return that.
|
||||||
|
void *ResultPtr = TheJIT->getPointerToGlobalIfAvailable(F);
|
||||||
|
if (ResultPtr) return ResultPtr;
|
||||||
|
|
||||||
// If this is an external function pointer, we can force the JIT to
|
// If this is an external function pointer, we can force the JIT to
|
||||||
// 'compile' it, which really just adds it to the map.
|
// 'compile' it, which really just adds it to the map.
|
||||||
if (F->isDeclaration() && !F->hasNotBeenReadFromBitcode() &&
|
if (F->isDeclaration() && !F->hasNotBeenReadFromBitcode())
|
||||||
!MayNeedFarStub)
|
return TheJIT->getPointerToFunction(F);
|
||||||
return TheJIT->getPointerToFunction(F);
|
}
|
||||||
|
|
||||||
// Otherwise, we have to emit a stub.
|
// Otherwise, we may need a to emit a stub, and, conservatively, we
|
||||||
|
// always do so.
|
||||||
void *StubAddr = Resolver.getFunctionStub(F);
|
void *StubAddr = Resolver.getFunctionStub(F);
|
||||||
|
|
||||||
// Add the stub to the current function's list of referenced stubs, so we can
|
// Add the stub to the current function's list of referenced stubs, so we can
|
||||||
|
Reference in New Issue
Block a user