aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Driver/AnalysisConsumer.cpp3
-rw-r--r--include/clang/Analysis/LocalCheckers.h4
-rw-r--r--lib/Analysis/DeadStores.cpp6
3 files changed, 12 insertions, 1 deletions
diff --git a/Driver/AnalysisConsumer.cpp b/Driver/AnalysisConsumer.cpp
index f8d9a250ba..1e33ae168a 100644
--- a/Driver/AnalysisConsumer.cpp
+++ b/Driver/AnalysisConsumer.cpp
@@ -264,7 +264,8 @@ void AnalysisConsumer::HandleCode(Decl* D, Stmt* Body, Actions actions) {
//===----------------------------------------------------------------------===//
static void ActionDeadStores(AnalysisManager& mgr) {
- CheckDeadStores(*mgr.getCFG(), mgr.getContext(), *mgr.getParentMap(),
+ CheckDeadStores(*mgr.getCFG(), mgr.getContext(),
+ *mgr.getLiveVariables(), *mgr.getParentMap(),
mgr.getDiagnostic());
}
diff --git a/include/clang/Analysis/LocalCheckers.h b/include/clang/Analysis/LocalCheckers.h
index 2369196b0b..2028393879 100644
--- a/include/clang/Analysis/LocalCheckers.h
+++ b/include/clang/Analysis/LocalCheckers.h
@@ -26,10 +26,14 @@ class GRTransferFuncs;
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);
diff --git a/lib/Analysis/DeadStores.cpp b/lib/Analysis/DeadStores.cpp
index 208e66f3e9..265679ff7e 100644
--- a/lib/Analysis/DeadStores.cpp
+++ b/lib/Analysis/DeadStores.cpp
@@ -151,6 +151,12 @@ void clang::CheckDeadStores(CFG& cfg, ASTContext &Ctx,
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);
}