forked from OSchip/llvm-project
Minor bug fix in LiveVariables: don't "kill" decls referenced by a DeclStmt
that aren't VarDecls. llvm-svn: 47572
This commit is contained in:
parent
8c7a9228de
commit
7845b2607a
|
@ -156,10 +156,10 @@ void TransferFuncs::VisitAssign(BinaryOperator* B) {
|
||||||
void TransferFuncs::VisitDeclStmt(DeclStmt* DS) {
|
void TransferFuncs::VisitDeclStmt(DeclStmt* DS) {
|
||||||
// Declarations effectively "kill" a variable since they cannot
|
// Declarations effectively "kill" a variable since they cannot
|
||||||
// possibly be live before they are declared.
|
// possibly be live before they are declared.
|
||||||
for (ScopedDecl* D = DS->getDecl(); D != NULL; D = D->getNextDeclarator()) {
|
for (ScopedDecl* D = DS->getDecl(); D != NULL; D = D->getNextDeclarator())
|
||||||
|
if (VarDecl* VD = dyn_cast<VarDecl>(D)) {
|
||||||
LiveState(D,AD) = Dead;
|
LiveState(D,AD) = Dead;
|
||||||
|
|
||||||
if (VarDecl* VD = dyn_cast<VarDecl>(D))
|
|
||||||
if (Expr* Init = VD->getInit())
|
if (Expr* Init = VD->getInit())
|
||||||
Visit(Init);
|
Visit(Init);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue