aboutsummaryrefslogtreecommitdiff
path: root/lib/Checker/GRExprEngine.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-10-20 23:48:34 +0000
committerTed Kremenek <kremenek@apple.com>2010-10-20 23:48:34 +0000
commitf093350f76320909a015c82de60a500fdcaf5b8f (patch)
tree5236e49f9db23d415f3ff607e6a161f8ce469438 /lib/Checker/GRExprEngine.cpp
parent2ce2baa81f1bdd5f1a2504bbf812d30f10e45bb5 (diff)
Remove obsolete GRAuditor and GRSimpleAPICheck, which have been completely subsumed by the Checker interface.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Checker/GRExprEngine.cpp')
-rw-r--r--lib/Checker/GRExprEngine.cpp85
1 files changed, 0 insertions, 85 deletions
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp
index babea205be..d542c2c293 100644
--- a/lib/Checker/GRExprEngine.cpp
+++ b/lib/Checker/GRExprEngine.cpp
@@ -99,73 +99,6 @@ static bool CalleeReturnsReferenceOrRecord(const CallExpr *CE) {
#endif
//===----------------------------------------------------------------------===//
-// Batch auditor. DEPRECATED.
-//===----------------------------------------------------------------------===//
-
-namespace {
-
-class MappedBatchAuditor : public GRSimpleAPICheck {
- typedef llvm::ImmutableList<GRSimpleAPICheck*> Checks;
- typedef llvm::DenseMap<void*,Checks> MapTy;
-
- MapTy M;
- Checks::Factory F;
- Checks AllStmts;
-
-public:
- MappedBatchAuditor(llvm::BumpPtrAllocator& Alloc) :
- F(Alloc), AllStmts(F.GetEmptyList()) {}
-
- virtual ~MappedBatchAuditor() {
- llvm::DenseSet<GRSimpleAPICheck*> AlreadyVisited;
-
- for (MapTy::iterator MI = M.begin(), ME = M.end(); MI != ME; ++MI)
- for (Checks::iterator I=MI->second.begin(), E=MI->second.end(); I!=E;++I){
-
- GRSimpleAPICheck* check = *I;
-
- if (AlreadyVisited.count(check))
- continue;
-
- AlreadyVisited.insert(check);
- delete check;
- }
- }
-
- void AddCheck(GRSimpleAPICheck *A, Stmt::StmtClass C) {
- assert (A && "Check cannot be null.");
- void* key = reinterpret_cast<void*>((uintptr_t) C);
- MapTy::iterator I = M.find(key);
- M[key] = F.Concat(A, I == M.end() ? F.GetEmptyList() : I->second);
- }
-
- void AddCheck(GRSimpleAPICheck *A) {
- assert (A && "Check cannot be null.");
- AllStmts = F.Concat(A, AllStmts);
- }
-
- virtual bool Audit(ExplodedNode* N, GRStateManager& VMgr) {
- // First handle the auditors that accept all statements.
- bool isSink = false;
- for (Checks::iterator I = AllStmts.begin(), E = AllStmts.end(); I!=E; ++I)
- isSink |= (*I)->Audit(N, VMgr);
-
- // Next handle the auditors that accept only specific statements.
- const Stmt* S = cast<PostStmt>(N->getLocation()).getStmt();
- void* key = reinterpret_cast<void*>((uintptr_t) S->getStmtClass());
- MapTy::iterator MI = M.find(key);
- if (MI != M.end()) {
- for (Checks::iterator I=MI->second.begin(), E=MI->second.end(); I!=E; ++I)
- isSink |= (*I)->Audit(N, VMgr);
- }
-
- return isSink;
- }
-};
-
-} // end anonymous namespace
-
-//===----------------------------------------------------------------------===//
// Checker worklist routines.
//===----------------------------------------------------------------------===//
@@ -423,20 +356,6 @@ GRExprEngine::~GRExprEngine() {
// Utility methods.
//===----------------------------------------------------------------------===//
-void GRExprEngine::AddCheck(GRSimpleAPICheck* A, Stmt::StmtClass C) {
- if (!BatchAuditor)
- BatchAuditor.reset(new MappedBatchAuditor(getGraph().getAllocator()));
-
- ((MappedBatchAuditor*) BatchAuditor.get())->AddCheck(A, C);
-}
-
-void GRExprEngine::AddCheck(GRSimpleAPICheck *A) {
- if (!BatchAuditor)
- BatchAuditor.reset(new MappedBatchAuditor(getGraph().getAllocator()));
-
- ((MappedBatchAuditor*) BatchAuditor.get())->AddCheck(A);
-}
-
const GRState* GRExprEngine::getInitialState(const LocationContext *InitLoc) {
const GRState *state = StateMgr.getInitialState(InitLoc);
@@ -642,10 +561,6 @@ void GRExprEngine::ProcessStmt(const CFGElement CE,GRStmtNodeBuilder& builder) {
Builder = &builder;
EntryNode = builder.getBasePredecessor();
- // Set up our simple checks.
- if (BatchAuditor)
- Builder->setAuditor(BatchAuditor.get());
-
// Create the cleaned state.
const LocationContext *LC = EntryNode->getLocationContext();
SymbolReaper SymReaper(LC, CurrentStmt, SymMgr);