[cfe-commits] r53043 - in /cfe/trunk: Driver/AnalysisConsumer.cpp include/clang/Analysis/LocalCheckers.h lib/Analysis/DeadStores.cpp
Ted Kremenek
kremenek at apple.com
Wed Jul 2 11:39:20 PDT 2008
Author: kremenek
Date: Wed Jul 2 13:39:20 2008
New Revision: 53043
URL: http://llvm.org/viewvc/llvm-project?rev=53043&view=rev
Log:
Added version of CheckDeadStores that accepts a client-provided LiveVariables object.
Modified the DeadStores logic in AnalysisConsumer.cpp to use the LiveVariables object created by the AnalysisManager.
Modified:
cfe/trunk/Driver/AnalysisConsumer.cpp
cfe/trunk/include/clang/Analysis/LocalCheckers.h
cfe/trunk/lib/Analysis/DeadStores.cpp
Modified: cfe/trunk/Driver/AnalysisConsumer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/AnalysisConsumer.cpp?rev=53043&r1=53042&r2=53043&view=diff
==============================================================================
--- cfe/trunk/Driver/AnalysisConsumer.cpp (original)
+++ cfe/trunk/Driver/AnalysisConsumer.cpp Wed Jul 2 13:39:20 2008
@@ -264,7 +264,8 @@
//===----------------------------------------------------------------------===//
static void ActionDeadStores(AnalysisManager& mgr) {
- CheckDeadStores(*mgr.getCFG(), mgr.getContext(), *mgr.getParentMap(),
+ CheckDeadStores(*mgr.getCFG(), mgr.getContext(),
+ *mgr.getLiveVariables(), *mgr.getParentMap(),
mgr.getDiagnostic());
}
Modified: cfe/trunk/include/clang/Analysis/LocalCheckers.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Analysis/LocalCheckers.h?rev=53043&r1=53042&r2=53043&view=diff
==============================================================================
--- cfe/trunk/include/clang/Analysis/LocalCheckers.h (original)
+++ cfe/trunk/include/clang/Analysis/LocalCheckers.h Wed Jul 2 13:39:20 2008
@@ -26,10 +26,14 @@
class BugType;
class LangOptions;
class ParentMap;
+class LiveVariables;
void CheckDeadStores(CFG& cfg, ASTContext &Ctx, ParentMap& Parents,
Diagnostic &Diags);
+ void CheckDeadStores(CFG& cfg, ASTContext &Ctx, LiveVariables& L,
+ ParentMap& Parents, Diagnostic &Diags);
+
void CheckUninitializedValues(CFG& cfg, ASTContext& Ctx, Diagnostic& Diags,
bool FullUninitTaint=false);
Modified: cfe/trunk/lib/Analysis/DeadStores.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/DeadStores.cpp?rev=53043&r1=53042&r2=53043&view=diff
==============================================================================
--- cfe/trunk/lib/Analysis/DeadStores.cpp (original)
+++ cfe/trunk/lib/Analysis/DeadStores.cpp Wed Jul 2 13:39:20 2008
@@ -151,6 +151,12 @@
ParentMap& Parents, Diagnostic &Diags) {
LiveVariables L(cfg);
L.runOnCFG(cfg);
+ CheckDeadStores(cfg, Ctx, L, Parents, Diags);
+}
+
+void clang::CheckDeadStores(CFG& cfg, ASTContext &Ctx, LiveVariables& L,
+ ParentMap& Parents, Diagnostic &Diags) {
+
DeadStoreObs A(Ctx, Diags, Diags.getClient(), Parents);
L.runOnAllBlocks(cfg, &A);
}
More information about the cfe-commits
mailing list