Skip to content

Commit 5b0b196

Browse files
author
git apple-llvm automerger
committed
Merge commit 'ae858b5123e8' from llvm.org/main into next
2 parents 318c8f7 + ae858b5 commit 5b0b196

File tree

3 files changed

+29
-21
lines changed

3 files changed

+29
-21
lines changed

libcxx/test/libcxx/transitive_includes.gen.py

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -33,35 +33,42 @@
3333
regenerate_expected_results = False
3434

3535
if regenerate_expected_results:
36-
print(f"""\
36+
print(
37+
f"""\
3738
//--- generate-transitive-includes.sh.cpp
3839
// RUN: mkdir %t
39-
""")
40+
"""
41+
)
4042

41-
all_traces = []
42-
for header in sorted(public_headers):
43-
if header.endswith('.h'): # Skip C compatibility or detail headers
44-
continue
43+
all_traces = []
44+
for header in sorted(public_headers):
45+
if header.endswith(".h"): # Skip C compatibility or detail headers
46+
continue
4547

46-
normalized_header = re.sub('/', '_', header)
47-
print(f"""\
48+
normalized_header = re.sub("/", "_", header)
49+
print(
50+
f"""\
4851
// RUN: echo "#include <{header}>" | %{{cxx}} -xc++ - %{{flags}} %{{compile_flags}} --trace-includes -fshow-skipped-includes --preprocess > /dev/null 2> %t/trace-includes.{normalized_header}.txt
49-
""")
50-
all_traces.append(f'%t/trace-includes.{normalized_header}.txt')
52+
"""
53+
)
54+
all_traces.append(f"%t/trace-includes.{normalized_header}.txt")
5155

52-
print(f"""\
56+
print(
57+
f"""\
5358
// RUN: %{{python}} %{{libcxx-dir}}/test/libcxx/transitive_includes_to_csv.py {' '.join(all_traces)} > %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv
54-
""")
59+
"""
60+
)
5561

5662
else:
57-
for header in public_headers:
58-
if header.endswith('.h'): # Skip C compatibility or detail headers
59-
continue
63+
for header in public_headers:
64+
if header.endswith(".h"): # Skip C compatibility or detail headers
65+
continue
6066

61-
# Escape slashes for the awk command below
62-
escaped_header = header.replace('/', '\/')
67+
# Escape slashes for the awk command below
68+
escaped_header = header.replace("/", "\\/")
6369

64-
print(f"""\
70+
print(
71+
f"""\
6572
//--- {header}.sh.cpp
6673
{lit_header_restrictions.get(header, '')}
6774
@@ -89,4 +96,5 @@
8996
// RUN: cat %{{libcxx-dir}}/test/libcxx/transitive_includes/%{{cxx_std}}.csv | awk '/^{escaped_header} / {{ print }}' > %t/expected_transitive_includes.csv
9097
// RUN: diff -w %t/expected_transitive_includes.csv %t/actual_transitive_includes.csv
9198
#include <{header}>
92-
""")
99+
"""
100+
)

libcxx/utils/generate_escaped_output_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def compactPropertyRanges(input: list[PropertyRange]) -> list[PropertyRange]:
131131
/// more details.
132132
133133
///
134-
/// \pre The code point is a valid Unicode code point.
134+
/// \\pre The code point is a valid Unicode code point.
135135
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr bool __needs_escape(const char32_t __code_point) noexcept {{
136136
137137
// The entries in the gap at the end.

libcxx/utils/generate_width_estimation_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def compactPropertyRanges(input: list[PropertyRange]) -> list[PropertyRange]:
155155
156156
/// Returns the estimated width of a Unicode code point.
157157
///
158-
/// \pre The code point is a valid Unicode code point.
158+
/// \\pre The code point is a valid Unicode code point.
159159
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr int __estimated_width(const char32_t __code_point) noexcept {{
160160
// Since __table_upper_bound contains the unshifted range do the
161161
// comparison without shifting.

0 commit comments

Comments
 (0)