public EvalFixed(IType type, ValueCategory cat, IValue value) { if (type instanceof CPPBasicType) { Long num = value.numericalValue(); if (num != null) { CPPBasicType t = (CPPBasicType) type.clone(); t.setAssociatedNumericalValue(num); type = t; } } fType = type; fValueCategory = cat; fValue = value; }
@Override public IValue getValue(IASTNode point) { if (isValueDependent()) return Value.create(this); if (getOverload(point) != null) { // TODO(sprigogin): Simulate execution of a function call. return Value.create(this); } switch (fOperator) { case op_sizeof: { SizeAndAlignment info = SizeofCalculator.getSizeAndAlignment(fArgument.getTypeOrFunctionSet(point), point); return info == null ? Value.UNKNOWN : Value.create(info.size); } case op_alignOf: { SizeAndAlignment info = SizeofCalculator.getSizeAndAlignment(fArgument.getTypeOrFunctionSet(point), point); return info == null ? Value.UNKNOWN : Value.create(info.alignment); } case op_noexcept: return Value.UNKNOWN; // TODO(sprigogin): Implement case op_sizeofParameterPack: return Value.UNKNOWN; // TODO(sprigogin): Implement case op_typeid: return Value.UNKNOWN; // TODO(sprigogin): Implement case op_throw: return Value.UNKNOWN; // TODO(sprigogin): Implement } IValue val = fArgument.getValue(point); if (val == null) return Value.UNKNOWN; Long num = val.numericalValue(); if (num != null) { return Value.evaluateUnaryExpression(fOperator, num); } return Value.create(this); }