[llvm] r328118 - TableGen: Remove redundant loop in ListInit::resolveReferences
Nicolai Haehnle via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 21 10:13:10 PDT 2018
Author: nha
Date: Wed Mar 21 10:13:10 2018
New Revision: 328118
URL: http://llvm.org/viewvc/llvm-project?rev=328118&view=rev
Log:
TableGen: Remove redundant loop in ListInit::resolveReferences
Summary:
Recursive lookups are handled by the Resolver, so the loop was purely
a waste of runtime.
Change-Id: I2bd23a68b478aea0bbac1a86ca7635adffa28688
Reviewers: arsenm, craig.topper, tra, MartinO
Subscribers: wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D44624
Modified:
llvm/trunk/lib/TableGen/Record.cpp
Modified: llvm/trunk/lib/TableGen/Record.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/TableGen/Record.cpp?rev=328118&r1=328117&r2=328118&view=diff
==============================================================================
--- llvm/trunk/lib/TableGen/Record.cpp (original)
+++ llvm/trunk/lib/TableGen/Record.cpp Wed Mar 21 10:13:10 2018
@@ -634,13 +634,8 @@ Init *ListInit::resolveReferences(Resolv
bool Changed = false;
for (Init *CurElt : getValues()) {
- Init *E;
-
- do {
- E = CurElt;
- CurElt = CurElt->resolveReferences(R);
- Changed |= E != CurElt;
- } while (E != CurElt);
+ Init *E = CurElt->resolveReferences(R);
+ Changed |= E != CurElt;
Resolved.push_back(E);
}
More information about the llvm-commits
mailing list