@@ -217,8 +217,7 @@ void EnumRawTypeRequest::diagnoseCycle(DiagnosticEngine &diags) const {
217217
218218void EnumRawTypeRequest::noteCycleStep (DiagnosticEngine &diags) const {
219219 auto *decl = std::get<0 >(getStorage ());
220- diags.diagnose (decl, diag::kind_declname_declared_here,
221- decl->getDescriptiveKind (), decl->getName ());
220+ diags.diagnose (decl, diag::decl_declared_here_with_kind, decl);
222221}
223222
224223// ----------------------------------------------------------------------------//
@@ -248,10 +247,8 @@ void ProtocolRequiresClassRequest::diagnoseCycle(DiagnosticEngine &diags) const
248247}
249248
250249void ProtocolRequiresClassRequest::noteCycleStep (DiagnosticEngine &diags) const {
251- auto requirement = std::get<0 >(getStorage ());
252- diags.diagnose (requirement, diag::kind_declname_declared_here,
253- DescriptiveDeclKind::Protocol,
254- requirement->getName ());
250+ auto *proto = std::get<0 >(getStorage ());
251+ diags.diagnose (proto, diag::decl_declared_here_with_kind, proto);
255252}
256253
257254std::optional<bool > ProtocolRequiresClassRequest::getCachedResult () const {
@@ -274,9 +271,8 @@ void ExistentialConformsToSelfRequest::diagnoseCycle(DiagnosticEngine &diags) co
274271}
275272
276273void ExistentialConformsToSelfRequest::noteCycleStep (DiagnosticEngine &diags) const {
277- auto requirement = std::get<0 >(getStorage ());
278- diags.diagnose (requirement, diag::kind_declname_declared_here,
279- DescriptiveDeclKind::Protocol, requirement->getName ());
274+ auto *proto = std::get<0 >(getStorage ());
275+ diags.diagnose (proto, diag::decl_declared_here_with_kind, proto);
280276}
281277
282278std::optional<bool > ExistentialConformsToSelfRequest::getCachedResult () const {
@@ -301,9 +297,8 @@ void HasSelfOrAssociatedTypeRequirementsRequest::diagnoseCycle(
301297
302298void HasSelfOrAssociatedTypeRequirementsRequest::noteCycleStep (
303299 DiagnosticEngine &diags) const {
304- auto requirement = std::get<0 >(getStorage ());
305- diags.diagnose (requirement, diag::kind_declname_declared_here,
306- DescriptiveDeclKind::Protocol, requirement->getName ());
300+ auto *proto = std::get<0 >(getStorage ());
301+ diags.diagnose (proto, diag::decl_declared_here_with_kind, proto);
307302}
308303
309304std::optional<bool >
@@ -1419,8 +1414,7 @@ void HasCircularInheritedProtocolsRequest::diagnoseCycle(
14191414void HasCircularInheritedProtocolsRequest::noteCycleStep (
14201415 DiagnosticEngine &diags) const {
14211416 auto *decl = std::get<0 >(getStorage ());
1422- diags.diagnose (decl, diag::kind_declname_declared_here,
1423- decl->getDescriptiveKind (), decl->getName ());
1417+ diags.diagnose (decl, diag::decl_declared_here_with_kind, decl);
14241418}
14251419
14261420// ----------------------------------------------------------------------------//
@@ -1434,8 +1428,7 @@ void HasCircularRawValueRequest::diagnoseCycle(DiagnosticEngine &diags) const {
14341428
14351429void HasCircularRawValueRequest::noteCycleStep (DiagnosticEngine &diags) const {
14361430 auto *decl = std::get<0 >(getStorage ());
1437- diags.diagnose (decl, diag::kind_declname_declared_here,
1438- decl->getDescriptiveKind (), decl->getName ());
1431+ diags.diagnose (decl, diag::decl_declared_here_with_kind, decl);
14391432}
14401433
14411434// ----------------------------------------------------------------------------//
0 commit comments