about summary refs log tree commit diff
diff options
context:
space:
mode:
authorantoyo <antoyo@users.noreply.github.com>2024-08-07 08:20:27 -0400
committerGitHub <noreply@github.com>2024-08-07 08:20:27 -0400
commit2cc32badb49f619a399a23bf5fc824acc390b7e7 (patch)
tree45e71012fdf328c80db9dc0c36ef82bc17c1a904
parentfb95096593e5cf93e1a24a3770a8bedd17284490 (diff)
parent4fe1647d21e8533d718ae7026391443a76ce3351 (diff)
downloadrust-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.rs14
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)
         }
     }