forked from OSchip/llvm-project
Fixed bug in 'LiveVariables' analysis where we incorrectly marked a variable
dead at an assignment without taking into account if the variable was used in the RHS of the assignment. llvm-svn: 46153
This commit is contained in:
parent
b716fbab44
commit
05ecfddfc3
|
@ -77,10 +77,9 @@ void TransferFuncs::Visit(Stmt *S) {
|
|||
if (AD.Observer)
|
||||
AD.Observer->ObserveStmt(S,AD,LiveState);
|
||||
|
||||
|
||||
if (S == getCurrentBlkStmt()) {
|
||||
StmtVisitor<TransferFuncs,void>::Visit(S);
|
||||
if (getCFG().isBlkExpr(S)) LiveState(S,AD) = Dead;
|
||||
StmtVisitor<TransferFuncs,void>::Visit(S);
|
||||
}
|
||||
else if (!getCFG().isBlkExpr(S))
|
||||
StmtVisitor<TransferFuncs,void>::Visit(S);
|
||||
|
@ -199,6 +198,10 @@ bool LiveVariables::isLive(const Stmt* Loc, const Stmt* StmtVal) const {
|
|||
return getStmtData(Loc)(StmtVal,getAnalysisData());
|
||||
}
|
||||
|
||||
bool LiveVariables::isLive(const Stmt* Loc, const VarDecl* D) const {
|
||||
return getStmtData(Loc)(D,getAnalysisData());
|
||||
}
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
// printing liveness state for debugging
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue