Pass Function to Builder::function_call in cg_gcc
This commit is contained in:
parent
b40eae863a
commit
c506e23426
1 changed files with 3 additions and 3 deletions
|
|
@ -316,12 +316,10 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
|
|||
|
||||
fn function_call(
|
||||
&mut self,
|
||||
func: RValue<'gcc>,
|
||||
func: Function<'gcc>,
|
||||
args: &[RValue<'gcc>],
|
||||
_funclet: Option<&Funclet>,
|
||||
) -> RValue<'gcc> {
|
||||
// TODO(antoyo): remove when the API supports a different type for functions.
|
||||
let func: Function<'gcc> = self.cx.rvalue_as_function(func);
|
||||
let args = self.check_call("call", func, args);
|
||||
|
||||
// gccjit requires to use the result of functions, even when it's not used.
|
||||
|
|
@ -1766,6 +1764,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
|
|||
// FIXME(antoyo): remove when having a proper API.
|
||||
let gcc_func = unsafe { std::mem::transmute::<RValue<'gcc>, Function<'gcc>>(func) };
|
||||
let call = if self.functions.borrow().values().any(|value| *value == gcc_func) {
|
||||
// TODO(antoyo): remove when the API supports a different type for functions.
|
||||
let func: Function<'gcc> = self.cx.rvalue_as_function(func);
|
||||
self.function_call(func, args, funclet)
|
||||
} else {
|
||||
// If it's a not function that was defined, it's a function pointer.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue