================
@@ -111,53 +118,52 @@ llvm::TargetExtType 
*HLSLBufferLayoutBuilder::createLayoutType(
       if (!PackOffsets || PO != -1) {
         if (!layoutField(FD, EndOffset, FieldOffset, FieldType, PO))
           return nullptr;
-        Layout.push_back(FieldOffset);
-        LayoutElements.push_back(FieldType);
+        Layout.emplace_back(FieldOffset, FieldType);
         continue;
       }
       // Have PackOffset info, but there is no packoffset/register(cX)
       // annotation on this field. Delay the layout until after all of the
       // other elements with packoffsets/register(cX) are processed.
-      DelayLayoutFields.emplace_back(FD, LayoutElements.size());
+      DelayLayoutFields.emplace_back(FD, Layout.size());
       // reserve space for this field in the layout vector and elements list
-      Layout.push_back(UINT_MAX);
-      LayoutElements.push_back(nullptr);
+      Layout.emplace_back(UINT_MAX, nullptr);
     }
   }
 
   // process delayed layouts
   for (auto I : DelayLayoutFields) {
     const FieldDecl *FD = I.first;
-    const unsigned IndexInLayoutElements = I.second;
-    // the first item in layout vector is size, so we need to offset the index
-    // by 1
-    const unsigned IndexInLayout = IndexInLayoutElements + 1;
-    assert(Layout[IndexInLayout] == UINT_MAX &&
-           LayoutElements[IndexInLayoutElements] == nullptr);
+    assert(Layout[I.second] == std::pair(UINT_MAX, nullptr));
----------------
s-perron wrote:

I'm seeing the same.

https://github.com/llvm/llvm-project/pull/156919
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to