@Override public LongConstant getConstant() { return LongConstant.v(value); }
public LongConstant toLongConstant() { return LongConstant.v(value); }
public NumericConstant negate() { return LongConstant.v(-(this.value)); }
public ArithmeticConstant shiftLeft(ArithmeticConstant c) { // NOTE CAREFULLY: the RHS of a shift op is not (!) // of Long type. It is, in fact, an IntConstant. if (!(c instanceof IntConstant)) { throw new IllegalArgumentException("IntConstant expected"); } return LongConstant.v(this.value << ((IntConstant) c).value); }
public NumericConstant subtract(NumericConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value - ((LongConstant) c).value); }
public NumericConstant remainder(NumericConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value % ((LongConstant) c).value); }
public ArithmeticConstant and(ArithmeticConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value & ((LongConstant) c).value); }
public ArithmeticConstant or(ArithmeticConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value | ((LongConstant) c).value); }
public ArithmeticConstant xor(ArithmeticConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value ^ ((LongConstant) c).value); }
public NumericConstant divide(NumericConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value / ((LongConstant) c).value); }
public ArithmeticConstant shiftRight(ArithmeticConstant c) { if (!(c instanceof IntConstant)) { throw new IllegalArgumentException("IntConstant expected"); } return LongConstant.v(this.value >> ((IntConstant) c).value); }
public ArithmeticConstant unsignedShiftRight(ArithmeticConstant c) { if (!(c instanceof IntConstant)) { throw new IllegalArgumentException("IntConstant expected"); } return LongConstant.v(this.value >>> ((IntConstant) c).value); }
public NumericConstant add(NumericConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value + ((LongConstant) c).value); }
public NumericConstant multiply(NumericConstant c) { if (!(c instanceof LongConstant)) { throw new IllegalArgumentException("LongConstant expected"); } return LongConstant.v(this.value * ((LongConstant) c).value); }
public Value createJimpleConstantValue(cp_info[] constant_pool) { return LongConstant.v(convert()); } }
public void outAConstantCaseLabel(AConstantCaseLabel node) { String s = (String) mProductions.removeLast(); int sign = 1; if (node.getMinus() != null) { sign = -1; } if (s.endsWith("L")) { mProductions.addLast(LongConstant.v(sign * Long.parseLong(s.substring(0, s.length() - 1)))); } else if (s.equals("2147483648")) { mProductions.addLast(IntConstant.v(sign * Integer.MIN_VALUE)); } else { mProductions.addLast(IntConstant.v(sign * Integer.parseInt(s))); } }
/** * @ast method * @aspect Expressions * @declaredat /Users/eric/Documents/workspaces/clara-soot/JastAddExtensions/JimpleBackend/Expressions.jrag:23 */ public soot.Value eval(Body b) { return soot.jimple.LongConstant.v(constant().longValue()); } /**
/** * returns bitwise negation of a long * * @param source * @return */ private Value getNotLongExpr(Local source) { return Jimple.v().newXorExpr(source, LongConstant.v(-1l)); }
/** * Returns a needed constant given a type and val */ @Override protected soot.jimple.Constant getConstant(soot.Type type, int val) { if (type instanceof soot.DoubleType) { return soot.jimple.DoubleConstant.v(val); } else if (type instanceof soot.FloatType) { return soot.jimple.FloatConstant.v(val); } else if (type instanceof soot.LongType) { return soot.jimple.LongConstant.v(val); } else { return soot.jimple.IntConstant.v(val); } }
public static PushInst getPushInitializer(Local l, Type t) { if (t instanceof IntegerType) { return Baf.v().newPushInst(IntConstant.v(soot.jbco.util.Rand.getInt())); } else if (t instanceof RefLikeType || t instanceof StmtAddressType) { return Baf.v().newPushInst(NullConstant.v()); } else if (t instanceof LongType) { return Baf.v().newPushInst(LongConstant.v(soot.jbco.util.Rand.getLong())); } else if (t instanceof FloatType) { return Baf.v().newPushInst(FloatConstant.v(soot.jbco.util.Rand.getFloat())); } else if (t instanceof DoubleType) { return Baf.v().newPushInst(DoubleConstant.v(soot.jbco.util.Rand.getDouble())); } return null; }