File tree Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Expand file tree Collapse file tree 2 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -3157,12 +3157,10 @@ std::optional<std::string> PrintAST::mangledNameToPrint(const Decl *D) {
3157
3157
return mangler.mangleConstructorEntity (init, /* isAllocating=*/ true );
3158
3158
}
3159
3159
3160
- // For global and static variables, mangle the entity directly.
3160
+ // For variables, mangle the entity directly.
3161
3161
if (auto var = dyn_cast<VarDecl>(D)) {
3162
- if (!var->isInstanceMember ()) {
3163
- ASTMangler mangler;
3164
- return mangler.mangleEntity (var);
3165
- }
3162
+ ASTMangler mangler;
3163
+ return mangler.mangleEntity (var);
3166
3164
}
3167
3165
3168
3166
// For subscripts, mangle the entity directly.
Original file line number Diff line number Diff line change 8
8
// CHECK-NEXT: public func intToString(_ value: Swift.Int) -> Swift.String
9
9
public func intToString( _ value: Int ) -> String { " \( value) " }
10
10
11
+ // CHECK: // MANGLED NAME: $s11ABIComments13globalCounterSivp
12
+ // CHECK-NEXT: @_hasInitialValue public var globalCounter: Swift.Int
13
+ public var globalCounter : Int = 23
14
+
11
15
// CHECK: // MANGLED NAME: $s11ABIComments8MyStructVMa
12
16
// CHECK-NEXT: public struct MyStruct {
13
17
public struct MyStruct {
14
18
// CHECK: // MANGLED NAME: $s11ABIComments8MyStructV6methodSiyF
15
19
// CHECK-NEXT: public func method() -> Swift.Int
16
20
public func method( ) -> Int { 5 }
21
+
22
+ // CHECK: // MANGLED NAME: $s11ABIComments8MyStructV7counterSivp
23
+ // CHECK-NEXT: @_hasInitialValue public var counter: Swift.Int
24
+ public var counter : Int = 23
25
+
26
+ // CHECK: // MANGLED NAME: $s11ABIComments8MyStructV11constantNumSivp
27
+ // CHECK-NEXT: @_hasInitialValue public let constantNum: Swift.Int
28
+ public let constantNum : Int = 23
29
+
30
+ // CHECK: // MANGLED NAME: $s11ABIComments8MyStructV9staticLetSivpZ
31
+ // CHECK-NEXT: @_hasInitialValue public static let staticLet: Swift.Int
32
+ public static let staticLet : Int = 23
33
+
34
+ // CHECK: // MANGLED NAME: $s11ABIComments8MyStructV8computedSivp
35
+ // CHECK-NEXT: public var computed: Swift.Int {
36
+ // CHECK-NEXT: // MANGLED NAME: $s11ABIComments8MyStructV8computedSivg
37
+ // CHECK-NEXT: get
38
+ // CHECK-NEXT: }
39
+ public var computed : Int {
40
+ 13
41
+ }
17
42
}
You can’t perform that action at this time.
0 commit comments