Skip to content

Commit

Permalink
Fix negation operation (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Oct 31, 2021
1 parent 08183f9 commit ebe6f67
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/builder.rs
Expand Up @@ -623,8 +623,7 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
}

fn neg(&mut self, a: RValue<'gcc>) -> RValue<'gcc> {
// TODO(antoyo): use new_unary_op()?
self.cx.context.new_rvalue_from_long(a.get_type(), 0) - a
self.cx.context.new_unary_op(None, UnaryOp::Minus, a.get_type(), a)
}

fn fneg(&mut self, a: RValue<'gcc>) -> RValue<'gcc> {
Expand Down

0 comments on commit ebe6f67

Please sign in to comment.