================ @@ -1377,32 +1378,28 @@ bool SemaHLSL::handleRootSignatureElements( if (Clause->NumDescriptors == 0) return true; - if (Clause->Offset != - llvm::hlsl::rootsig::DescriptorTableOffsetAppend) { - // Manually specified the offset + bool IsAppending = + Clause->Offset == llvm::hlsl::rootsig::DescriptorTableOffsetAppend; + if (!IsAppending) Offset = Clause->Offset; ---------------- joaosaffran wrote:
It seems like, if you check if the offset is overflowing before updating it you might be able to simplify this like: ```cpp if (!verifyNoOverflowedOffset(Offset)) Diag(Loc, diag::err_hlsl_appending_onto_unbound); if(Clause->Offset != llvm::hlsl::rootsig::DescriptorTableOffsetAppend) Offset = Clause->Offset; ``` And wouldn't need to keep track of `Unbound` https://github.com/llvm/llvm-project/pull/159475 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits