Author: Chris Bieneman
Date: 2022-08-22T16:03:40-05:00
New Revision: 9a478d523239fe0d01f32ecc8e64e88d1809fd8e

URL: 
https://github.com/llvm/llvm-project/commit/9a478d523239fe0d01f32ecc8e64e88d1809fd8e
DIFF: 
https://github.com/llvm/llvm-project/commit/9a478d523239fe0d01f32ecc8e64e88d1809fd8e.diff

LOG: [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.

Added: 
    

Modified: 
    clang/lib/CodeGen/CGHLSLRuntime.cpp
    clang/test/CodeGenHLSL/entry.hlsl
    clang/test/CodeGenHLSL/shader_type_attr.hlsl

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGHLSLRuntime.cpp 
b/clang/lib/CodeGen/CGHLSLRuntime.cpp
index 70c582285136c..5c3930869864c 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<HLSLShaderAttr>()) {
-    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 10b5f692bfe83..1a1a507358246 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 059ced6cbc2c5..8bc7a9c0953e5 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() {


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to