================ @@ -136,6 +136,51 @@ struct OverlappingRanges { llvm::SmallVector<OverlappingRanges> findOverlappingRanges(llvm::SmallVector<RangeInfo> &Infos); +class RootSignatureBindingValidation { +private: + llvm::SmallVector<RangeInfo, 16> Bindings; + struct TypeRange { + uint32_t Start; + uint32_t End; + }; + std::unordered_map<dxil::ResourceClass, TypeRange> Ranges; + +public: + void addBinding(dxil::ResourceClass Type, const RangeInfo &Binding) { + auto It = Ranges.find(Type); + + if (It == Ranges.end()) { + uint32_t InsertPos = Bindings.size(); + Bindings.push_back(Binding); + Ranges[Type] = {InsertPos, InsertPos + 1}; + } else { ---------------- llvm-beanz wrote:
nit: Instead of an `else` you could have an early return to avoid nesting. https://llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code https://github.com/llvm/llvm-project/pull/146785 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits