Split out an optional "llvm" feature

Also move OptLevel out of roc_gen (which
should really be called gen_llvm) and into roc_mono,
so it's no longer coupled to LLVM.
This commit is contained in:
Richard Feldman 2021-06-06 00:17:42 -04:00
parent 0e5619c422
commit b05342c678
14 changed files with 143 additions and 76 deletions

View file

@ -6,6 +6,7 @@ use roc_can::def::Def;
use roc_collections::all::{MutMap, MutSet};
use roc_gen::llvm::externs::add_default_roc_externs;
use roc_module::symbol::Symbol;
use roc_mono::ir::OptLevel;
use roc_types::subs::VarStore;
fn promote_expr_to_module(src: &str) -> String {
@ -190,9 +191,9 @@ pub fn helper<'a>(
module.strip_debug_info();
let opt_level = if cfg!(debug_assertions) {
roc_gen::llvm::build::OptLevel::Normal
OptLevel::Normal
} else {
roc_gen::llvm::build::OptLevel::Optimize
OptLevel::Optimize
};
let module = arena.alloc(module);