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

@ -1,7 +1,7 @@
//! Provides the functionality for the REPL to evaluate Roc expressions.
use roc_parse::ast::Expr;
use roc_std::RocDec;
use roc_target::TargetInfo;
use roc_target::Target;
pub mod eval;
pub mod gen;
@ -28,7 +28,7 @@ pub trait ReplApp<'a> {
/// When the executed code calls roc_panic, this function will return None
fn call_function_returns_roc_str<T, F>(
&mut self,
target_info: TargetInfo,
target: Target,
main_fn_name: &str,
transform: F,
) -> Option<T>
@ -36,7 +36,7 @@ pub trait ReplApp<'a> {
F: Fn(&'a Self::Memory, usize) -> T,
Self::Memory: 'a,
{
let roc_str_width = match target_info.ptr_width() {
let roc_str_width = match target.ptr_width() {
roc_target::PtrWidth::Bytes4 => 12,
roc_target::PtrWidth::Bytes8 => 24,
};