Revert "replace"

This reverts commit f43e346897.
This commit is contained in:
eiei114 2023-06-25 17:50:05 +09:00
parent f43e346897
commit c1d4a18c00
No known key found for this signature in database
GPG key ID: C740FAA53EE7B995
5 changed files with 552 additions and 654 deletions

View file

@ -3,7 +3,6 @@ use inkwell::context::Context;
use libloading::Library;
use roc_build::link::llvm_module_to_dylib;
use roc_collections::all::MutSet;
use roc_error_macros::internal_error;
use roc_gen_llvm::llvm::build::LlvmBackendMode;
use roc_gen_llvm::llvm::externs::add_default_roc_externs;
use roc_gen_llvm::{run_jit_function, run_jit_function_dynamic_type};
@ -264,7 +263,7 @@ fn mono_module_to_dylib<'a>(
if main_fn.verify(true) {
function_pass.run_on(&main_fn);
} else {
internal_error!("Main function {} failed LLVM verification in build. Uncomment things nearby to see more details.", main_fn_name);
panic!("Main function {} failed LLVM verification in build. Uncomment things nearby to see more details.", main_fn_name);
}
module_pass.run_on(env.module);
@ -274,7 +273,10 @@ fn mono_module_to_dylib<'a>(
// Verify the module
if let Err(errors) = env.module.verify() {
internal_error!("Errors defining module:\n{}", errors.to_string());
panic!(
"Errors defining module:\n{}\n\nUncomment things nearby to see more details.",
errors.to_string()
);
}
llvm_module_to_dylib(env.module, &target, opt_level)