[jit] Remove a few LLVM_MONO_BRANCH defines, we don't support non-mono versions of...
authorZoltan Varga <vargaz@gmail.com>
Fri, 8 Nov 2013 04:22:46 +0000 (05:22 +0100)
committerZoltan Varga <vargaz@gmail.com>
Fri, 8 Nov 2013 04:24:30 +0000 (05:24 +0100)
mono/mini/ir-emit.h
mono/mini/mini-llvm-cpp.cpp
mono/mini/mini-llvm.c
mono/mini/mini.h

index 306dfde3a6f5e588595841d26d12fa22eda3a020..0f95ef6897b85b767e1d7cf4ae001e7720581eed 100644 (file)
@@ -835,8 +835,6 @@ static int ccount = 0;
 
 /* Loads/Stores which can fault are handled correctly by the LLVM mono branch */
 #define MONO_EMIT_NEW_IMPLICIT_EXCEPTION_LOAD_STORE(cfg) do { \
-       if (COMPILE_LLVM (cfg) && !IS_LLVM_MONO_BRANCH)                 \
-               MONO_EMIT_NEW_IMPLICIT_EXCEPTION ((cfg));                       \
     } while (0)
 
 /* Emit an explicit null check which doesn't depend on SIGSEGV signal handling */
index aa89217904bac00baf1c6b979ddc326c7ab982d6..17bf59278ff7ca6c5c1019bdcca00307045f5b99 100644 (file)
@@ -262,17 +262,8 @@ public:
                 * 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);
        }
 };
@@ -547,7 +538,6 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func
   mono_mm->alloc_cb = alloc_cb;
   mono_mm->dlsym_cb = dlsym_cb;
 
-  //JITExceptionHandling = true;
   // PrettyStackTrace installs signal handlers which trip up libgc
   DisablePrettyStackTrace = true;
 
@@ -568,14 +558,6 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func
 #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);
@@ -587,12 +569,10 @@ mono_llvm_create_ee (LLVMModuleProviderRef MP, AllocCodeMemoryCb *alloc_cb, Func
   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", "");
index 6b4e93fe421fa739a9fc843c49ee8f3e5264af0e..848d8e302da6e08afa1058d2b16580e875003102 100644 (file)
@@ -2039,7 +2039,6 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
 
        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.
         */
@@ -2055,7 +2054,6 @@ process_call (EmitContext *ctx, MonoBasicBlock *bb, LLVMBuilderRef *builder_ref,
                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) {
@@ -4296,9 +4294,7 @@ mono_llvm_emit_method (MonoCompile *cfg)
        method = LLVMAddFunction (module, method_name, method_type);
        ctx->lmethod = method;
 
-#ifdef LLVM_MONO_BRANCH
        LLVMSetFunctionCallConv (method, LLVMMono1CallConv);
-#endif
        LLVMSetLinkage (method, LLVMPrivateLinkage);
 
        LLVMAddFunctionAttr (method, LLVMUWTable);
index 87838b236acc4410b75b3bae5a59b70ee2e6e023..f24b7b6b9230027483eefb28f0d8336de2f69a44 100644 (file)
 #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 */