diff options
| author | antoyo <antoyo@users.noreply.github.com> | 2024-08-07 08:20:27 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-07 08:20:27 -0400 |
| commit | 2cc32badb49f619a399a23bf5fc824acc390b7e7 (patch) | |
| tree | 45e71012fdf328c80db9dc0c36ef82bc17c1a904 | |
| parent | fb95096593e5cf93e1a24a3770a8bedd17284490 (diff) | |
| parent | 4fe1647d21e8533d718ae7026391443a76ce3351 (diff) | |
| download | rust-2cc32badb49f619a399a23bf5fc824acc390b7e7.tar.gz rust-2cc32badb49f619a399a23bf5fc824acc390b7e7.zip | |
Merge pull request #554 from sapir/remove-void-func-debug-var
Remove dummy value locals for function ptr calls
| -rw-r--r-- | src/builder.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/builder.rs b/src/builder.rs index e7f1e7e6b90..38e147599c9 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -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) } } @@ -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) } } |
