Skip to content

Commit 18669a0

Browse files
Merge pull request #78044 from AnthonyLatsis/nelumbo-nucifera
ASTDumper: Do not escape Unicode chars in quoted fields
2 parents 0dfca46 + 1001c46 commit 18669a0

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

lib/AST/ASTDumper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "swift/Basic/Defer.h"
3333
#include "swift/Basic/QuotedString.h"
3434
#include "swift/Basic/STLExtras.h"
35+
#include "swift/Basic/StringExtras.h"
3536
#include "clang/AST/Type.h"
3637
#include "llvm/ADT/APFloat.h"
3738
#include "llvm/ADT/SmallString.h"
@@ -181,7 +182,7 @@ class escaping_ostream : public raw_ostream {
181182

182183
private:
183184
virtual void write_impl(const char *Ptr, size_t Size) override {
184-
base_os.write_escaped(StringRef(Ptr, Size), /*UseHexEscapes=*/true);
185+
writeEscaped(StringRef(Ptr, Size), base_os);
185186
}
186187

187188
virtual uint64_t current_pos() const override {

test/Generics/minimal_conformances_compare_concrete.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ struct G<X> {}
1414
// CHECK-NEXT: Generic signature: <X where X == Derived>
1515
extension G where X : Base, X : P, X == Derived {}
1616

17-
// RULE: + (requirement "\xCF\x84_0_0" subclass_of "Base")
18-
// RULE: + (requirement "\xCF\x84_0_0" conforms_to "P")
19-
// RULE: + (requirement "\xCF\x84_0_0" same_type "Derived")
17+
// RULE: + (requirement "τ_0_0" subclass_of "Base")
18+
// RULE: + (requirement "τ_0_0" conforms_to "P")
19+
// RULE: + (requirement "τ_0_0" same_type "Derived")
2020

2121
// RULE: Rewrite system: {
2222
// RULE-NEXT: - [Copyable].[Copyable] => [Copyable] [permanent]

test/Parse/raw_string.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ _ = ##"""
7777
/// passes again.
7878
/// See https://github.com/apple/swift/issues/51192.
7979
_ = #"​"​"#
80-
// CHECK: "\xE2\x80\x8B\"\xE2\x80\x8B"
80+
// CHECK: "​\"​"
8181

8282
_ = #""""#
8383
// CHECK: "\"\""

unittests/AST/ASTDumperTests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ TEST(ASTDumper, ArchetypeType) {
5252
}
5353

5454
EXPECT_EQ(str,
55-
" name=\"\\xCF\\x84_0_0\"\n"
55+
" name=\"τ_0_0\"\n"
5656
" (interface_type=generic_type_param_type depth=0 index=0 param_kind=type))\n");
5757
}

0 commit comments

Comments
 (0)