Skip to content

Commit 54f3aea

Browse files
committed
Fix dyncast
1 parent f493f9b commit 54f3aea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

clang/lib/Analysis/CFG.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,12 +444,12 @@ class reverse_children {
444444
} // namespace
445445

446446
reverse_children::reverse_children(Stmt *S, ASTContext &Ctx) {
447-
switch (S->getStmtClass()) {
448-
case Stmt::CallExprClass: {
449-
children = cast<CallExpr>(S)->getRawSubExprs();
447+
if (CallExpr *CE = dyn_cast<CallExpr>(S)) {
448+
children = CE->getRawSubExprs();
450449
return;
451450
}
452451

452+
switch (S->getStmtClass()) {
453453
// Note: Fill in this switch with more cases we want to optimize.
454454
case Stmt::InitListExprClass: {
455455
InitListExpr *IE = cast<InitListExpr>(S);

0 commit comments

Comments
 (0)