aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-03 23:30:34 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-03 23:30:34 +0000
commit1fb7d0c8323d53d10ae4f61e8bce02029f143ff7 (patch)
tree49307c5953c299666eff01e0d3999c0417cc57a6
parentdf317bf71653eeb235da8337b1e8e790f9653aa4 (diff)
Change GRTransferFuncs::RegisterChecks() to take a GRExprEngine& instead of a BugReporter&. This paves the way for pulling some of the retain/release checker into a "Checker" class.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@85971 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Analysis/PathSensitive/GRTransferFuncs.h5
-rw-r--r--lib/Analysis/CFRefCount.cpp6
-rw-r--r--lib/Analysis/GRExprEngine.cpp2
3 files changed, 7 insertions, 6 deletions
diff --git a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
index 5f7b2cb0e3..40c1ed3224 100644
--- a/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
+++ b/include/clang/Analysis/PathSensitive/GRTransferFuncs.h
@@ -23,7 +23,6 @@
namespace clang {
class GRExprEngine;
-class BugReporter;
class ObjCMessageExpr;
class GRStmtNodeBuilderRef;
@@ -33,7 +32,7 @@ public:
virtual ~GRTransferFuncs() {}
virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {}
- virtual void RegisterChecks(BugReporter& BR) {}
+ virtual void RegisterChecks(GRExprEngine& Eng) {}
// Calls.
@@ -78,7 +77,7 @@ public:
virtual const GRState* EvalAssume(const GRState *state,
SVal Cond, bool Assumption) {
return state;
- }
+ }
};
GRTransferFuncs *CreateCallInliner(ASTContext &ctx);
diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp
index 574a618470..03614e8339 100644
--- a/lib/Analysis/CFRefCount.cpp
+++ b/lib/Analysis/CFRefCount.cpp
@@ -1899,7 +1899,7 @@ public:
virtual ~CFRefCount() {}
- void RegisterChecks(BugReporter &BR);
+ void RegisterChecks(GRExprEngine &Eng);
virtual void RegisterPrinters(std::vector<GRState::Printer*>& Printers) {
Printers.push_back(new BindingsPrinter());
@@ -2193,7 +2193,9 @@ namespace {
};
} // end anonymous namespace
-void CFRefCount::RegisterChecks(BugReporter& BR) {
+void CFRefCount::RegisterChecks(GRExprEngine& Eng) {
+ BugReporter &BR = Eng.getBugReporter();
+
useAfterRelease = new UseAfterRelease(this);
BR.Register(useAfterRelease);
diff --git a/lib/Analysis/GRExprEngine.cpp b/lib/Analysis/GRExprEngine.cpp
index eb8c39c306..4c538c8dc8 100644
--- a/lib/Analysis/GRExprEngine.cpp
+++ b/lib/Analysis/GRExprEngine.cpp
@@ -178,7 +178,7 @@ GRExprEngine::~GRExprEngine() {
void GRExprEngine::setTransferFunctions(GRTransferFuncs* tf) {
StateMgr.TF = tf;
- tf->RegisterChecks(getBugReporter());
+ tf->RegisterChecks(*this);
tf->RegisterPrinters(getStateManager().Printers);
}