Use roc_target over target_lexicon

Tailors a target class for our needs.
Replaces tons of uses across the entire compiler.
This is a base for later adding new targets like thumb.
This commit is contained in:
Brendan Hansknecht 2024-03-21 21:54:58 -07:00
parent 185262510c
commit 6dc5bfb1b7
No known key found for this signature in database
GPG key ID: 0EA784685083E75B
72 changed files with 1008 additions and 1371 deletions

View file

@ -56,7 +56,7 @@ pub fn helper(
}
let load_config = LoadConfig {
target_info: roc_target::TargetInfo::default_x86_64(),
target: roc_target::Target::LinuxX64,
render: roc_reporting::report::RenderTarget::ColorTerminal,
palette: roc_reporting::report::DEFAULT_PALETTE,
threading: Threading::Single,
@ -197,14 +197,9 @@ pub fn helper(
mode: roc_gen_dev::AssemblyBackendMode::Test,
};
let target = target_lexicon::Triple::host();
let module_object = roc_gen_dev::build_module(
&env,
&mut interns,
&mut layout_interner,
&target,
procedures,
);
let target = target_lexicon::Triple::host().into();
let module_object =
roc_gen_dev::build_module(&env, &mut interns, &mut layout_interner, target, procedures);
let module_out = module_object
.write()
@ -215,7 +210,7 @@ pub fn helper(
roc_bitcode::host_tempfile().expect("failed to write host builtins object to tempfile");
let (mut child, dylib_path) = link(
&target,
target,
app_o_file.clone(),
// Long term we probably want a smarter way to link in zig builtins.
// With the current method all methods are kept and it adds about 100k to all outputs.