MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / compile_modules

Method compile_modules

src/compilation_pipeline.rs:1036–1057  ·  view source on GitHub ↗
(
        &mut self,
        modules: &[(&str, &str)],
    )

Source from the content-addressed store, hash-verified

1034 let mut out = ObjectLinker::link(modules)?;
1035 let layout = self.effective_link_layout();
1036 if layout.emit_layout_symbols {
1037 out.inject_layout_symbols(&layout);
1038 }
1039 out.mark_entry_global(self.effective_entry_point());
1040 let stem = sanitize_artifact_component(stem);
1041 *self.last_artifact_stem.borrow_mut() = Some(stem.clone());
1042 self.write_bytes_artifact(
1043 "elf",
1044 &format!("total_{stem}"),
1045 ".elf",
1046 &out.to_elf_with_entry(self.effective_load_base(), self.effective_entry_point()),
1047 );
1048 Ok(out)
1049 }
1050
1051 /// Compile named modules independently, one `.o` each, returned in input order.
1052 /// Fails with the diagnostics of the first module that does not compile.
1053 #[track_caller]
1054 pub fn compile_modules(
1055 &mut self,
1056 modules: &[(&str, &str)],
1057 ) -> Result<Vec<AssembledOutput>, CompilationError> {
1058 let mut result = Vec::with_capacity(modules.len());
1059
1060 for (module_name, source) in modules {

Calls 5

set_artifact_stemMethod · 0.80
assemble_namedMethod · 0.80
pushMethod · 0.80
compileMethod · 0.45