@@ -794,7 +794,8 @@ void swift::ide::api::SDKNodeDeclType::diagnose(SDKNode *Right) {
794
794
return ;
795
795
auto Loc = R->getLoc ();
796
796
if (getDeclKind () != R->getDeclKind ()) {
797
- emitDiag (Loc, diag::decl_kind_changed, getDeclKindStr (R->getDeclKind ()));
797
+ emitDiag (Loc, diag::decl_kind_changed, getDeclKindStr (R->getDeclKind (),
798
+ getSDKContext ().getOpts ().CompilerStyle ));
798
799
return ;
799
800
}
800
801
@@ -986,7 +987,8 @@ void swift::ide::api::SDKNodeDeclOperator::diagnose(SDKNode *Right) {
986
987
return ;
987
988
auto Loc = RO->getLoc ();
988
989
if (getDeclKind () != RO->getDeclKind ()) {
989
- emitDiag (Loc, diag::decl_kind_changed, getDeclKindStr (RO->getDeclKind ()));
990
+ emitDiag (Loc, diag::decl_kind_changed, getDeclKindStr (RO->getDeclKind (),
991
+ getSDKContext ().getOpts ().CompilerStyle ));
990
992
}
991
993
}
992
994
@@ -2121,7 +2123,8 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
2121
2123
if (auto *Added = findAddedDecl (Node)) {
2122
2124
if (Node->getDeclKind () != DeclKind::Constructor) {
2123
2125
Node->emitDiag (Added->getLoc (), diag::moved_decl,
2124
- Ctx.buffer ((Twine (getDeclKindStr (Added->getDeclKind ())) + " " +
2126
+ Ctx.buffer ((Twine (getDeclKindStr (Added->getDeclKind (),
2127
+ Ctx.getOpts ().CompilerStyle )) + " " +
2125
2128
Added->getFullyQualifiedName ()).str ()));
2126
2129
return ;
2127
2130
}
@@ -2133,7 +2136,8 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
2133
2136
[&](TypeMemberDiffItem &Item) { return Item.usr == Node->getUsr (); });
2134
2137
if (It != MemberChanges.end ()) {
2135
2138
Node->emitDiag (SourceLoc (), diag::renamed_decl,
2136
- Ctx.buffer ((Twine (getDeclKindStr (Node->getDeclKind ())) + " " +
2139
+ Ctx.buffer ((Twine (getDeclKindStr (Node->getDeclKind (),
2140
+ Ctx.getOpts ().CompilerStyle )) + " " +
2137
2141
It->newTypeName + " ." + It->newPrintedName ).str ()));
2138
2142
return ;
2139
2143
}
@@ -2190,7 +2194,8 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
2190
2194
DiagLoc = CD->getLoc ();
2191
2195
}
2192
2196
Node->emitDiag (DiagLoc, diag::renamed_decl,
2193
- Ctx.buffer ((Twine (getDeclKindStr (Node->getDeclKind ())) + " " +
2197
+ Ctx.buffer ((Twine (getDeclKindStr (Node->getDeclKind (),
2198
+ Ctx.getOpts ().CompilerStyle )) + " " +
2194
2199
Node->getAnnotateComment (NodeAnnotation::RenameNewName)).str ()));
2195
2200
return ;
2196
2201
}
@@ -2701,6 +2706,8 @@ static CheckerOptions getCheckOpts(int argc, char *argv[]) {
2701
2706
// the checking logics are language-specific.
2702
2707
Opts.SwiftOnly = options::Abi || options::SwiftOnly;
2703
2708
Opts.SkipOSCheck = options::DisableOSChecks;
2709
+ Opts.CompilerStyle = options::CompilerStyleDiags ||
2710
+ !options::SerializedDiagPath.empty ();
2704
2711
for (int i = 1 ; i < argc; ++i)
2705
2712
Opts.ToolArgs .push_back (argv[i]);
2706
2713
0 commit comments