Enum flowistry_pdg::rustc::mir::BinOp
source · pub enum BinOp {
Show 22 variants
Add,
AddUnchecked,
Sub,
SubUnchecked,
Mul,
MulUnchecked,
Div,
Rem,
BitXor,
BitAnd,
BitOr,
Shl,
ShlUnchecked,
Shr,
ShrUnchecked,
Eq,
Lt,
Le,
Ne,
Ge,
Gt,
Offset,
}
Variants§
Add
The +
operator (addition)
AddUnchecked
Like Add
, but with UB on overflow. (Integers only.)
Sub
The -
operator (subtraction)
SubUnchecked
Like Sub
, but with UB on overflow. (Integers only.)
Mul
The *
operator (multiplication)
MulUnchecked
Like Mul
, but with UB on overflow. (Integers only.)
Div
The /
operator (division)
For integer types, division by zero is UB, as is MIN / -1
for signed.
The compiler should have inserted checks prior to this.
Floating-point division by zero is safe, and does not need guards.
Rem
The %
operator (modulus)
For integer types, using zero as the modulus (second operand) is UB,
as is MIN % -1
for signed.
The compiler should have inserted checks prior to this.
Floating-point remainder by zero is safe, and does not need guards.
BitXor
The ^
operator (bitwise xor)
BitAnd
The &
operator (bitwise and)
BitOr
The |
operator (bitwise or)
Shl
The <<
operator (shift left)
The offset is truncated to the size of the first operand before shifting.
ShlUnchecked
Like Shl
, but is UB if the RHS >= LHS::BITS
Shr
The >>
operator (shift right)
The offset is truncated to the size of the first operand before shifting.
This is an arithmetic shift if the LHS is signed and a logical shift if the LHS is unsigned.
ShrUnchecked
Like Shl
, but is UB if the RHS >= LHS::BITS
Eq
The ==
operator (equality)
Lt
The <
operator (less than)
Le
The <=
operator (less than or equal to)
Ne
The !=
operator (not equal to)
Ge
The >=
operator (greater than or equal to)
Gt
The >
operator (greater than)
Offset
The ptr.offset
operator