[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.
This commit is contained in:
Chris Bieneman 2022-08-19 09:55:47 -05:00
parent 478cf94378
commit 9a478d5232
3 changed files with 3 additions and 3 deletions

View File

@ -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()));
}

View File

@ -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() {

View File

@ -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() {