* install a profiler hook and reset the code model here.
* This should be inside an ifdef, but we can't include our config.h either,
* since its definitions conflict with LLVM's config.h.
- *
+ * The LLVM mono branch contains a workaround.
*/
- //#if defined(TARGET_X86) || defined(TARGET_AMD64)
-#ifndef LLVM_MONO_BRANCH
- /* The LLVM mono branch contains a workaround, so this is not needed */
- if (Details.MF->getTarget ().getCodeModel () == CodeModel::Large) {
- Details.MF->getTarget ().setCodeModel (CodeModel::Default);
- }
-#endif
- //#endif
-
emitted_cb (wrap (&F), Code, (char*)Code + Size);
}
};
mono_mm->alloc_cb = alloc_cb;
mono_mm->dlsym_cb = dlsym_cb;
- //JITExceptionHandling = true;
// PrettyStackTrace installs signal handlers which trip up libgc
DisablePrettyStackTrace = true;
#endif
g_assert (EE);
-#if 0
- ExecutionEngine *EE = ExecutionEngine::createJIT (unwrap (MP), &Error, mono_mm, CodeGenOpt::Default, true, Reloc::Default, CodeModel::Large);
- if (!EE) {
- errs () << "Unable to create LLVM ExecutionEngine: " << Error << "\n";
- g_assert_not_reached ();
- }
-#endif
-
EE->InstallExceptionTableRegister (exception_cb);
mono_event_listener = new MonoJITEventListener (emitted_cb);
EE->RegisterJITEventListener (mono_event_listener);
PassRegistry &Registry = *PassRegistry::getPassRegistry();
initializeCore(Registry);
initializeScalarOpts(Registry);
- //initializeIPO(Registry);
initializeAnalysis(Registry);
initializeIPA(Registry);
initializeTransformUtils(Registry);
initializeInstCombine(Registry);
- //initializeInstrumentation(Registry);
initializeTarget(Registry);
llvm::cl::ParseEnvironmentOptions("mono", "MONO_LLVM", "");
lcall = emit_call (ctx, bb, &builder, callee, args, LLVMCountParamTypes (llvm_sig));
-#ifdef LLVM_MONO_BRANCH
/*
* Modify cconv and parameter attributes to pass rgctx/imt correctly.
*/
LLVMAddInstrAttribute (lcall, 1 + sinfo.rgctx_arg_pindex, LLVMInRegAttribute);
if (call->imt_arg_reg)
LLVMAddInstrAttribute (lcall, 1 + sinfo.imt_arg_pindex, LLVMInRegAttribute);
-#endif
/* Add byval attributes if needed */
for (i = 0; i < sig->param_count; ++i) {
method = LLVMAddFunction (module, method_name, method_type);
ctx->lmethod = method;
-#ifdef LLVM_MONO_BRANCH
LLVMSetFunctionCallConv (method, LLVMMono1CallConv);
-#endif
LLVMSetLinkage (method, LLVMPrivateLinkage);
LLVMAddFunctionAttr (method, LLVMUWTable);
#define LLVM_CHECK_VERSION(major,minor) 0
#endif
-/*
- * Whenever we are using mono's LLVM branch.
- * This can be used in if statements, code which references new definitions from the branch
- * still needs an #ifdef LLVM_MONO_BRANCH.
- */
-#ifdef LLVM_MONO_BRANCH
-#define IS_LLVM_MONO_BRANCH 1
-#else
-#define IS_LLVM_MONO_BRANCH 0
-#endif
-
#define NOT_IMPLEMENTED do { g_assert_not_reached (); } while (0)
/* for 32 bit systems */