Conjured symbols now bind to Stmt* instead of Expr*.

llvm-svn: 59154
This commit is contained in:
Ted Kremenek 2008-11-12 19:22:47 +00:00
parent 60d46414f4
commit 9999d72fe2
2 changed files with 10 additions and 11 deletions

View File

@ -166,30 +166,29 @@ public:
}; };
class SymbolConjured : public SymbolData { class SymbolConjured : public SymbolData {
Expr* E; Stmt* S;
QualType T; QualType T;
unsigned Count; unsigned Count;
public: public:
SymbolConjured(SymbolID Sym, Expr* exp, QualType t, unsigned count) SymbolConjured(SymbolID Sym, Stmt* s, QualType t, unsigned count)
: SymbolData(ConjuredKind, Sym), E(exp), T(t), Count(count) {} : SymbolData(ConjuredKind, Sym), S(s), T(t), Count(count) {}
Expr* getExpr() const { return E; }
unsigned getCount() const { return Count; }
Stmt* getStmt() const { return S; }
unsigned getCount() const { return Count; }
QualType getType() const { return T; } QualType getType() const { return T; }
static void Profile(llvm::FoldingSetNodeID& profile, static void Profile(llvm::FoldingSetNodeID& profile,
Expr* E, QualType T, unsigned Count) { Stmt* S, QualType T, unsigned Count) {
profile.AddInteger((unsigned) ConjuredKind); profile.AddInteger((unsigned) ConjuredKind);
profile.AddPointer(E); profile.AddPointer(S);
profile.Add(T); profile.Add(T);
profile.AddInteger(Count); profile.AddInteger(Count);
} }
virtual void Profile(llvm::FoldingSetNodeID& profile) { virtual void Profile(llvm::FoldingSetNodeID& profile) {
Profile(profile, E, T, Count); Profile(profile, S, T, Count);
} }
// Implement isa<T> support. // Implement isa<T> support.
@ -247,7 +246,7 @@ public:
SymbolID getSymbol(VarDecl* D); SymbolID getSymbol(VarDecl* D);
SymbolID getContentsOfSymbol(SymbolID sym); SymbolID getContentsOfSymbol(SymbolID sym);
SymbolID getConjuredSymbol(Expr* E, QualType T, unsigned VisitCount); SymbolID getConjuredSymbol(Stmt* E, QualType T, unsigned VisitCount);
SymbolID getConjuredSymbol(Expr* E, unsigned VisitCount) { SymbolID getConjuredSymbol(Expr* E, unsigned VisitCount) {
return getConjuredSymbol(E, E->getType(), VisitCount); return getConjuredSymbol(E, E->getType(), VisitCount);
} }

View File

@ -73,7 +73,7 @@ SymbolID SymbolManager::getContentsOfSymbol(SymbolID sym) {
return SymbolCounter++; return SymbolCounter++;
} }
SymbolID SymbolManager::getConjuredSymbol(Expr* E, QualType T, unsigned Count) { SymbolID SymbolManager::getConjuredSymbol(Stmt* E, QualType T, unsigned Count) {
llvm::FoldingSetNodeID profile; llvm::FoldingSetNodeID profile;
SymbolConjured::Profile(profile, E, T, Count); SymbolConjured::Profile(profile, E, T, Count);