mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-19 11:30:15 +00:00
generate nested rc procs
This commit is contained in:
parent
06c3376577
commit
151b5c9336
2 changed files with 22 additions and 1 deletions
|
@ -267,6 +267,27 @@ fn build_object<'a, B: Backend<'a>>(
|
|||
helper_names_symbols_procs.push((fn_name, section_id, proc_id, proc));
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
// The symbol isn't defined yet and will just be used by other rc procs.
|
||||
let section_id = output.add_section(
|
||||
output.segment_name(StandardSegment::Text).to_vec(),
|
||||
format!(".text.{:x}", sym.as_u64()).as_bytes().to_vec(),
|
||||
SectionKind::Text,
|
||||
);
|
||||
|
||||
let rc_symbol = Symbol {
|
||||
name: fn_name.as_bytes().to_vec(),
|
||||
value: 0,
|
||||
size: 0,
|
||||
kind: SymbolKind::Text,
|
||||
scope: SymbolScope::Linkage,
|
||||
weak: false,
|
||||
section: SymbolSection::Section(section_id),
|
||||
flags: SymbolFlags::None,
|
||||
};
|
||||
let proc_id = output.add_symbol(rc_symbol);
|
||||
helper_names_symbols_procs.push((fn_name, section_id, proc_id, proc));
|
||||
continue;
|
||||
}
|
||||
internal_error!("failed to create rc fn for symbol {:?}", sym);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue