[clang] [HLSL] Make HLSLAttributedResourceType canonical and add code paths to convert HLSL types to DirectX target types (PR #110327)

Greg Roth via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 9 16:02:47 PDT 2024


================
@@ -4493,28 +4493,34 @@ void CXXNameMangler::mangleType(const ArrayParameterType *T) {
 }
 
 void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) {
-  mangleType(T->getWrappedType());
+  llvm::SmallString<64> Str("_Res");
   const HLSLAttributedResourceType::Attributes &Attrs = T->getAttrs();
   // map resource class to HLSL virtual register letter
   switch (Attrs.ResourceClass) {
-  case llvm::dxil::ResourceClass::UAV:
-    Out << 'u';
+  case llvm::dxil::ResourceClass::UAV: 
+    Str += "_u";
     break;
-  case llvm::dxil::ResourceClass::SRV:
-    Out << 't';
+  case llvm::dxil::ResourceClass::SRV: 
----------------
pow2clk wrote:

nit: introduced trailing whitespace

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


More information about the cfe-commits mailing list