[cfe-commits] r47339 - in /cfe/trunk: Analysis/SymbolManager.cpp include/clang/Analysis/PathSensitive/SymbolManager.h
Ted Kremenek
kremenek at apple.com
Tue Feb 19 12:51:40 PST 2008
Author: kremenek
Date: Tue Feb 19 14:51:40 2008
New Revision: 47339
URL: http://llvm.org/viewvc/llvm-project?rev=47339&view=rev
Log:
Implemented "getType()" for symbolic values representing the "contents" of
another symbolic value.
Modified:
cfe/trunk/Analysis/SymbolManager.cpp
cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h
Modified: cfe/trunk/Analysis/SymbolManager.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Analysis/SymbolManager.cpp?rev=47339&r1=47338&r2=47339&view=diff
==============================================================================
--- cfe/trunk/Analysis/SymbolManager.cpp (original)
+++ cfe/trunk/Analysis/SymbolManager.cpp Tue Feb 19 14:51:40 2008
@@ -38,7 +38,7 @@
return X;
}
-QualType SymbolData::getType() const {
+QualType SymbolData::getType(const SymbolManager& SymMgr) const {
switch (getKind()) {
default:
assert (false && "getType() not implemented for this symbol.");
@@ -46,6 +46,11 @@
case ParmKind:
return cast<SymbolDataParmVar>(this)->getDecl()->getType();
+ case ContentsOfKind: {
+ SymbolID x = cast<SymbolDataContentsOf>(this)->getSymbol();
+ QualType T = SymMgr.getSymbolData(x).getType(SymMgr);
+ return T->getAsPointerType()->getPointeeType();
+ }
}
}
Modified: cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h?rev=47339&r1=47338&r2=47339&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h (original)
+++ cfe/trunk/include/clang/Analysis/PathSensitive/SymbolManager.h Tue Feb 19 14:51:40 2008
@@ -24,6 +24,8 @@
namespace clang {
+class SymbolManager;
+
class SymbolID {
unsigned Data;
public:
@@ -76,7 +78,7 @@
return K == R.K && Data == R.Data;
}
- QualType getType() const;
+ QualType getType(const SymbolManager& SymMgr) const;
// Implement isa<T> support.
static inline bool classof(const SymbolData*) { return true; }
@@ -164,7 +166,7 @@
}
inline QualType getType(SymbolID ID) const {
- return getSymbolData(ID).getType();
+ return getSymbolData(ID).getType(*this);
}
};
More information about the cfe-commits
mailing list