File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -2186,6 +2186,12 @@ void Serializer::writeDeclAttribute(const DeclAttribute *DA) {
2186
2186
if (DA->isNotSerialized ())
2187
2187
return ;
2188
2188
2189
+ // Ignore attributes that have been marked invalid. (This usually means
2190
+ // type-checking removed them, but only provided a warning rather than an
2191
+ // error.)
2192
+ if (DA->isInvalid ())
2193
+ return ;
2194
+
2189
2195
switch (DA->getKind ()) {
2190
2196
case DAK_RawDocComment:
2191
2197
case DAK_ReferenceOwnership: // Serialized as part of the type.
Original file line number Diff line number Diff line change
1
+ // RUN: %empty-directory(%t)
2
+ // RUN: %target-swift-frontend -emit-module -o %t/attr.swiftmodule %s -verify
3
+ // RUN: llvm-bcanalyzer -dump %t/attr.swiftmodule | %FileCheck -check-prefix=CHECK-NON-RESILIENT %s
4
+ // RUN: %target-swift-frontend -emit-module -o %t/attr_resilient.swiftmodule -enable-resilience -warnings-as-errors %s
5
+ // RUN: llvm-bcanalyzer -dump %t/attr_resilient.swiftmodule | %FileCheck -check-prefix=CHECK-RESILIENT %s
6
+
7
+ // These two should be checking for the same thing.
8
+ // CHECK-RESILIENT: Frozen_DECL_ATTR
9
+ // CHECK-NON-RESILIENT-NOT: Frozen_DECL_ATTR
10
+
11
+ @_frozen // expected-warning {{@_frozen has no effect without -enable-resilience}}
12
+ public enum SomeEnum {
13
+ case x
14
+ }
Original file line number Diff line number Diff line change 1
1
// RUN: %empty-directory(%t.mod)
2
2
// RUN: %empty-directory(%t.sdk)
3
3
// RUN: %empty-directory(%t.module-cache)
4
- // RUN: %swift -emit-module -o %t.mod/cake1.swiftmodule %S/Inputs/cake1.swift -parse-as-library -I %S/Inputs/APINotesLeft %clang-importer-sdk-nosource
5
- // RUN: %swift -emit-module -o %t.mod/cake2.swiftmodule %S/Inputs/cake2.swift -parse-as-library -I %S/Inputs/APINotesRight %clang-importer-sdk-nosource
4
+ // RUN: %swift -emit-module -o %t.mod/cake1.swiftmodule %S/Inputs/cake1.swift -parse-as-library -enable-resilience - I %S/Inputs/APINotesLeft %clang-importer-sdk-nosource
5
+ // RUN: %swift -emit-module -o %t.mod/cake2.swiftmodule %S/Inputs/cake2.swift -parse-as-library -enable-resilience - I %S/Inputs/APINotesRight %clang-importer-sdk-nosource
6
6
// RUN: %api-digester -dump-sdk -module cake1 -o %t.dump1.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod -I %S/Inputs/APINotesLeft
7
7
// RUN: %api-digester -dump-sdk -module cake2 -o %t.dump2.json -module-cache-path %t.module-cache %clang-importer-sdk-nosource -I %t.mod -I %S/Inputs/APINotesRight
8
8
// RUN: %api-digester -diagnose-sdk -print-module --input-paths %t.dump1.json -input-paths %t.dump2.json > %t.result
You can’t perform that action at this time.
0 commit comments