minor cleanups, no functionality change

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28087 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-05-03 18:55:56 +00:00
parent 1e3822c776
commit d2d5c76753

View File

@@ -487,20 +487,20 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
// If the target REALLY wants a stub for this function, emit it now. // If the target REALLY wants a stub for this function, emit it now.
if (!MR.doesntNeedFunctionStub()) if (!MR.doesntNeedFunctionStub())
ResultPtr = getJITResolver(this).getExternalFunctionStub(ResultPtr); ResultPtr = getJITResolver(this).getExternalFunctionStub(ResultPtr);
} else if (MR.isGlobalValue()) } else if (MR.isGlobalValue()) {
ResultPtr = getPointerToGlobal(MR.getGlobalValue(), ResultPtr = getPointerToGlobal(MR.getGlobalValue(),
BufferBegin+MR.getMachineCodeOffset(), BufferBegin+MR.getMachineCodeOffset(),
MR.doesntNeedFunctionStub()); MR.doesntNeedFunctionStub());
else //ConstantPoolIndex } else {
ResultPtr = assert(MR.isConstantPoolIndex());
(void*)(intptr_t)getConstantPoolEntryAddress(MR.getConstantPoolIndex()); ResultPtr=(void*)getConstantPoolEntryAddress(MR.getConstantPoolIndex());
}
MR.setResultPointer(ResultPtr); MR.setResultPointer(ResultPtr);
// if we are managing the GOT and the relocation wants an index, // if we are managing the GOT and the relocation wants an index,
// give it one // give it one
if (MemMgr.isManagingGOT() && !MR.isConstantPoolIndex() && if (MemMgr.isManagingGOT() && MR.isGOTRelative()) {
MR.isGOTRelative()) {
unsigned idx = getJITResolver(this).getGOTIndexForAddr(ResultPtr); unsigned idx = getJITResolver(this).getGOTIndexForAddr(ResultPtr);
MR.setGOTIndex(idx); MR.setGOTIndex(idx);
if (((void**)MemMgr.getGOTBase())[idx] != ResultPtr) { if (((void**)MemMgr.getGOTBase())[idx] != ResultPtr) {
@@ -516,7 +516,7 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
Relocations.size(), MemMgr.getGOTBase()); Relocations.size(), MemMgr.getGOTBase());
} }
//Update the GOT entry for F to point to the new code. // Update the GOT entry for F to point to the new code.
if(MemMgr.isManagingGOT()) { if(MemMgr.isManagingGOT()) {
unsigned idx = getJITResolver(this).getGOTIndexForAddr((void*)BufferBegin); unsigned idx = getJITResolver(this).getGOTIndexForAddr((void*)BufferBegin);
if (((void**)MemMgr.getGOTBase())[idx] != (void*)BufferBegin) { if (((void**)MemMgr.getGOTBase())[idx] != (void*)BufferBegin) {