Resolve BB references with relocation.
[oota-llvm.git] / lib / ExecutionEngine / JIT / JITEmitter.cpp
index e048189fc2efaa620a173997625cea2d39c501b6..dc9ba28371e669fb1d0f226d04cd64306ccdbc90 100644 (file)
@@ -807,13 +807,13 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
         ResultPtr = getPointerToGlobal(MR.getGlobalValue(),
                                        BufferBegin+MR.getMachineCodeOffset(),
                                        MR.doesntNeedFunctionStub());
+      } else if (MR.isBasicBlock()) {
+        ResultPtr = (void*)getMachineBasicBlockAddress(MR.getBasicBlock());
       } else if (MR.isConstantPoolIndex()){
-        assert(MR.isConstantPoolIndex());
         ResultPtr=(void*)getConstantPoolEntryAddress(MR.getConstantPoolIndex());
       } else {
         assert(MR.isJumpTableIndex());
         ResultPtr=(void*)getJumpTableEntryAddress(MR.getJumpTableIndex());
-
       }
 
       MR.setResultPointer(ResultPtr);
@@ -846,9 +846,6 @@ bool JITEmitter::finishFunction(MachineFunction &F) {
     }
   }
 
-  // Resolve BasicaBlock references.
-  TheJIT->getJITInfo().resolveBBRefs(*this);
-
   // Invalidate the icache if necessary.
   synchronizeICache(FnStart, FnEnd-FnStart);