Skip to content

Commit b263222

Browse files
committed
[ser] Fold 'hlsl_globally|reordercoherent_applies_to' warnings
1 parent b8d9aea commit b263222

2 files changed

Lines changed: 3 additions & 8 deletions

File tree

tools/clang/include/clang/Basic/DiagnosticSemaKinds.td

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7706,10 +7706,8 @@ def err_hlsl_varmodifierna : Error<
77067706
"%0 is not a valid modifier for a %1">;
77077707
def err_hlsl_varmodifierna_decltype : Error<
77087708
"%0 is not a valid modifier for a declaration of type %1">;
7709-
def note_hlsl_globallycoherent_applies_to : Note<
7710-
"'globallycoherent' can only be applied to UAV or RWDispatchNodeInputRecord objects">;
7711-
def note_hlsl_reordercoherent_applies_to : Note<
7712-
"'reordercoherent' can only be applied to UAV objects">;
7709+
def note_hlsl_coherence_applies_to : Note<
7710+
"'%select{reordercoherent|globallycoherent}0' can only be applied to UAV%select{| or RWDispatchNodeInputRecord}0 objects">;
77137711
def warn_hlsl_gc_implies_rc_attribute : Warning<
77147712
"Attribute 'reordercoherent' implied by 'globallycoherent' in %0. 'reordercoherent' ignored.">;
77157713
def err_hlsl_varmodifiersna : Error<

tools/clang/lib/Sema/SemaHLSL.cpp

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13693,10 +13693,7 @@ void Sema::DiagnoseHLSLDeclAttr(const Decl *D, const Attr *A) {
1369313693
(!IsUAV && !IsAllowedNodeIO)) {
1369413694
Diag(A->getLocation(), diag::err_hlsl_varmodifierna_decltype)
1369513695
<< A << DeclType->getCanonicalTypeUnqualified() << A->getRange();
13696-
const unsigned DiagID = IsGCAttr
13697-
? diag::note_hlsl_globallycoherent_applies_to
13698-
: diag::note_hlsl_reordercoherent_applies_to;
13699-
Diag(A->getLocation(), DiagID) << A << A->getRange();
13696+
Diag(A->getLocation(), diag::note_hlsl_coherence_applies_to) << (int) IsGCAttr << A << A->getRange();
1370013697
}
1370113698
return;
1370213699
}

0 commit comments

Comments
 (0)