Skip to content

Commit 2cc32ba

Browse files
authored
Merge pull request #554 from sapir/remove-void-func-debug-var
Remove dummy value locals for function ptr calls
2 parents fb95096 + 4fe1647 commit 2cc32ba

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

src/builder.rs

+2-12
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
341341
self.block
342342
.add_eval(self.location, self.cx.context.new_call(self.location, func, &args));
343343
// Return dummy value when not having return value.
344-
self.context.new_rvalue_from_long(self.isize_type, 0)
344+
self.context.new_rvalue_zero(self.isize_type)
345345
}
346346
}
347347

@@ -421,17 +421,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
421421
self.cx.context.new_call_through_ptr(self.location, func_ptr, &args),
422422
);
423423
// Return dummy value when not having return value.
424-
let result = current_func.new_local(
425-
self.location,
426-
self.isize_type,
427-
"dummyValueThatShouldNeverBeUsed",
428-
);
429-
self.block.add_assignment(
430-
self.location,
431-
result,
432-
self.context.new_rvalue_from_long(self.isize_type, 0),
433-
);
434-
result.to_rvalue()
424+
self.context.new_rvalue_zero(self.isize_type)
435425
}
436426
}
437427

0 commit comments

Comments
 (0)