Merge pull request #554 from sapir/remove-void-func-debug-var

Remove dummy value locals for function ptr calls
This commit is contained in:
antoyo 2024-08-07 08:20:27 -04:00 committed by GitHub
commit 2cc32badb4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -341,7 +341,7 @@ fn function_call(
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 @@ fn function_ptr_call(
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()
} }
} }