diff --git a/clang/include/clang/Analysis/PathSensitive/MemRegion.h b/clang/include/clang/Analysis/PathSensitive/MemRegion.h index 30e98bf730e8..04d904623e2b 100644 --- a/clang/include/clang/Analysis/PathSensitive/MemRegion.h +++ b/clang/include/clang/Analysis/PathSensitive/MemRegion.h @@ -194,6 +194,8 @@ public: ProfileRegion(ID, Str, superRegion); } + void print(llvm::raw_ostream& os) const; + static bool classof(const MemRegion* R) { return R->getKind() == StringRegionKind; } diff --git a/clang/lib/Analysis/MemRegion.cpp b/clang/lib/Analysis/MemRegion.cpp index 85ad3d87fa08..f6bf4497ba66 100644 --- a/clang/lib/Analysis/MemRegion.cpp +++ b/clang/lib/Analysis/MemRegion.cpp @@ -151,6 +151,10 @@ void CompoundLiteralRegion::print(llvm::raw_ostream& os) const { os << "{ " << (void*) CL << " }"; } +void StringRegion::print(llvm::raw_ostream& os) const { + os << "\"" << Str->getStrData() << "\""; +} + //===----------------------------------------------------------------------===// // MemRegionManager methods. //===----------------------------------------------------------------------===//