diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-03 22:06:47 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-03 22:06:47 +0000 |
commit | 94c969804b1f98650316a8f75434b2d24dbe94ea (patch) | |
tree | 91c72e38d24a01c7fcc4d5cadc89fa604ea408d2 /lib/Analysis/SymbolManager.cpp | |
parent | 9d40ee50f8a013e5253101648092cf0daa76c335 (diff) |
Rework use of loc::SymbolVal in the retain/release checker to use the new method
SVal::getAsLocSymbol(). This simplifies the code and allows the retain/release
checker to (I believe) also correctly reason about location symbols wrapped in
SymbolicRegions.
Along the way I cleaned up SymbolRef a little, disallowing implicit casts to
'unsigned'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65972 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/SymbolManager.cpp')
-rw-r--r-- | lib/Analysis/SymbolManager.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp index f1c1cc0a46..45e1aae23b 100644 --- a/lib/Analysis/SymbolManager.cpp +++ b/lib/Analysis/SymbolManager.cpp @@ -18,8 +18,23 @@ using namespace clang; -void SymbolRef::print(llvm::raw_ostream& os) const { - os << getNumber(); +llvm::raw_ostream& llvm::operator<<(llvm::raw_ostream& os, + clang::SymbolRef sym) { + if (sym.isValid()) + os << sym.getNumber(); + else + os << "(Invalid)"; + + return os; +} + +std::ostream& std::operator<<(std::ostream& os, clang::SymbolRef sym) { + if (sym.isValid()) + os << sym.getNumber(); + else + os << "(Invalid)"; + + return os; } SymbolRef SymbolManager::getRegionRValueSymbol(const MemRegion* R) { @@ -35,7 +50,6 @@ SymbolRef SymbolManager::getRegionRValueSymbol(const MemRegion* R) { DataSet.InsertNode(SD, InsertPos); DataMap[SymbolCounter] = SD; return SymbolCounter++; - } SymbolRef SymbolManager::getConjuredSymbol(Stmt* E, QualType T, unsigned Count){ |