diff --git a/Cargo.lock b/Cargo.lock index 768b6a6fb6f3fac6f5fa3133aa9a543d6e9dd93d..a11c766c05725b18878f26c7f920b2d57e7a97fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -677,6 +677,7 @@ dependencies = [ "anyhow", "hercules_cg", "hercules_ir", + "hercules_opt", "postcard", "serde", ] diff --git a/hercules_opt/src/pass.rs b/hercules_opt/src/pass.rs index c61177a014c8661865adcd03b1b5736196be33b6..719819fff19b4f937250e2d3c74b9a7c4f373a4c 100644 --- a/hercules_opt/src/pass.rs +++ b/hercules_opt/src/pass.rs @@ -64,8 +64,11 @@ pub struct PassManager { pub antideps: Option<Vec<Vec<(NodeID, NodeID)>>>, pub bbs: Option<Vec<Vec<NodeID>>>, - // Current plan. Keep track of the last time the plan was updated. + // Current plan. pub plans: Option<Vec<Plan>>, + + // Store the manifest of a compiled object. + pub manifests: Option<HashMap<String, Manifest>>, } impl PassManager { @@ -85,6 +88,7 @@ impl PassManager { antideps: None, bbs: None, plans: None, + manifests: None, } } @@ -565,6 +569,7 @@ impl PassManager { .expect("PANIC: Unable to open output manifest file."); file.write_all(&hman_contents) .expect("PANIC: Unable to write output manifest file contents."); + self.manifests = Some(smodule.manifests); // Codegen doesn't require clearing analysis results. continue; @@ -605,4 +610,8 @@ impl PassManager { pub fn get_module(self) -> Module { self.module } + + pub fn get_manifests(self) -> HashMap<String, Manifest> { + self.manifests.unwrap() + } } diff --git a/hercules_rt_proc/Cargo.toml b/hercules_rt_proc/Cargo.toml index c6e55af051cd412aa5930a8239a933fa64fcb828..124207257a19e8ca05f7decafb123c1b604998eb 100644 --- a/hercules_rt_proc/Cargo.toml +++ b/hercules_rt_proc/Cargo.toml @@ -12,4 +12,5 @@ postcard = { version = "*", features = ["alloc"] } serde = { version = "*", features = ["derive"] } hercules_cg = { path = "../hercules_cg" } hercules_ir = { path = "../hercules_ir" } +hercules_opt = { path = "../hercules_opt" } anyhow = "*" \ No newline at end of file