Skip to content

Commit

Permalink
Merge pull request #554 from sapir/remove-void-func-debug-var
Browse files Browse the repository at this point in the history
Remove dummy value locals for function ptr calls
  • Loading branch information
antoyo authored Aug 7, 2024
2 parents fb95096 + 4fe1647 commit 2cc32ba
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
self.block
.add_eval(self.location, self.cx.context.new_call(self.location, func, &args));
// 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)
}
}

Expand Down Expand Up @@ -421,17 +421,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
self.cx.context.new_call_through_ptr(self.location, func_ptr, &args),
);
// Return dummy value when not having return value.
let result = current_func.new_local(
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()
self.context.new_rvalue_zero(self.isize_type)
}
}

Expand Down

0 comments on commit 2cc32ba

Please sign in to comment.