Skip to content

Commit

Permalink
Use System Default Calling Convention
Browse files Browse the repository at this point in the history
Signed-off-by: Afonso Bordado <[email protected]>
  • Loading branch information
afonso360 committed Jul 27, 2023
1 parent f14706c commit 185b5e0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cranelift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,15 @@ impl CraneliftCompiler {
AbiParam::new(I64),
],
returns: vec![AbiParam::new(I64)],
call_conv: CallConv::SystemV,
call_conv: self.isa.default_call_conv(),
};

let func_id = self
.module
.declare_function(name, Linkage::Local, &sig)
.unwrap();

let mut ctx = Context::new();
let mut ctx = self.module.make_context();
ctx.func = Function::with_name_signature(UserFuncName::testcase(name.as_bytes()), sig);
let mut func_ctx = FunctionBuilderContext::new();

Expand All @@ -158,6 +158,7 @@ impl CraneliftCompiler {

self.module.define_function(func_id, &mut ctx).unwrap();
self.module.finalize_definitions().unwrap();
self.module.clear_context(&mut ctx);

Ok(CraneliftProgram::new(self.module, func_id))
}
Expand Down Expand Up @@ -192,7 +193,7 @@ impl CraneliftCompiler {
AbiParam::new(I64),
],
returns: vec![AbiParam::new(I64)],
call_conv: CallConv::SystemV,
call_conv: self.isa.default_call_conv(),
};
let func_id = self
.module
Expand Down

0 comments on commit 185b5e0

Please sign in to comment.