From: Javed Absar Date: Fri, 6 Oct 2017 15:25:04 +0000 (+0000) Subject: [TableGen] Simplify SubtargetEmitter X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f1af77a152abf4b543e398d6ddf0af1594423473;p=llvm [TableGen] Simplify SubtargetEmitter Remove unnecessary duplicate if-condition. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@315068 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/SubtargetEmitter.cpp b/utils/TableGen/SubtargetEmitter.cpp index 4cb941cfecc..d1e78389d2a 100644 --- a/utils/TableGen/SubtargetEmitter.cpp +++ b/utils/TableGen/SubtargetEmitter.cpp @@ -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::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; }