[llvm] [NFC][TableGen] Code cleanup in Record.h/cpp (PR #138876)

Sergei Barannikov via llvm-commits llvm-commits at lists.llvm.org
Thu May 8 13:29:28 PDT 2025


================
@@ -569,9 +570,8 @@ const Init *BitsInit::resolveReferences(Resolver &R) const {
   const Init *CachedBitVarRef = nullptr;
   const Init *CachedBitVarResolved = nullptr;
 
-  for (unsigned i = 0, e = getNumBits(); i != e; ++i) {
-    const Init *CurBit = getBit(i);
-    const Init *NewBit = CurBit;
+  for (auto [CurBit, NewBit] : zip_equal(getBits(), NewBits)) {
+    NewBit = CurBit;
----------------
s-barannikov wrote:

Does it really work?

https://github.com/llvm/llvm-project/pull/138876


More information about the llvm-commits mailing list