From 005d7174c8d9257cd39eede9157fddec3928ec33 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 3 May 2006 18:55:56 +0000 Subject: [PATCH] minor cleanups, no functionality change llvm-svn: 28087 --- llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp index 4a6cd715a580..966b154da1f5 100644 --- a/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp +++ b/llvm/lib/ExecutionEngine/JIT/JITEmitter.cpp @@ -487,20 +487,20 @@ bool JITEmitter::finishFunction(MachineFunction &F) { // If the target REALLY wants a stub for this function, emit it now. if (!MR.doesntNeedFunctionStub()) ResultPtr = getJITResolver(this).getExternalFunctionStub(ResultPtr); - } else if (MR.isGlobalValue()) + } else if (MR.isGlobalValue()) { ResultPtr = getPointerToGlobal(MR.getGlobalValue(), BufferBegin+MR.getMachineCodeOffset(), MR.doesntNeedFunctionStub()); - else //ConstantPoolIndex - ResultPtr = - (void*)(intptr_t)getConstantPoolEntryAddress(MR.getConstantPoolIndex()); + } else { + assert(MR.isConstantPoolIndex()); + ResultPtr=(void*)getConstantPoolEntryAddress(MR.getConstantPoolIndex()); + } MR.setResultPointer(ResultPtr); // if we are managing the GOT and the relocation wants an index, // give it one - if (MemMgr.isManagingGOT() && !MR.isConstantPoolIndex() && - MR.isGOTRelative()) { + if (MemMgr.isManagingGOT() && MR.isGOTRelative()) { unsigned idx = getJITResolver(this).getGOTIndexForAddr(ResultPtr); MR.setGOTIndex(idx); if (((void**)MemMgr.getGOTBase())[idx] != ResultPtr) { @@ -516,7 +516,7 @@ bool JITEmitter::finishFunction(MachineFunction &F) { 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()) { unsigned idx = getJITResolver(this).getGOTIndexForAddr((void*)BufferBegin); if (((void**)MemMgr.getGOTBase())[idx] != (void*)BufferBegin) {