[clang] [HLSL] Add HLSLAttributedResourceType (PR #106181)

Joshua Batista via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 16:57:39 PDT 2024


================
@@ -799,6 +799,19 @@ static bool IsEquivalentExceptionSpec(StructuralEquivalenceContext &Context,
   return true;
 }
 
+// Determine structural equivalence of two instances of
+// HLSLAttributedResourceType::Attributes
+static bool
+IsStructurallyEquivalent(StructuralEquivalenceContext &Context,
+                         const HLSLAttributedResourceType::Attributes &Attrs1,
+                         const HLSLAttributedResourceType::Attributes &Attrs2) {
+  if (Attrs1.ResourceClass != Attrs2.ResourceClass)
----------------
bob80905 wrote:

nit: this will have more attributes in the future, so it may be convenient to just use std::tie and grow the list as attributes are added, so something like:
`return std::tie(Attrs1.ResourceClass, Attrs1.IsROV, /*is_cube, is_ms, texture_dimension etc*/) == std::tie(Attrs2.ResourceClass, Attrs2.IsROV);

https://github.com/llvm/llvm-project/pull/106181


More information about the cfe-commits mailing list