From 3aaf26d335cf0c70cc3c057ffce518a1cfa0e346 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Wed, 22 Apr 2015 05:27:47 +0000 Subject: [PATCH] [TableGen] Use range based for loops. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235482 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/TableGen/Record.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index ba3f7235536..5698de02d68 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -396,13 +396,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { // If one is a Record type, check superclasses if (RecordRecTy *RecTy1 = dyn_cast(T1)) { // See if T2 inherits from a type T1 also inherits from - const std::vector &T1SuperClasses = - RecTy1->getRecord()->getSuperClasses(); - for(std::vector::const_iterator i = T1SuperClasses.begin(), - iend = T1SuperClasses.end(); - i != iend; - ++i) { - RecordRecTy *SuperRecTy1 = RecordRecTy::get(*i); + for (Record *SuperRec1 : RecTy1->getRecord()->getSuperClasses()) { + RecordRecTy *SuperRecTy1 = RecordRecTy::get(SuperRec1); RecTy *NewType1 = resolveTypes(SuperRecTy1, T2); if (NewType1) return NewType1; @@ -410,13 +405,8 @@ RecTy *llvm::resolveTypes(RecTy *T1, RecTy *T2) { } if (RecordRecTy *RecTy2 = dyn_cast(T2)) { // See if T1 inherits from a type T2 also inherits from - const std::vector &T2SuperClasses = - RecTy2->getRecord()->getSuperClasses(); - for (std::vector::const_iterator i = T2SuperClasses.begin(), - iend = T2SuperClasses.end(); - i != iend; - ++i) { - RecordRecTy *SuperRecTy2 = RecordRecTy::get(*i); + for (Record *SuperRec2 : RecTy2->getRecord()->getSuperClasses()) { + RecordRecTy *SuperRecTy2 = RecordRecTy::get(SuperRec2); RecTy *NewType2 = resolveTypes(T1, SuperRecTy2); if (NewType2) return NewType2;