]> granicus.if.org Git - llvm/commitdiff
[TableGen] Simplify SubtargetEmitter
authorJaved Absar <javed.absar@arm.com>
Fri, 6 Oct 2017 15:25:04 +0000 (15:25 +0000)
committerJaved Absar <javed.absar@arm.com>
Fri, 6 Oct 2017 15:25:04 +0000 (15:25 +0000)
Remove unnecessary duplicate if-condition.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315068 91177308-0d34-0410-b5e6-96231b3b80d8

utils/TableGen/SubtargetEmitter.cpp

index 4cb941cfecceb6db63a0e48c7fff852b928eda2b..d1e78389d2a8352a8bc8bab975a01e6df412b9d7 100644 (file)
@@ -821,14 +821,10 @@ void SubtargetEmitter::GenSchedClassTables(const CodeGenProcModel &ProcModel,
 
     // A Variant SchedClass has no resources of its own.
     bool HasVariants = false;
-    for (std::vector<CodeGenSchedTransition>::const_iterator
-           TI = SC.Transitions.begin(), TE = SC.Transitions.end();
-         TI != TE; ++TI) {
-      if (TI->ProcIndices[0] == 0) {
-        HasVariants = true;
-        break;
-      }
-      if (is_contained(TI->ProcIndices, ProcModel.Index)) {
+    for (const CodeGenSchedTransition &CGT :
+           make_range(SC.Transitions.begin(), SC.Transitions.end())) {
+      if (CGT.ProcIndices[0] == 0 ||
+          is_contained(CGT.ProcIndices, ProcModel.Index)) {
         HasVariants = true;
         break;
       }