Skip to content

Commit f2bfe54

Browse files
committed
Add the optimization in a few other methods
1 parent 95f81a2 commit f2bfe54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/builder.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -843,15 +843,16 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
843843
}
844844

845845
fn and(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
846-
self.gcc_and(a, b)
846+
self.assign_to_var(self.gcc_and(a, b))
847847
}
848848

849849
fn or(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
850-
self.cx.gcc_or(a, b, self.location)
850+
self.assign_to_var(self.cx.gcc_or(a, b, self.location))
851851
}
852852

853853
fn xor(&mut self, a: RValue<'gcc>, b: RValue<'gcc>) -> RValue<'gcc> {
854-
set_rvalue_location(self, self.gcc_xor(a, b))
854+
let result = set_rvalue_location(self, self.gcc_xor(a, b));
855+
self.assign_to_var(result)
855856
}
856857

857858
fn neg(&mut self, a: RValue<'gcc>) -> RValue<'gcc> {

0 commit comments

Comments
 (0)