MCPcopy Create free account
hub / github.com/LFYSec/MScan / BitwiseExp

Class BitwiseExp

src/main/java/pascal/taie/ir/exp/BitwiseExp.java:30–78  ·  view source on GitHub ↗

Representation of bitwise expression, e.g., a | b.

Source from the content-addressed store, hash-verified

28 * Representation of bitwise expression, e.g., a | b.
29 */
30public class BitwiseExp extends AbstractBinaryExp {
31
32 public enum Op implements BinaryExp.Op {
33
34 OR("|"),
35 AND("&"),
36 XOR("^"),
37 ;
38
39 private final String symbol;
40
41 Op(String symbol) {
42 this.symbol = symbol;
43 }
44
45 @Override
46 public String toString() {
47 return symbol;
48 }
49 }
50
51 private final Op op;
52
53 public BitwiseExp(Op op, Var value1, Var value2) {
54 super(value1, value2);
55 this.op = op;
56 }
57
58 @Override
59 protected void validate() {
60 assert (Exps.holdsInt(operand1) && Exps.holdsInt((operand2)) ||
61 (Exps.holdsLong(operand1) && Exps.holdsLong(operand2)));
62 }
63
64 @Override
65 public Op getOperator() {
66 return op;
67 }
68
69 @Override
70 public PrimitiveType getType() {
71 return (PrimitiveType) operand1.getType();
72 }
73
74 @Override
75 public <T> T accept(ExpVisitor<T> visitor) {
76 return visitor.visit(this);
77 }
78}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected