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

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Tue Aug 27 16:22:21 PDT 2024


================
@@ -2048,6 +2049,24 @@ void TypePrinter::printBTFTagAttributedAfter(const BTFTagAttributedType *T,
   printAfter(T->getWrappedType(), OS);
 }
 
+void TypePrinter::printHLSLAttributedResourceBefore(
+    const HLSLAttributedResourceType *T, raw_ostream &OS) {
+  printBefore(T->getWrappedType(), OS);
+
+  const HLSLAttributedResourceType::Attributes &Attrs = T->getAttrs();
+  OS << " [[hlsl::resource_class("
+     << HLSLResourceClassAttr::ConvertResourceClassToStr(
+            static_cast<llvm::dxil::ResourceClass>(Attrs.ResourceClass))
----------------
bogner wrote:

If we can use the enum directly we can avoid this cast.

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


More information about the cfe-commits mailing list