[PATCH] D44624: TableGen: Remove redundant loop in ListInit::resolveReferences

Nicolai Hähnle via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 19 07:32:07 PDT 2018


nhaehnle created this revision.
nhaehnle added reviewers: arsenm, craig.topper, tra, MartinO.
Herald added a subscriber: wdng.
nhaehnle added a dependency: D44478: TableGen: Streamline how defs are instantiated.

Recursive lookups are handled by the Resolver, so the loop was purely
a waste of runtime.

Change-Id: I2bd23a68b478aea0bbac1a86ca7635adffa28688


Repository:
  rL LLVM

https://reviews.llvm.org/D44624

Files:
  lib/TableGen/Record.cpp


Index: lib/TableGen/Record.cpp
===================================================================
--- lib/TableGen/Record.cpp
+++ lib/TableGen/Record.cpp
@@ -634,13 +634,8 @@
   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);
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44624.138920.patch
Type: text/x-patch
Size: 500 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180319/7eb66915/attachment.bin>


More information about the llvm-commits mailing list