Significant cleanups and bug-fixes to LiveVariables. Uses new refactored
ExprDeclBitVector class for defining dataflow state.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42446 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Analysis/DeadStores.cpp b/Analysis/DeadStores.cpp
index 642b90b..28c21b0 100644
--- a/Analysis/DeadStores.cpp
+++ b/Analysis/DeadStores.cpp
@@ -38,7 +38,7 @@
if (DeclRefExpr* DR = dyn_cast<DeclRefExpr>(B->getLHS()))
// Is the variable NOT live? If so, flag a dead store.
- if (!Live(AD,DR->getDecl())) {
+ if (!Live(DR->getDecl(),AD)) {
SourceRange R = B->getRHS()->getSourceRange();
Diags.Report(DR->getSourceRange().Begin(), diag::warn_dead_store,
0, 0, &R, 1);
@@ -50,7 +50,7 @@
for (VarDecl* V = cast<VarDecl>(DS->getDecl()); V != NULL ;
V = cast_or_null<VarDecl>(V->getNextDeclarator())) {
if (Expr* E = V->getInit()) {
- if (!Live(AD,DS->getDecl())) {
+ if (!Live(DS->getDecl(),AD)) {
// Special case: check for initializations with constants.
//
// e.g. : int x = 0;