================ @@ -89,14 +99,57 @@ llvm::TargetExtType *HLSLBufferLayoutBuilder::createLayoutType( RecordTypes.pop_back(); for (const auto *FD : RT->getDecl()->fields()) { - assert((!Packoffsets || Index < Packoffsets->size()) && - "number of elements in layout struct does not " - "match number of packoffset annotations"); + unsigned FieldOffset = UINT_MAX; + llvm::Type *FieldType = nullptr; + + if (Packoffsets) { + // have packoffset/register(c#) annotations + assert(Index < Packoffsets->size() && + "number of elements in layout struct does not match number of " + "packoffset annotations"); + int PO = (*Packoffsets)[Index++]; ---------------- alsepkow wrote:
P0 should be a const, I think? I noticed we don't really use that pattern in DXC but it looks like it is used here. https://github.com/llvm/llvm-project/pull/128991 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits