Skip to content

Commit 8dad141

Browse files
committed
AST: Promote Extern feature to baseline.
1 parent 365d26e commit 8dad141

File tree

4 files changed

+4
-28
lines changed

4 files changed

+4
-28
lines changed

include/swift/Basic/Features.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ SUPPRESSIBLE_LANGUAGE_FEATURE(RetroactiveAttribute, 364, "@retroactive")
185185
SUPPRESSIBLE_LANGUAGE_FEATURE(ExtensionMacroAttr, 0, "@attached(extension)")
186186
BASELINE_LANGUAGE_FEATURE(TypedThrows, 413, "Typed throws")
187187
CONDITIONALLY_SUPPRESSIBLE_LANGUAGE_FEATURE(OptionalIsolatedParameters, 420, "Optional isolated parameters")
188-
SUPPRESSIBLE_LANGUAGE_FEATURE(Extern, 0, "@_extern")
188+
BASELINE_LANGUAGE_FEATURE(Extern, 0, "@_extern")
189189
BASELINE_LANGUAGE_FEATURE(ExpressionMacroDefaultArguments, 422, "Expression macro as caller-side default argument")
190190
LANGUAGE_FEATURE(BuiltinStoreRaw, 0, "Builtin.storeRaw")
191191
BASELINE_LANGUAGE_FEATURE(BuiltinCreateTask, 0, "Builtin.createTask and Builtin.createDiscardingTask")

lib/AST/ASTPrinter.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3051,14 +3051,6 @@ static void suppressingFeatureRetroactiveAttribute(
30513051
action();
30523052
}
30533053

3054-
static void suppressingFeatureExtern(PrintOptions &options,
3055-
llvm::function_ref<void()> action) {
3056-
unsigned originalExcludeAttrCount = options.ExcludeAttrList.size();
3057-
options.ExcludeAttrList.push_back(DeclAttrKind::Extern);
3058-
action();
3059-
options.ExcludeAttrList.resize(originalExcludeAttrCount);
3060-
}
3061-
30623054
static void suppressingFeatureIsolatedAny(PrintOptions &options,
30633055
llvm::function_ref<void()> action) {
30643056
llvm::SaveAndRestore<bool> scope(options.SuppressIsolatedAny, true);

lib/AST/FeatureSet.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,10 +171,6 @@ static bool usesFeatureOptionalIsolatedParameters(Decl *decl) {
171171
return false;
172172
}
173173

174-
static bool usesFeatureExtern(Decl *decl) {
175-
return decl->getAttrs().hasAttribute<ExternAttr>();
176-
}
177-
178174
static bool usesFeatureAssociatedTypeImplements(Decl *decl) {
179175
return isa<TypeDecl>(decl) && decl->getAttrs().hasAttribute<ImplementsAttr>();
180176
}

test/ModuleInterface/extern_attr.swift

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,11 @@
44
// RUN: %target-swift-typecheck-module-from-interface(%t/Library.swiftinterface) -module-name Library
55
// RUN: %FileCheck %s < %t/Library.swiftinterface
66

7-
// CHECK: #if compiler(>=5.3) && $Extern
8-
// CHECK-NEXT: @_extern(c) public func externalCFunc()
9-
// CHECK-NEXT: #else
10-
// CHECK-NEXT: public func externalCFunc()
11-
// CHECK-NEXT: #endif
7+
// CHECK: @_extern(c) public func externalCFunc()
128
@_extern(c) public func externalCFunc()
139

14-
// CHECK: #if compiler(>=5.3) && $Extern
15-
// CHECK-NEXT: @_extern(c, "renamedCFunc") public func externalRenamedCFunc()
16-
// CHECK-NEXT: #else
17-
// CHECK-NEXT: public func externalRenamedCFunc()
18-
// CHECK-NEXT: #endif
10+
// CHECK: @_extern(c, "renamedCFunc") public func externalRenamedCFunc()
1911
@_extern(c, "renamedCFunc") public func externalRenamedCFunc()
2012

21-
// CHECK: #if compiler(>=5.3) && $Extern
22-
// CHECK-NEXT: @_extern(wasm, module: "m", name: "f") public func wasmImportedFunc()
23-
// CHECK-NEXT: #else
24-
// CHECK-NEXT: public func wasmImportedFunc()
25-
// CHECK-NEXT: #endif
13+
// CHECK: @_extern(wasm, module: "m", name: "f") public func wasmImportedFunc()
2614
@_extern(wasm, module: "m", name: "f") public func wasmImportedFunc()

0 commit comments

Comments
 (0)