When resolving a stub in x86-64 JIT, use a PC-relative branch
[oota-llvm.git] / lib / Target / Alpha / AlphaJITInfo.cpp
index a20ae9fd5e5cdc0811a9cb8ecb70d92fcba8ac55..4fd0ebcaef8432c64c0fabfafed6a65bc2d54b81 100644 (file)
@@ -14,6 +14,7 @@
 #define DEBUG_TYPE "jit"
 #include "AlphaJITInfo.h"
 #include "AlphaRelocations.h"
+#include "llvm/Function.h"
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/Config/alloca.h"
 #include "llvm/Support/Debug.h"
@@ -190,16 +191,17 @@ extern "C" {
 #endif
 }
 
-void *AlphaJITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) {
+void *AlphaJITInfo::emitFunctionStub(const Function* F, void *Fn,
+                                     MachineCodeEmitter &MCE) {
   //assert(Fn == AlphaCompilationCallback && "Where are you going?\n");
   //Do things in a stupid slow way!
-  MCE.startFunctionStub(19*4);
+  MCE.startFunctionStub(F, 19*4);
   void* Addr = (void*)(intptr_t)MCE.getCurrentPCValue();
   for (int x = 0; x < 19; ++ x)
     MCE.emitWordLE(0);
   EmitBranchToAt(Addr, Fn);
   DOUT << "Emitting Stub to " << Fn << " at [" << Addr << "]\n";
-  return MCE.finishFunctionStub(0);
+  return MCE.finishFunctionStub(F);
 }
 
 TargetJITInfo::LazyResolverFn