llvm-project
fea72dad - [HLSL] Fix interleaved vector and matrix return types in AST dump

Commit
56 days ago
[HLSL] Fix interleaved vector and matrix return types in AST dump HLSL vector and matrix types were previously printed with their closing syntax (', N>') in 'printAfter', causing them to interleave with function parameters when used as return types (e.g., 'vector<float (args), 4>'). This change moves the HLSL vector and matrix closing syntax into 'printBefore' when 'UseHLSLTypes' is enabled, ensuring the type is printed completely before the parameter list. Note that address space qualifiers are now printed after the type (e.g., 'vector<float, 4>hlsl_device'). This is because 'canPrefixQualifiers' in 'TypePrinter.cpp' returns false for these types. We cannot easily change this to check 'UseHLSLTypes' because 'canPrefixQualifiers' is a static method and does not have access to the PrintingPolicy at that point. Fixes interleaved output in HLSL AST tests. Assisted-by: Gemini
Author
Committer
Parents
Loading