Commit 21fc2fbd authored by Eduardo Souza's avatar Eduardo Souza

Adding support for using llvm backend.

parent 817e353c
......@@ -405,7 +405,11 @@ pub fn compile_fncs<'a>(
/// gets the path for the generated code of a Mu function
fn get_path_for_mu_func(f: MuName, vm: &VM) -> PathBuf {
let mut ret = PathBuf::from(&vm.vm_options.flag_aot_emit_dir);
ret.push((*f).clone() + ".S");
if vm.vm_options.flag_generate_llvm {
ret.push((*f).clone() + "_llvm.S");
} else {
ret.push((*f).clone() + ".S");
}
ret
}
......
......@@ -72,9 +72,9 @@ pub struct VM {
/// next MuID to assign
next_id: AtomicUsize, // +0
/// a map from MuID to MuName (for client to query)
id_name_map: RwLock<HashMap<MuID, MuName>>, // +8
pub id_name_map: RwLock<HashMap<MuID, MuName>>, // +8
/// a map from MuName to ID (for client to query)
name_id_map: RwLock<HashMap<MuName, MuID>>, // +64
pub name_id_map: RwLock<HashMap<MuName, MuID>>, // +64
/// types declared to the VM
types: RwLock<HashMap<MuID, P<MuType>>>, // +120
/// types that are resolved as BackendType
......@@ -117,7 +117,7 @@ pub struct VM {
/// heap, the store happens before we have an actual address for the
/// function so we store a fake funcref and when generating boot image,
/// we fix the funcref with a relocatable symbol
aot_pending_funcref_store: RwLock<HashMap<Address, ValueLocation>>,
pub aot_pending_funcref_store: RwLock<HashMap<Address, ValueLocation>>,
/// runtime callsite table for exception handling
/// a map from callsite address to CompiledCallsite
......@@ -1270,7 +1270,7 @@ impl<'a> VM {
/// links boot image (generates a dynamic library is the specified output
/// file has dylib extension, otherwise generates an executable)
#[cfg(feature = "aot")]
fn link_boot_image(
pub fn link_boot_image(
&self,
funcs: Vec<MuID>,
extra_srcs: Vec<String>,
......
......@@ -44,6 +44,7 @@ AOT Compiler:
[default: ]
--bootimage-external-libpath=<path> ... path for the libraries during bootimage generation
[default: ]
--generate-llvm generate compiler through LLVM IR
Garbage Collection:
--gc-disable-collection disable collection
......@@ -71,6 +72,7 @@ pub struct VMOptions {
pub flag_aot_link_static: bool,
pub flag_bootimage_external_lib: Vec<String>,
pub flag_bootimage_external_libpath: Vec<String>,
pub flag_generate_llvm: bool,
// GC
pub flag_gc_disable_collection: bool,
......@@ -93,6 +95,7 @@ rodal_struct!(VMOptions {
flag_disable_ir_validate,
flag_emit_debug_info,
flag_aot_link_static,
flag_generate_llvm,
flag_gc_disable_collection
});
......
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