Skip to content

Commit 606356c

Browse files
committed
Change SIL box mangling prefix to Xb.
Now that we start with 'X', we can use 'b' for box. Suggested by @jrose-apple.
1 parent 8ec7dec commit 606356c

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

lib/AST/Mangle.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ void Mangler::mangleAssociatedTypeName(DependentMemberType *dmt,
881881
/// <type> ::= Xo <type> # unowned reference type
882882
/// <type> ::= Xw <type> # weak reference type
883883
/// <type> ::= XF <impl-function-type> # SIL function type
884-
/// <type> ::= XH <type> # SIL @box type
884+
/// <type> ::= Xb <type> # SIL @box type
885885
///
886886
/// <index> ::= _ # 0
887887
/// <index> ::= <natural> _ # N+1
@@ -1395,7 +1395,7 @@ void Mangler::mangleType(Type type, ResilienceExpansion explosion,
13951395
}
13961396

13971397
case TypeKind::SILBox:
1398-
Buffer << 'X' << 'H';
1398+
Buffer << 'X' << 'b';
13991399
mangleType(cast<SILBoxType>(tybase)->getBoxedType(), explosion,
14001400
uncurryLevel);
14011401
return;

lib/Basic/Demangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1884,7 +1884,7 @@ class Demangler {
18841884
return type_application;
18851885
}
18861886
if (c == 'X') {
1887-
if (Mangled.nextIf('H')) {
1887+
if (Mangled.nextIf('b')) {
18881888
NodePointer type = demangleType();
18891889
if (!type)
18901890
return nullptr;

lib/Basic/Remangle.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ void Remangler::mangleErrorType(Node *node) {
11611161
}
11621162

11631163
void Remangler::mangleSILBoxType(Node *node) {
1164-
Out << 'X' << 'H';
1164+
Out << 'X' << 'b';
11651165
mangleSingleChildNode(node);
11661166
}
11671167

test/SILOptimizer/closure_specialize.sil

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ bb3:
226226
// Ensure that we can specialize and properly mangle functions that take closures with @box arguments.
227227

228228

229-
// CHECK-LABEL: sil shared [noinline] @_TTSf1n_cl25closure_with_box_argumentXHBi32____TF4main5innerFTRVs5Int32FS0_T__T_ : $@convention(thin) (@inout Builtin.Int32, @owned @box Builtin.Int32) -> ()
229+
// CHECK-LABEL: sil shared [noinline] @_TTSf1n_cl25closure_with_box_argumentXbBi32____TF4main5innerFTRVs5Int32FS0_T__T_ : $@convention(thin) (@inout Builtin.Int32, @owned @box Builtin.Int32) -> ()
230230
// CHECK: bb0
231231
// CHECK: [[FN:%.*]] = function_ref @closure_with_box_argument
232232
// CHECK: [[PARTIAL:%.*]] = partial_apply [[FN]](%1)

0 commit comments

Comments
 (0)