// Scale a base value by a scaling factor, and return the scaled // value as an SVal. Used by 'computeOffset'. static inline SVal scaleValue(ProgramStateRef state, NonLoc baseVal, CharUnits scaling, SValBuilder &sb) { return sb.evalBinOpNN(state, BO_Mul, baseVal, sb.makeArrayIndex(scaling.getQuantity()), sb.getArrayIndexType()); }
// Lazily computes a value to be used by 'computeOffset'. If 'val' // is unknown or undefined, we lazily substitute '0'. Otherwise, // return 'val'. static inline SVal getValue(SVal val, SValBuilder &svalBuilder) { return isa<UndefinedVal>(val) ? svalBuilder.makeArrayIndex(0) : val; }