================
@@ -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;
----------------
inbelic wrote:
I still think we can simplify this logic as denote
[here](https://github.com/llvm/llvm-project/pull/146785#discussion_r2205797483):
> I think we could implement this much simpler with something like:
>
> ```
> using TypedBinding = std::pair<Type, ResourceBinding>;
> llvm::SmallVector<TypedBinding> Bindings;
> ```
>
> and then below, instead of `Range.find` we do a `llvm::lower_bound(Bindings,
> ...)` with respect to the type. So that `Bindings` will be grouped together
> by type.
>
> Or `addBinding` just becomes a `push_back` and then we do `llvm::sort` by
> group before returning them in `getBindingsOfType`
>
> Then `getBindingsOfType` can take advantage of the sorted nature to return
> it. I don't think there would be any harm in returning an array ref of
> `TypedBinding` either.
https://github.com/llvm/llvm-project/pull/146785
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits