Remove dummy value locals for function ptr calls

This commit is contained in:
sapir 2024-08-07 13:43:27 +03:00
parent fb95096593
commit 4fe1647d21

View File

@ -341,7 +341,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
self.block self.block
.add_eval(self.location, self.cx.context.new_call(self.location, func, &args)); .add_eval(self.location, self.cx.context.new_call(self.location, func, &args));
// Return dummy value when not having return value. // Return dummy value when not having return value.
self.context.new_rvalue_from_long(self.isize_type, 0) self.context.new_rvalue_zero(self.isize_type)
} }
} }
@ -421,17 +421,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
self.cx.context.new_call_through_ptr(self.location, func_ptr, &args), self.cx.context.new_call_through_ptr(self.location, func_ptr, &args),
); );
// Return dummy value when not having return value. // Return dummy value when not having return value.
let result = current_func.new_local( self.context.new_rvalue_zero(self.isize_type)
self.location,
self.isize_type,
"dummyValueThatShouldNeverBeUsed",
);
self.block.add_assignment(
self.location,
result,
self.context.new_rvalue_from_long(self.isize_type, 0),
);
result.to_rvalue()
} }
} }