aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/GRSimpleVals.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-04-10 22:16:52 +0000
committerTed Kremenek <kremenek@apple.com>2008-04-10 22:16:52 +0000
commitd71ed26dd80cdfebb5bb49000cce538e6c9a90e3 (patch)
treed0461c3b4ee87901490f935c38f35ce8c8e991cd /lib/Analysis/GRSimpleVals.cpp
parentebe457c3443af253bc14ae77c2013b088370a66b (diff)
Refactored all logic to run the GRSimpleVals and CFRef checker into a common
code path in the clang driver. Renamed options --grsimple to -checker-simple and -check-cfref to -checker-cfref. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49500 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/GRSimpleVals.cpp')
-rw-r--r--lib/Analysis/GRSimpleVals.cpp31
1 files changed, 3 insertions, 28 deletions
diff --git a/lib/Analysis/GRSimpleVals.cpp b/lib/Analysis/GRSimpleVals.cpp
index 960476dff0..c350ab9752 100644
--- a/lib/Analysis/GRSimpleVals.cpp
+++ b/lib/Analysis/GRSimpleVals.cpp
@@ -19,6 +19,7 @@
#include "clang/Analysis/PathDiagnostic.h"
#include "clang/Analysis/PathSensitive/ValueState.h"
#include "clang/Analysis/PathSensitive/BugReporter.h"
+#include "clang/Analysis/LocalCheckers.h"
#include "llvm/Support/Compiler.h"
#include <sstream>
@@ -310,36 +311,10 @@ void GRSimpleVals::RegisterChecks(GRExprEngine& Eng) {
}
//===----------------------------------------------------------------------===//
-// Analysis Driver.
+// Transfer Function creation for External clients.
//===----------------------------------------------------------------------===//
-namespace clang {
-
-unsigned RunGRSimpleVals(CFG& cfg, Decl& CD, ASTContext& Ctx,
- Diagnostic& Diag, PathDiagnosticClient* PD,
- bool Visualize, bool TrimGraph) {
-
- // Construct the analysis engine.
- GRExprEngine Eng(cfg, CD, Ctx);
-
- // Set base transfer functions.
- GRSimpleVals GRSV;
- Eng.setTransferFunctions(GRSV);
-
- // Execute the worklist algorithm.
- Eng.ExecuteWorkList();
-
- // Display warnings.
- Eng.EmitWarnings(Diag, PD);
-
-#ifndef NDEBUG
- if (Visualize) Eng.ViewGraph(TrimGraph);
-#endif
-
- return Eng.getGraph().size();
-}
-
-} // end clang namespace
+GRTransferFuncs* clang::MakeGRSimpleValsTF() { return new GRSimpleVals(); }
//===----------------------------------------------------------------------===//
// Transfer function for Casts.