Skip to content

Commit dae4f20

Browse files
committed
Basic: add a comment about the "complex" code
This addresses comments from Joe to document the special behaviour that we do in the `addSubsitution` functions which cause a subtle failure on Windows.
1 parent 43d2904 commit dae4f20

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/swift/Basic/Mangler.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,11 @@ class Mangler {
123123
/// Appends a mangled identifier string.
124124
void appendIdentifier(StringRef ident);
125125

126+
// NOTE: the addSubsitution functions perform the value computation before
127+
// the assignment because there is no sequence point synchronising the
128+
// computation of the value before the insertion of the new key, resulting in
129+
// the computed value being off-by-one causing an undecoration failure during
130+
// round-tripping.
126131
void addSubstitution(const void *ptr) {
127132
if (!UseSubstitutions)
128133
return;

0 commit comments

Comments
 (0)