Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
[oota-llvm.git] / lib / Target / X86 / X86JITInfo.cpp
index d5d3cda2dc6c3237348cea413d2d78dff4dc11c2..cb16c6c26b99201c2a064ff7fa8e467826debe53 100644 (file)
@@ -18,6 +18,7 @@
 #include "llvm/CodeGen/MachineCodeEmitter.h"
 #include "llvm/Config/alloca.h"
 #include <cstdlib>
+#include <cstring>
 using namespace llvm;
 
 #ifdef _MSC_VER
@@ -387,7 +388,7 @@ void *X86JITInfo::emitGlobalValueLazyPtr(void *GV, MachineCodeEmitter &MCE) {
   MCE.emitWordLE(((unsigned *)&GV)[1]);
 #else
   MCE.startFunctionStub(4, 4);
-  MCE.emitWordLE((unsigned)GV);
+  MCE.emitWordLE((intptr_t)GV);
 #endif
   return MCE.finishFunctionStub(0);
 }
@@ -440,6 +441,12 @@ void *X86JITInfo::emitFunctionStub(void *Fn, MachineCodeEmitter &MCE) {
   return MCE.finishFunctionStub(0);
 }
 
+/// getPICJumpTableEntry - Returns the value of the jumptable entry for the
+/// specific basic block.
+intptr_t X86JITInfo::getPICJumpTableEntry(intptr_t BB, intptr_t Entry) {
+  return BB - PICBase;
+}
+
 /// relocate - Before the JIT can run a block of code that has been emitted,
 /// it must rewrite the code to contain the actual addresses of any
 /// referenced global symbols.