File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -299,6 +299,17 @@ void TBDGenVisitor::visitProtocolDecl(ProtocolDecl *PD) {
299
299
#endif
300
300
}
301
301
302
+ void TBDGenVisitor::visitEnumDecl (EnumDecl *ED) {
303
+ if (!ED->isResilient (SwiftModule, ResilienceExpansion::Minimal))
304
+ return ;
305
+
306
+ // Emit resilient tags.
307
+ for (auto *elt : ED->getAllElements ()) {
308
+ auto entity = LinkEntity::forEnumCase (elt);
309
+ addSymbol (entity);
310
+ }
311
+ }
312
+
302
313
static void enumeratePublicSymbolsAndWrite (ModuleDecl *M, FileUnit *singleFile,
303
314
StringSet &symbols,
304
315
bool hasMultipleIGMs,
Original file line number Diff line number Diff line change @@ -100,6 +100,8 @@ class TBDGenVisitor : public ASTVisitor<TBDGenVisitor> {
100
100
101
101
void visitVarDecl (VarDecl *VD);
102
102
103
+ void visitEnumDecl (EnumDecl *ED);
104
+
103
105
void visitDecl (Decl *D) {}
104
106
};
105
107
} // end namespace tbdgen
Original file line number Diff line number Diff line change
1
+ // RUN: %target-swift-frontend -emit-ir -o- -parse-as-library -module-name test -validate-tbd-against-ir=missing %s
2
+ // RUN: %target-swift-frontend -enable-resilience -emit-ir -o- -parse-as-library -module-name test -validate-tbd-against-ir=missing %s
3
+
4
+ class C {
5
+ }
6
+
7
+ enum SinglePayload {
8
+ case A
9
+ case B( C )
10
+ case D
11
+ }
12
+
13
+ enum MultiPayload {
14
+ case A
15
+ case B( C )
16
+ case D( C )
17
+ }
You can’t perform that action at this time.
0 commit comments