Merge branch 'trunk' into gen-dev/mem

This commit is contained in:
Brendan Hansknecht 2021-09-05 21:31:05 -07:00 committed by GitHub
commit 08aa3d31d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 652 additions and 428 deletions

View file

@ -8,7 +8,9 @@ use roc_collections::all::{MutMap, MutSet};
use roc_module::ident::{ModuleName, TagName};
use roc_module::low_level::LowLevel;
use roc_module::symbol::{Interns, Symbol};
use roc_mono::ir::{BranchInfo, CallType, Expr, JoinPointId, Literal, Proc, Stmt};
use roc_mono::ir::{
BranchInfo, CallType, Expr, JoinPointId, ListLiteralElement, Literal, Proc, Stmt,
};
use roc_mono::layout::{Builtin, Layout, LayoutIds};
use target_lexicon::Triple;
@ -150,7 +152,7 @@ where
match expr {
Expr::Literal(lit) => {
if self.env().lazy_literals {
self.literal_map().insert(*sym, lit.clone());
self.literal_map().insert(*sym, *lit);
} else {
self.load_literal(sym, lit)?;
}
@ -618,8 +620,10 @@ where
owning_symbol.insert(*sym, *structure);
}
Expr::Array { elems, .. } => {
for sym in *elems {
self.set_last_seen(*sym, stmt, &owning_symbol);
for elem in *elems {
if let ListLiteralElement::Symbol(sym) = elem {
self.set_last_seen(*sym, stmt, &owning_symbol);
}
}
}
Expr::Reuse {