From 9a478d523239fe0d01f32ecc8e64e88d1809fd8e Mon Sep 17 00:00:00 2001 From: Chris Bieneman Date: Fri, 19 Aug 2022 09:55:47 -0500 Subject: [PATCH] [NFC] Rename dx.shader to hlsl.shader This metadata annotation is HLSL-specific not DirectX specific. It will need to be attached for shaders regardless of whether they are targeting DXIL. --- clang/lib/CodeGen/CGHLSLRuntime.cpp | 2 +- clang/test/CodeGenHLSL/entry.hlsl | 2 +- clang/test/CodeGenHLSL/shader_type_attr.hlsl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp b/clang/lib/CodeGen/CGHLSLRuntime.cpp index 70c582285136..5c3930869864 100644 --- a/clang/lib/CodeGen/CGHLSLRuntime.cpp +++ b/clang/lib/CodeGen/CGHLSLRuntime.cpp @@ -90,7 +90,7 @@ void CGHLSLRuntime::annotateHLSLResource(const VarDecl *D, GlobalVariable *GV) { void clang::CodeGen::CGHLSLRuntime::setHLSLFunctionAttributes( llvm::Function *F, const FunctionDecl *FD) { if (HLSLShaderAttr *ShaderAttr = FD->getAttr()) { - const StringRef ShaderAttrKindStr = "dx.shader"; + const StringRef ShaderAttrKindStr = "hlsl.shader"; F->addFnAttr(ShaderAttrKindStr, ShaderAttr->ConvertShaderTypeToStr(ShaderAttr->getType())); } diff --git a/clang/test/CodeGenHLSL/entry.hlsl b/clang/test/CodeGenHLSL/entry.hlsl index 10b5f692bfe8..1a1a50735824 100644 --- a/clang/test/CodeGenHLSL/entry.hlsl +++ b/clang/test/CodeGenHLSL/entry.hlsl @@ -3,7 +3,7 @@ // Make sure not mangle entry. // CHECK:define void @foo() // Make sure add function attribute. -// CHECK:"dx.shader"="compute" +// CHECK:"hlsl.shader"="compute" [numthreads(1,1,1)] void foo() { diff --git a/clang/test/CodeGenHLSL/shader_type_attr.hlsl b/clang/test/CodeGenHLSL/shader_type_attr.hlsl index 059ced6cbc2c..8bc7a9c0953e 100644 --- a/clang/test/CodeGenHLSL/shader_type_attr.hlsl +++ b/clang/test/CodeGenHLSL/shader_type_attr.hlsl @@ -3,7 +3,7 @@ // Make sure not mangle entry. // CHECK:define void @foo() // Make sure add function attribute. -// CHECK:"dx.shader"="compute" +// CHECK:"hlsl.shader"="compute" [shader("compute")] [numthreads(1,1,1)] void foo() {