diff options
Diffstat (limited to 'clang/lib/AST/StmtProfile.cpp')
-rw-r--r-- | clang/lib/AST/StmtProfile.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/AST/StmtProfile.cpp b/clang/lib/AST/StmtProfile.cpp index f68bc3a397f7..fd365843c2fa 100644 --- a/clang/lib/AST/StmtProfile.cpp +++ b/clang/lib/AST/StmtProfile.cpp @@ -898,22 +898,20 @@ void StmtProfiler::VisitInitListExpr(const InitListExpr *S) { void StmtProfiler::VisitDesignatedInitExpr(const DesignatedInitExpr *S) { VisitExpr(S); ID.AddBoolean(S->usesGNUSyntax()); - for (DesignatedInitExpr::const_designators_iterator D = - S->designators_begin(), DEnd = S->designators_end(); - D != DEnd; ++D) { - if (D->isFieldDesignator()) { + for (const DesignatedInitExpr::Designator &D : S->designators()) { + if (D.isFieldDesignator()) { ID.AddInteger(0); - VisitName(D->getFieldName()); + VisitName(D.getFieldName()); continue; } - if (D->isArrayDesignator()) { + if (D.isArrayDesignator()) { ID.AddInteger(1); } else { - assert(D->isArrayRangeDesignator()); + assert(D.isArrayRangeDesignator()); ID.AddInteger(2); } - ID.AddInteger(D->getFirstExprIndex()); + ID.AddInteger(D.getFirstExprIndex()); } } |