[clang] [llvm] [HLSL] AST support for WaveSize attribute. (PR #101240)
Joshua Batista via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 7 11:04:39 PDT 2024
================
@@ -144,6 +145,25 @@ HLSLNumThreadsAttr *SemaHLSL::mergeNumThreadsAttr(Decl *D,
HLSLNumThreadsAttr(getASTContext(), AL, X, Y, Z);
}
+HLSLWaveSizeAttr *SemaHLSL::mergeWaveSizeAttr(Decl *D,
+ const AttributeCommonInfo &AL,
+ int Min, int Max, int Preferred,
+ int SpelledArgsCount) {
+ if (HLSLWaveSizeAttr *NT = D->getAttr<HLSLWaveSizeAttr>()) {
+ if (NT->getMin() != Min || NT->getMax() != Max ||
+ NT->getPreferred() != Preferred ||
+ NT->getSpelledArgsCount() != SpelledArgsCount) {
+ Diag(NT->getLocation(), diag::err_hlsl_attribute_param_mismatch) << AL;
+ Diag(AL.getLoc(), diag::note_conflicting_attribute);
+ }
+ return nullptr;
----------------
bob80905 wrote:
Maybe worth considering adding to docs / specs that if multiple attributes are on a decl, the first one is what's applied. I think there were some other attributes where the final attribute is what's applied, can't remember which.
https://github.com/llvm/llvm-project/pull/101240
More information about the cfe-commits
mailing list