Skip to content

Commit 6eb16f6

Browse files
committed
Revert "Clang importer: Global vars imported as static member properties are final." (#2155)
1 parent f679802 commit 6eb16f6

File tree

4 files changed

+0
-25
lines changed

4 files changed

+0
-25
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2797,11 +2797,6 @@ namespace {
27972797
Impl.importSourceLoc(decl->getLocation()),
27982798
name, type, dc);
27992799

2800-
// If imported as member, the member should be final.
2801-
if (dc->getAsClassOrClassExtensionContext())
2802-
result->getAttrs().add(new (Impl.SwiftContext)
2803-
FinalAttr(/*IsImplicit=*/true));
2804-
28052800
if (!decl->hasExternalStorage())
28062801
Impl.registerExternalDecl(result);
28072802

test/IDE/Inputs/custom-modules/ImportAsMemberC.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,3 @@ extern const CCPowerSupplyRef kCCPowerSupplySemiModular
2929

3030
#pragma clang arc_cf_code_audited end
3131

32-
extern const double kCCPowerSupplyDefaultPower
33-
__attribute__((swift_name("CCPowerSupply.defaultPower")));
34-
35-
extern const _Nonnull CCPowerSupplyRef kCCPowerSupplyAC
36-
__attribute__((swift_name("CCPowerSupply.AC")));
37-
38-
extern const _Nullable CCPowerSupplyRef kCCPowerSupplyDC
39-
__attribute__((swift_name("CCPowerSupply.DC")));

test/IDE/import_as_member_cf.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
// PRINTC: extension CCPowerSupply {
88
// PRINTC-NEXT: /*not inherited*/ init(watts watts: Double)
99
// PRINTC-NEXT: class let semiModular: CCPowerSupply!
10-
// PRINTC-NEXT: class let defaultPower: Double
11-
// PRINTC-NEXT: class let AC: CCPowerSupply
12-
// PRINTC-NEXT: class let DC: CCPowerSupply?
1310
// PRINTC-NEXT: }
1411

1512
// PRINTC: extension CCRefrigerator {

test/SILGen/cf_members.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,12 +251,3 @@ public func importAsProtocol(_ x: IAMProto_t) {
251251
// CHECK: function_ref @setSomeValue : $@convention(c) <τ_0_0 where τ_0_0 : IAMProto> (τ_0_0, Int32) -> Int32
252252
x.someValue = y
253253
}
254-
255-
// CHECK-LABEL: sil @_TF10cf_members28importGlobalVarsAsProperties
256-
public func importGlobalVarsAsProperties()
257-
-> (Double, CCPowerSupply, CCPowerSupply?) {
258-
// CHECK: global_addr @kCCPowerSupplyDC
259-
// CHECK: global_addr @kCCPowerSupplyAC
260-
// CHECK: global_addr @kCCPowerSupplyDefaultPower
261-
return (CCPowerSupply.defaultPower, CCPowerSupply.AC, CCPowerSupply.DC)
262-
}

0 commit comments

Comments
 (0)