const MemRegion* superRegion);
public:
+
+ const StringLiteral* getStringLiteral() const { return Str; }
+
QualType getType(ASTContext& C) const {
return C.getCanonicalType(Str->getType());
}
void print(llvm::raw_ostream& Out) const;
// Utility methods to create NonLocs.
+
+ static NonLoc MakeVal(BasicValueFactory& BasicVals, unsigned X,
+ bool isUnsigned);
+
static NonLoc MakeVal(BasicValueFactory& BasicVals, uint64_t X, QualType T);
static NonLoc MakeVal(BasicValueFactory& BasicVals, IntegerLiteral* I);
}
if (const StringRegion* SR = dyn_cast<StringRegion>(R)) {
- // FIXME: Unsupported yet.
- SR = 0;
- return UnknownVal();
+ const StringLiteral* Str = SR->getStringLiteral();
+ return NonLoc::MakeVal(getBasicVals(), Str->getByteLength(), false);
}
if (const AnonTypedRegion* ATR = dyn_cast<AnonTypedRegion>(R)) {
//===----------------------------------------------------------------------===//
// Utility methods for constructing Non-Locs.
//===----------------------------------------------------------------------===//
+NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, unsigned X,
+ bool isUnsigned) {
+ return nonloc::ConcreteInt(BasicVals.getValue(X, sizeof(unsigned)*8,
+ isUnsigned));
+}
NonLoc NonLoc::MakeVal(BasicValueFactory& BasicVals, uint64_t X, QualType T) {
return nonloc::ConcreteInt(BasicVals.getValue(X, T));