diff options
author | Helena Kotas <hekotas@microsoft.com> | 2024-05-19 10:46:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-19 10:46:12 -0700 |
commit | 3f33c4c14e79e68007cf1460e4a0e606eb199da5 (patch) | |
tree | 375cffc00e08ba25d9c66a89df93cee86805a3ff /clang/lib/Sema/SemaDecl.cpp | |
parent | c34079c9455515fd1eb4feaa7613a57e88b7209d (diff) | |
download | llvm-3f33c4c14e79e68007cf1460e4a0e606eb199da5.zip llvm-3f33c4c14e79e68007cf1460e4a0e606eb199da5.tar.gz llvm-3f33c4c14e79e68007cf1460e4a0e606eb199da5.tar.bz2 |
[Clang][HLSL] Add environment parameter to availability attribute (#89809)
Add `environment` parameter to Clang availability attribute. The allowed
values for this parameter are a subset of values allowed in the
`llvm::Triple` environment component. If the `environment` parameters is
present, the declared availability attribute applies only to targets
with the same platform and environment.
This new parameter will be initially used for annotating HLSL functions
for the `shadermodel` platform because in HLSL built-in function
availability can depend not just on the shader model version (mapped to
`llvm::Triple::OSType`) but also on the target shader stage (mapped to
`llvm::Triple::EnvironmentType`). See example in #89802 and
microsoft/hlsl-specs#204 for more details.
The environment parameter is currently supported only for HLSL.
Fixes #89802
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index f2b9202..557fe106 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -2879,7 +2879,7 @@ static bool mergeDeclAttribute(Sema &S, NamedDecl *D, D, *AA, AA->getPlatform(), AA->isImplicit(), AA->getIntroduced(), AA->getDeprecated(), AA->getObsoleted(), AA->getUnavailable(), AA->getMessage(), AA->getStrict(), AA->getReplacement(), AMK, - AA->getPriority()); + AA->getPriority(), AA->getEnvironment()); else if (const auto *VA = dyn_cast<VisibilityAttr>(Attr)) NewAttr = S.mergeVisibilityAttr(D, *VA, VA->getVisibility()); else if (const auto *VA = dyn_cast<TypeVisibilityAttr>(Attr)) |