summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/AnalysisBasedWarnings.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-02-21 20:58:29 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-02-21 20:58:29 +0000
commit2a01f5d426c6bb0ef57c0a018942f6f6b179827a (patch)
tree6484b1be92360933abdd7d03a8b1110d6c0aa76f /clang/lib/Sema/AnalysisBasedWarnings.cpp
parent23720cc66c3b639b2c4c1399e9f994dc14c5814b (diff)
downloadbcm5719-llvm-2a01f5d426c6bb0ef57c0a018942f6f6b179827a.tar.gz
bcm5719-llvm-2a01f5d426c6bb0ef57c0a018942f6f6b179827a.zip
Replace CFGElement llvm::cast support to be well-defined.
See r175462 for another example/more details. llvm-svn: 175796
Diffstat (limited to 'clang/lib/Sema/AnalysisBasedWarnings.cpp')
-rw-r--r--clang/lib/Sema/AnalysisBasedWarnings.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index e9cf7ccd854..9a67d4991fd 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -158,7 +158,7 @@ static ControlFlowKind CheckFallThrough(AnalysisDeclContext &AC) {
CFGBlock::const_reverse_iterator ri = B.rbegin(), re = B.rend();
for ( ; ri != re ; ++ri)
- if (isa<CFGStmt>(*ri))
+ if (ri->getAs<CFGStmt>())
break;
// No more CFGElements in the block?
@@ -172,7 +172,7 @@ static ControlFlowKind CheckFallThrough(AnalysisDeclContext &AC) {
continue;
}
- CFGStmt CS = cast<CFGStmt>(*ri);
+ CFGStmt CS = ri->castAs<CFGStmt>();
const Stmt *S = CS.getStmt();
if (isa<ReturnStmt>(S)) {
HasLiveReturn = true;
@@ -762,8 +762,8 @@ namespace {
for (CFGBlock::const_reverse_iterator ElemIt = P->rbegin(),
ElemEnd = P->rend();
ElemIt != ElemEnd; ++ElemIt) {
- if (const CFGStmt *CS = ElemIt->getAs<CFGStmt>()) {
- if (const AttributedStmt *AS = asFallThroughAttr(CS->getStmt())) {
+ if (CFGStmt CS = ElemIt->getAs<CFGStmt>()) {
+ if (const AttributedStmt *AS = asFallThroughAttr(CS.getStmt())) {
S.Diag(AS->getLocStart(),
diag::warn_fallthrough_attr_unreachable);
markFallthroughVisited(AS);
@@ -833,8 +833,8 @@ namespace {
for (CFGBlock::const_reverse_iterator ElemIt = B.rbegin(),
ElemEnd = B.rend();
ElemIt != ElemEnd; ++ElemIt) {
- if (const CFGStmt *CS = ElemIt->getAs<CFGStmt>())
- return CS->getStmt();
+ if (CFGStmt CS = ElemIt->getAs<CFGStmt>())
+ return CS.getStmt();
}
// Workaround to detect a statement thrown out by CFGBuilder:
// case X: {} case Y:
OpenPOWER on IntegriCloud