Skip to content

Commit 07ecfba

Browse files
committed
Fix fneg
1 parent 735940d commit 07ecfba

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -720,8 +720,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
720720
}
721721

722722
fn fneg(&mut self, a: RValue<'gcc>) -> RValue<'gcc> {
723-
// TODO: use new_unary_op()?
724-
self.cx.context.new_rvalue_from_long(a.get_type(), 0) - a
723+
self.cx.context.new_unary_op(None, UnaryOp::Minus, a.get_type(), a)
725724
}
726725

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

0 commit comments

Comments
 (0)