Commit 944db198 authored by Isaac Oscar Gariano's avatar Isaac Oscar Gariano

Link dynamically and dont dump name/id maps

parent 9f42305a
......@@ -306,7 +306,6 @@ impl CompilerPass for GenMovPhi {
block_info.blk_id,
block_info.blk_name.clone()
));
//vm.set_name(ret.as_entity());
let mut target_block = f_content.get_block_mut(target_id);
assert!(target_block.content.is_some());
......
......@@ -255,7 +255,6 @@ impl Inlining {
body: vec![],
keepalives: None
});
//vm.set_name(cur_block.as_entity());
// deal with the inlined function
copy_inline_blocks(
......@@ -312,7 +311,6 @@ impl Inlining {
let mut intermediate_block = Block::new(
MuEntityHeader::named(vm.next_id(), int_block_name)
);
//vm.set_name(intermediate_block.as_entity());
// branch to normal_dest with normal_dest arguments
let normal_dest_args =
......
......@@ -56,7 +56,6 @@ impl CompilerPass for RetSink {
let mut block = Block::new(MuEntityHeader::named(vm.next_id(), block_name));
// tell the compiler this is the return sink
block.trace_hint = TraceHint::ReturnSink;
//vm.set_name(block.as_entity());
let sig = func.sig.clone();
let args: Vec<P<Value>> = sig.ret_tys
......
......@@ -441,7 +441,6 @@ fn branch_adjustment(func: &mut MuFunctionVersion, vm: &VM) {
Arc::new(format!("{}:#{}:false", func.name(), node.id()));
let mut block =
Block::new(MuEntityHeader::named(vm.next_id(), block_name));
//vm.set_name(block.as_entity());
let block_args: Vec<P<TreeNode>> = false_dest
.args
......
......@@ -60,11 +60,11 @@ pub fn link_primordial(funcs: Vec<MuName>, out: &str, vm: &VM) -> PathBuf {
ret.push(dest);
// include mu static lib
ret.push(get_path_under_zebu(if cfg!(debug_assertions) {
/*ret.push(get_path_under_zebu(if cfg!(debug_assertions) {
"target/debug/libmu.a"
} else {
"target/release/libmu.a"
}));
}));*/
ret
};
......@@ -116,12 +116,12 @@ pub fn link_test_primordial(funcs: Vec<MuName>, out: &str, vm: &VM) -> PathBuf {
// include the primordial C main
ret.push(dest);
// include mu static lib
/*// include mu static lib
ret.push(get_path_under_zebu(if cfg!(debug_assertions) {
"target/debug/libmu.a"
} else {
"target/release/libmu.a"
}));
}));*/
ret
};
......@@ -156,6 +156,12 @@ fn link_executable_internal(
cc.arg(format!("-l{}", l));
}
cc.arg(format!("-L{}", get_path_under_zebu(if cfg!(debug_assertions) {
"target/debug"
} else {
"target/release"
}).to_str().unwrap()));
// dylibs used for linux
if cfg!(target_os = "linux") {
cc.arg("-ldl");
......@@ -163,6 +169,7 @@ fn link_executable_internal(
cc.arg("-lm");
cc.arg("-lpthread");
cc.arg("-lz");
cc.arg("-lmu");
} else if cfg!(target_os = "macos") {
cc.arg("-liconv");
cc.arg("-framework");
......@@ -174,6 +181,7 @@ fn link_executable_internal(
cc.arg("-lresolv");
cc.arg("-lc");
cc.arg("-lm");
cc.arg("-lmu");
}
// all the source code
......
......@@ -133,7 +133,19 @@ unsafe impl rodal::Dump for VM {
dumper.debug_record("VM", "dump");
dumper.dump_object(&self.next_id);
dumper.dump_object(&self.id_name_map);
dumper.dump_padding(&self.id_name_map);
let id_name_map = RwLock::new(
rodal::EmptyHashMap::<MuID, MuName>::new()
);
dumper.dump_object_here(&id_name_map);
dumper.dump_padding(&self.name_id_map);
let name_id_map = RwLock::new(
rodal::EmptyHashMap::<MuName, MuID>::new()
);
dumper.dump_object_here(&name_id_map);
dumper.dump_object(&self.name_id_map);
dumper.dump_object(&self.types);
dumper.dump_object(&self.ref_types);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment