unsigned char *getGOTBase() const {
return mm->getGOTBase ();
}
-
+
+#if LLVM_MAJOR_VERSION == 2 && LLVM_MINOR_VERSION < 7
void *getDlsymTable() const {
return mm->getDlsymTable ();
}
+ void SetDlsymTable(void *ptr);
+#endif
+
void setPoisonMemory(bool) {
}
-
- void SetDlsymTable(void *ptr);
-
+
unsigned char *startFunctionBody(const Function *F,
uintptr_t &ActualSize);
void endExceptionTable(const Function *F, unsigned char *TableStart,
unsigned char *TableEnd,
unsigned char* FrameRegister);
+
+#if LLVM_MAJOR_VERSION == 2 && LLVM_MINOR_VERSION >= 7
+ virtual void deallocateFunctionBody(void*) {
+ }
+
+ virtual void deallocateExceptionTable(void*) {
+ }
+#endif
};
MonoJITMemoryManager::MonoJITMemoryManager ()
{
mm->AllocateGOT ();
}
-
+
+#if LLVM_MAJOR_VERSION == 2 && LLVM_MINOR_VERSION < 7
void
MonoJITMemoryManager::SetDlsymTable(void *ptr)
{
mm->SetDlsymTable (ptr);
}
-
+#endif
+
unsigned char *
MonoJITMemoryManager::startFunctionBody(const Function *F,
uintptr_t &ActualSize)
return wrap(unwrap(builder)->CreateLoad(unwrap(PointerVal), true, Name));
}
+void
+mono_llvm_replace_uses_of (LLVMValueRef var, LLVMValueRef v)
+{
+ Value *V = ConstantExpr::getTruncOrBitCast (unwrap<Constant> (v), unwrap (var)->getType ());
+ unwrap (var)->replaceAllUsesWith (V);
+}
+
static cl::list<const PassInfo*, bool, PassNameParser>
PassList(cl::desc("Optimizations available:"));