[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)
Xiang Li via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 26 09:03:52 PDT 2024
================
@@ -1016,7 +1016,34 @@ static llvm::StringRef canonicalizePlatformName(llvm::StringRef Platform) {
.Case("visionos_app_extension", "xros_app_extension")
.Case("ShaderModel", "shadermodel")
.Default(Platform);
-} }];
+}
+static llvm::StringRef getPrettyEnviromentName(llvm::StringRef Environment) {
+ return llvm::StringSwitch<llvm::StringRef>(Environment)
+ .Case("pixel", "pixel shader")
+ .Case("vertex", "vertex shader")
+ .Case("geometry", "geometry shader")
+ .Case("hull", "hull shader")
+ .Case("domain", "domain shader")
+ .Case("compute", "compute shader")
+ .Case("mesh", "mesh shader")
+ .Case("amplification", "amplification shader")
+ .Case("library", "shader library")
+ .Default(Environment);
+}
+static llvm::Triple::EnvironmentType getEnvironmentType(llvm::StringRef Environment) {
+ return llvm::StringSwitch<llvm::Triple::EnvironmentType>(Environment)
----------------
python3kgae wrote:
Will this support environment other than HLSL profiles?
https://github.com/llvm/llvm-project/pull/89809
More information about the cfe-commits
mailing list