diff options
author | David Blaikie <dblaikie@gmail.com> | 2013-02-21 20:58:29 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2013-02-21 20:58:29 +0000 |
commit | fdf6a279c9a75c778eba382d9a156697092982a1 (patch) | |
tree | e67bc01445260b8cd78ddfd21f1a9f4fe059ac79 /lib/Analysis/LiveVariables.cpp | |
parent | 05f8ff134d5f270bd7bfe4aaef491bd3febddea1 (diff) |
Replace CFGElement llvm::cast support to be well-defined.
See r175462 for another example/more details.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175796 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/LiveVariables.cpp')
-rw-r--r-- | lib/Analysis/LiveVariables.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Analysis/LiveVariables.cpp b/lib/Analysis/LiveVariables.cpp index 1f616f7a5d..519d5288b8 100644 --- a/lib/Analysis/LiveVariables.cpp +++ b/lib/Analysis/LiveVariables.cpp @@ -474,15 +474,15 @@ LiveVariablesImpl::runOnBlock(const CFGBlock *block, ei = block->rend(); it != ei; ++it) { const CFGElement &elem = *it; - if (const CFGAutomaticObjDtor *Dtor = dyn_cast<CFGAutomaticObjDtor>(&elem)){ - val.liveDecls = DSetFact.add(val.liveDecls, Dtor->getVarDecl()); + if (CFGAutomaticObjDtor Dtor = elem.getAs<CFGAutomaticObjDtor>()){ + val.liveDecls = DSetFact.add(val.liveDecls, Dtor.getVarDecl()); continue; } - if (!isa<CFGStmt>(elem)) + if (!elem.getAs<CFGStmt>()) continue; - const Stmt *S = cast<CFGStmt>(elem).getStmt(); + const Stmt *S = elem.castAs<CFGStmt>().getStmt(); TF.Visit(const_cast<Stmt*>(S)); stmtsToLiveness[S] = val; } @@ -534,8 +534,8 @@ LiveVariables::computeLiveness(AnalysisDeclContext &AC, if (killAtAssign) for (CFGBlock::const_iterator bi = block->begin(), be = block->end(); bi != be; ++bi) { - if (const CFGStmt *cs = bi->getAs<CFGStmt>()) { - if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(cs->getStmt())) { + if (CFGStmt cs = bi->getAs<CFGStmt>()) { + if (const BinaryOperator *BO = dyn_cast<BinaryOperator>(cs.getStmt())) { if (BO->getOpcode() == BO_Assign) { if (const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(BO->getLHS()->IgnoreParens())) { |