[clang] 9a3f3a9 - [clang][Interp][NFC] Use range for loop

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 16 01:39:31 PST 2023


Author: Timm Bäder
Date: 2023-01-16T10:39:13+01:00
New Revision: 9a3f3a9a08d8ee37e6bf7f6f418c4c64bccee3f3

URL: https://github.com/llvm/llvm-project/commit/9a3f3a9a08d8ee37e6bf7f6f418c4c64bccee3f3
DIFF: https://github.com/llvm/llvm-project/commit/9a3f3a9a08d8ee37e6bf7f6f418c4c64bccee3f3.diff

LOG: [clang][Interp][NFC] Use range for loop

Added: 
    

Modified: 
    clang/lib/AST/Interp/InterpFrame.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/InterpFrame.cpp b/clang/lib/AST/Interp/InterpFrame.cpp
index 9bdb71237b5d5..619c56fe4bf7a 100644
--- a/clang/lib/AST/Interp/InterpFrame.cpp
+++ b/clang/lib/AST/Interp/InterpFrame.cpp
@@ -130,17 +130,17 @@ void print(llvm::raw_ostream &OS, const Pointer &P, ASTContext &Ctx,
   }
 
   printDesc(P.getDeclDesc());
-  for (auto It = Levels.rbegin(); It != Levels.rend(); ++It) {
-    if (It->inArray()) {
-      OS << "[" << It->expand().getIndex() << "]";
+  for (const auto &It : Levels) {
+    if (It.inArray()) {
+      OS << "[" << It.expand().getIndex() << "]";
       continue;
     }
-    if (auto Index = It->getIndex()) {
+    if (auto Index = It.getIndex()) {
       OS << " + " << Index;
       continue;
     }
     OS << ".";
-    printDesc(It->getFieldDesc());
+    printDesc(It.getFieldDesc());
   }
 }
 


        


More information about the cfe-commits mailing list