Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit dd5ffc2

Browse files
committed
Split out lib_call_unadjusted function
1 parent 5464809 commit dd5ffc2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/abi/mod.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,23 @@ impl<'tcx> FunctionCx<'_, '_, 'tcx> {
149149
size: 16,
150150
}));
151151
args.insert(0, ret_ptr.get_addr(self));
152-
self.lib_call(name, params, vec![], &args);
152+
self.lib_call_unadjusted(name, params, vec![], &args);
153153
return Cow::Owned(vec![ret_ptr.load(self, types::I128, MemFlags::trusted())]);
154154
} else {
155-
return self.lib_call(name, params, returns, &args);
155+
return self.lib_call_unadjusted(name, params, returns, &args);
156156
}
157157
}
158158

159+
self.lib_call_unadjusted(name, params, returns, args)
160+
}
161+
162+
pub(crate) fn lib_call_unadjusted(
163+
&mut self,
164+
name: &str,
165+
params: Vec<AbiParam>,
166+
returns: Vec<AbiParam>,
167+
args: &[Value],
168+
) -> Cow<'_, [Value]> {
159169
let sig = Signature { params, returns, call_conv: self.target_config.default_call_conv };
160170
let func_id = self.module.declare_function(name, Linkage::Import, &sig).unwrap();
161171
let func_ref = self.module.declare_func_in_func(func_id, &mut self.bcx.func);

0 commit comments

Comments
 (0)