Clarify some lowlevel code to make it clearer what to do when adding new ones

This commit is contained in:
Brian Carroll 2021-12-29 22:03:25 +00:00
parent 5ac12efbe5
commit 6b932f9743
4 changed files with 152 additions and 135 deletions

View file

@ -6,7 +6,7 @@ use bumpalo::{collections::Vec, Bump};
use roc_builtins::bitcode::{self, FloatWidth, IntWidth};
use roc_collections::all::{MutMap, MutSet};
use roc_module::ident::{ModuleName, TagName};
use roc_module::low_level::LowLevel;
use roc_module::low_level::{LowLevel, LowLevelWrapperType};
use roc_module::symbol::{Interns, ModuleId, Symbol};
use roc_mono::code_gen_help::CodeGenHelp;
use roc_mono::ir::{
@ -260,8 +260,9 @@ trait Backend<'a> {
ret_layout,
..
} => {
// If this function is just a lowlevel wrapper, then inline it
if let Some(lowlevel) = LowLevel::from_inlined_wrapper(*func_sym) {
if let LowLevelWrapperType::CanBeReplacedBy(lowlevel) =
LowLevelWrapperType::from_symbol(*func_sym)
{
self.build_run_low_level(
sym,
&lowlevel,