From: Ted Kremenek Date: Fri, 5 Dec 2008 01:31:31 +0000 (+0000) Subject: Remove SymbolDataContentsOf (unused). X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f3d416267ec92cf28da11a79b47383179b77c5d0;p=clang Remove SymbolDataContentsOf (unused). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@60572 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/clang/Analysis/PathSensitive/SymbolManager.h b/include/clang/Analysis/PathSensitive/SymbolManager.h index 53a6eecf44..1f548b4645 100644 --- a/include/clang/Analysis/PathSensitive/SymbolManager.h +++ b/include/clang/Analysis/PathSensitive/SymbolManager.h @@ -70,7 +70,7 @@ namespace clang { class SymbolData : public llvm::FoldingSetNode { public: enum Kind { UndefKind, ParmKind, GlobalKind, ElementKind, FieldKind, - ContentsOfKind, ConjuredKind }; + ConjuredKind }; private: Kind K; @@ -188,30 +188,6 @@ public: } }; -class SymbolDataContentsOf : public SymbolData { - SymbolID Sym; - -public: - SymbolDataContentsOf(SymbolID MySym, SymbolID sym) : - SymbolData(ContentsOfKind, MySym), Sym(sym) {} - - SymbolID getContainerSymbol() const { return Sym; } - - static void Profile(llvm::FoldingSetNodeID& profile, SymbolID Sym) { - profile.AddInteger((unsigned) ContentsOfKind); - profile.AddInteger(Sym); - } - - virtual void Profile(llvm::FoldingSetNodeID& profile) { - Profile(profile, Sym); - } - - // Implement isa support. - static inline bool classof(const SymbolData* D) { - return D->getKind() == ContentsOfKind; - } -}; - class SymbolConjured : public SymbolData { Stmt* S; QualType T; @@ -294,7 +270,6 @@ public: SymbolID getSymbol(VarDecl* D); SymbolID getElementSymbol(const MemRegion* R, const llvm::APSInt* Idx); SymbolID getFieldSymbol(const MemRegion* R, const FieldDecl* D); - SymbolID getContentsOfSymbol(SymbolID sym); SymbolID getConjuredSymbol(Stmt* E, QualType T, unsigned VisitCount); SymbolID getConjuredSymbol(Expr* E, unsigned VisitCount) { return getConjuredSymbol(E, E->getType(), VisitCount); diff --git a/lib/Analysis/SymbolManager.cpp b/lib/Analysis/SymbolManager.cpp index aee74a4a14..c49d12730b 100644 --- a/lib/Analysis/SymbolManager.cpp +++ b/lib/Analysis/SymbolManager.cpp @@ -86,28 +86,7 @@ SymbolID SymbolManager::getFieldSymbol(const MemRegion* R, const FieldDecl* D) { DataMap[SymbolCounter] = SD; return SymbolCounter++; } - -SymbolID SymbolManager::getContentsOfSymbol(SymbolID sym) { - - llvm::FoldingSetNodeID profile; - SymbolDataContentsOf::Profile(profile, sym); - void* InsertPos; - - SymbolData* SD = DataSet.FindNodeOrInsertPos(profile, InsertPos); - - if (SD) - return SD->getSymbol(); - - SD = (SymbolData*) BPAlloc.Allocate(); - new (SD) SymbolDataContentsOf(SymbolCounter, sym); - - DataSet.InsertNode(SD, InsertPos); - DataMap[SymbolCounter] = SD; - - return SymbolCounter++; -} - SymbolID SymbolManager::getConjuredSymbol(Stmt* E, QualType T, unsigned Count) { llvm::FoldingSetNodeID profile; @@ -145,13 +124,7 @@ QualType SymbolData::getType(const SymbolManager& SymMgr) const { case GlobalKind: return cast(this)->getDecl()->getType(); - - case ContentsOfKind: { - SymbolID x = cast(this)->getContainerSymbol(); - QualType T = SymMgr.getSymbolData(x).getType(SymMgr); - return T->getAsPointerType()->getPointeeType(); - } - + case ConjuredKind: return cast(this)->getType(); }