@@ -3266,6 +3266,8 @@ class DiagnosisEmitter : public SDKNodeVisitor {
3266
3266
llvm::outs () << " */\n " ;
3267
3267
removeRedundantAndSort (Diags);
3268
3268
std::for_each (Diags.begin (), Diags.end (), [](T &Diag) {
3269
+ if (Diag.isABISpecific () && !options::Abi)
3270
+ return ;
3269
3271
Diag.outputModule ();
3270
3272
Diag.output ();
3271
3273
});
@@ -3275,12 +3277,15 @@ class DiagnosisEmitter : public SDKNodeVisitor {
3275
3277
struct MetaInfo {
3276
3278
StringRef ModuleName;
3277
3279
StringRef HeaderName;
3278
- MetaInfo (const SDKNodeDecl *Node):
3279
- ModuleName (Node->getModuleName ()), HeaderName(Node->getHeaderName ()) {}
3280
+ bool IsABISpecific;
3281
+ MetaInfo (const SDKNodeDecl *Node, bool IsABISpecific = false ):
3282
+ ModuleName (Node->getModuleName ()), HeaderName(Node->getHeaderName ()),
3283
+ IsABISpecific(IsABISpecific) {}
3280
3284
};
3281
3285
3282
- struct DiagBase {
3286
+ class DiagBase {
3283
3287
MetaInfo Info;
3288
+ public:
3284
3289
DiagBase (MetaInfo Info): Info(Info) {}
3285
3290
virtual ~DiagBase () = default ;
3286
3291
void outputModule () const {
@@ -3292,6 +3297,7 @@ class DiagnosisEmitter : public SDKNodeVisitor {
3292
3297
}
3293
3298
}
3294
3299
virtual void output () const = 0;
3300
+ bool isABISpecific () const { return Info.IsABISpecific ; }
3295
3301
};
3296
3302
3297
3303
struct RemovedDeclDiag : public DiagBase {
@@ -3535,9 +3541,9 @@ void DiagnosisEmitter::diagnosis(NodePtr LeftRoot, NodePtr RightRoot,
3535
3541
void DiagnosisEmitter::handle (const SDKNodeDecl *Node, NodeAnnotation Anno) {
3536
3542
assert (Node->isAnnotatedAs (Anno));
3537
3543
auto &Ctx = Node->getSDKContext ();
3538
- MetaInfo ScreenInfo (Node);
3539
3544
switch (Anno) {
3540
3545
case NodeAnnotation::Removed: {
3546
+ MetaInfo ScreenInfo (Node, false );
3541
3547
// If we can find a type alias decl with the same name of this type, we
3542
3548
// consider the type is not removed.
3543
3549
if (findTypeAliasDecl (Node))
@@ -3599,6 +3605,7 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
3599
3605
return ;
3600
3606
}
3601
3607
case NodeAnnotation::Rename: {
3608
+ MetaInfo ScreenInfo (Node, false );
3602
3609
auto *Count = UpdateMap.findUpdateCounterpart (Node)->getAs <SDKNodeDecl>();
3603
3610
RenamedDecls.Diags .emplace_back (ScreenInfo,
3604
3611
Node->getDeclKind (), Count->getDeclKind (),
@@ -3607,27 +3614,31 @@ void DiagnosisEmitter::handle(const SDKNodeDecl *Node, NodeAnnotation Anno) {
3607
3614
return ;
3608
3615
}
3609
3616
case NodeAnnotation::NowMutating: {
3617
+ MetaInfo ScreenInfo (Node, false );
3610
3618
AttrChangedDecls.Diags .emplace_back (ScreenInfo,
3611
3619
Node->getDeclKind (),
3612
3620
Node->getFullyQualifiedName (),
3613
3621
Ctx.buffer (" mutating" ));
3614
3622
return ;
3615
3623
}
3616
3624
case NodeAnnotation::NowThrowing: {
3625
+ MetaInfo ScreenInfo (Node, false );
3617
3626
AttrChangedDecls.Diags .emplace_back (ScreenInfo,
3618
3627
Node->getDeclKind (),
3619
3628
Node->getFullyQualifiedName (),
3620
3629
Ctx.buffer (" throwing" ));
3621
3630
return ;
3622
3631
}
3623
3632
case NodeAnnotation::StaticChange: {
3633
+ MetaInfo ScreenInfo (Node, false );
3624
3634
AttrChangedDecls.Diags .emplace_back (ScreenInfo,
3625
3635
Node->getDeclKind (),
3626
3636
Node->getFullyQualifiedName (),
3627
3637
Ctx.buffer (Node->isStatic () ? " not static" : " static" ));
3628
3638
return ;
3629
3639
}
3630
3640
case NodeAnnotation::OwnershipChange: {
3641
+ MetaInfo ScreenInfo (Node, false );
3631
3642
auto getOwnershipDescription = [&](swift::ReferenceOwnership O) {
3632
3643
if (O == ReferenceOwnership::Strong)
3633
3644
return Ctx.buffer (" strong" );
@@ -3692,7 +3703,7 @@ void DiagnosisEmitter::visit(NodePtr Node) {
3692
3703
}
3693
3704
}
3694
3705
3695
- typedef std::vector<NoEscapeFuncParam> NoEscapeFuncParamVector;
3706
+ typedef std::vector<NoEscapeFuncParam> NoEscapeFuncParamVector;
3696
3707
3697
3708
class NoEscapingFuncEmitter : public SDKNodeVisitor {
3698
3709
NoEscapeFuncParamVector &AllItems;
0 commit comments