diff options
Diffstat (limited to 'include/clang/Analysis/PathSensitive/SymbolManager.h')
-rw-r--r-- | include/clang/Analysis/PathSensitive/SymbolManager.h | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/include/clang/Analysis/PathSensitive/SymbolManager.h b/include/clang/Analysis/PathSensitive/SymbolManager.h index d424526..d074e30 100644 --- a/include/clang/Analysis/PathSensitive/SymbolManager.h +++ b/include/clang/Analysis/PathSensitive/SymbolManager.h @@ -83,19 +83,25 @@ typedef const SymbolData* SymbolRef; class SymbolRegionValue : public SymbolData { const MemRegion *R; + // We may cast the region to another type, so the expected type of the symbol + // may be different from the region's original type. + QualType T; + public: - SymbolRegionValue(SymbolID sym, const MemRegion *r) - : SymbolData(RegionValueKind, sym), R(r) {} + SymbolRegionValue(SymbolID sym, const MemRegion *r, QualType t = QualType()) + : SymbolData(RegionValueKind, sym), R(r), T(t) {} const MemRegion* getRegion() const { return R; } - static void Profile(llvm::FoldingSetNodeID& profile, const MemRegion* R) { + static void Profile(llvm::FoldingSetNodeID& profile, const MemRegion* R, + QualType T) { profile.AddInteger((unsigned) RegionValueKind); profile.AddPointer(R); + T.Profile(profile); } virtual void Profile(llvm::FoldingSetNodeID& profile) { - Profile(profile, R); + Profile(profile, R, T); } QualType getType(ASTContext&) const; @@ -240,7 +246,8 @@ public: static bool canSymbolicate(QualType T); /// Make a unique symbol for MemRegion R according to its kind. - const SymbolRegionValue* getRegionValueSymbol(const MemRegion* R); + const SymbolRegionValue* getRegionValueSymbol(const MemRegion* R, + QualType T = QualType()); const SymbolConjured* getConjuredSymbol(const Stmt* E, QualType T, unsigned VisitCount, const void* SymbolTag = 0); |