Skip to content

Commit e919a83

Browse files
eleftgtru
authored andcommitted
eliminate python SyntaxWarnings from check-all output.
``` src_dir/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py:28: SyntaxWarning: invalid escape sequence '\*' self.implementationContent += """ src_dir/llvm/utils/lit/lit/TestRunner.py:205: SyntaxWarning: invalid escape sequence '\c' """ src_dir/llvm/utils/lit/lit/TestRunner.py:1561: SyntaxWarning: invalid escape sequence '\s' match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln) src_dir/libcxx/utils/libcxx/test/format.py:64: SyntaxWarning: invalid escape sequence '\s' for output in re.split('[$]\s*":"\s*"RUN: at line \d+"', fullOutput): src_dir/libcxx/utils/libcxx/test/params.py:121: SyntaxWarning: invalid escape sequence '\+' AddSubstitution("%{cxx_std}", re.sub("\+", "x", std)), src_dir/libcxx/utils/libcxx/test/params.py:214: SyntaxWarning: invalid escape sequence '\+' AddFeature("stdlib=libc++") if re.match(".+-libc\+\+", stdlib) else None, src_dir/compiler-rt/test/lit.common.cfg.py:800: SyntaxWarning: invalid escape sequence '\$' "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" src_dir/compiler-rt/test/lit.common.cfg.py:809: SyntaxWarning: invalid escape sequence '\$' "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix, src_dir/compiler-rt/test/lit.common.cfg.py:817: SyntaxWarning: invalid escape sequence '\$' "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix, src_dir/llvm/test/lit.cfg.py:275: SyntaxWarning: invalid escape sequence '\d' match = re.search("release (\d+)\.(\d+)", ptxas_out) ```
1 parent f6c231c commit e919a83

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, templateClasses):
2525

2626
def GeneratePrologue(self):
2727

28-
self.implementationContent += """
28+
self.implementationContent += r"""
2929
/*===- Generated file -------------------------------------------*- C++ -*-===*\
3030
|* *|
3131
|* Introspection of available AST node SourceLocations *|

compiler-rt/test/lit.common.cfg.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ def is_windows_lto_supported():
797797
config.substitutions.append(
798798
(
799799
"%ld_flags_rpath_exe" + postfix,
800-
"-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec"
800+
r"-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec"
801801
+ postfix,
802802
)
803803
)
@@ -806,15 +806,15 @@ def is_windows_lto_supported():
806806
config.substitutions.append(
807807
(
808808
"%ld_flags_rpath_exe" + postfix,
809-
"-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
809+
r"-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
810810
)
811811
)
812812
config.substitutions.append(("%ld_flags_rpath_so" + postfix, ""))
813813
elif config.host_os == "SunOS":
814814
config.substitutions.append(
815815
(
816816
"%ld_flags_rpath_exe" + postfix,
817-
"-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
817+
r"-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
818818
)
819819
)
820820
config.substitutions.append(("%ld_flags_rpath_so" + postfix, ""))

libcxx/utils/libcxx/test/format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _parseLitOutput(fullOutput):
6161
injecting additional Lit output around it.
6262
"""
6363
parsed = ''
64-
for output in re.split('[$]\s*":"\s*"RUN: at line \d+"', fullOutput):
64+
for output in re.split(r'[$]\s*":"\s*"RUN: at line \d+"', fullOutput):
6565
if output: # skip blank lines
6666
commandOutput = re.search("# command output:\n(.+)\n$", output, flags=re.DOTALL)
6767
if commandOutput:

libcxx/utils/libcxx/test/params.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def getModuleFlag(cfg, enable_modules):
118118
),
119119
actions=lambda std: [
120120
AddFeature(std),
121-
AddSubstitution("%{cxx_std}", re.sub("\+", "x", std)),
121+
AddSubstitution("%{cxx_std}", re.sub(r"\+", "x", std)),
122122
AddCompileFlag(lambda cfg: getStdFlag(cfg, std)),
123123
],
124124
),
@@ -211,7 +211,7 @@ def getModuleFlag(cfg, enable_modules):
211211
AddFeature("stdlib={}".format(stdlib)),
212212
# Also add an umbrella feature 'stdlib=libc++' for all flavors of libc++, to simplify
213213
# the test suite.
214-
AddFeature("stdlib=libc++") if re.match(".+-libc\+\+", stdlib) else None,
214+
AddFeature("stdlib=libc++") if re.match(r".+-libc\+\+", stdlib) else None,
215215
],
216216
),
217217
),

llvm/test/lit.cfg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def ptxas_version(ptxas):
272272
ptxas_cmd = subprocess.Popen([ptxas, "--version"], stdout=subprocess.PIPE)
273273
ptxas_out = ptxas_cmd.stdout.read().decode("ascii")
274274
ptxas_cmd.wait()
275-
match = re.search("release (\d+)\.(\d+)", ptxas_out)
275+
match = re.search(r"release (\d+)\.(\d+)", ptxas_out)
276276
if match:
277277
return (int(match.group(1)), int(match.group(2)))
278278
print("couldn't determine ptxas version")

llvm/utils/lit/lit/TestRunner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ def expand_glob_expressions(args, cwd):
202202

203203

204204
def quote_windows_command(seq):
205-
"""
205+
r"""
206206
Reimplement Python's private subprocess.list2cmdline for MSys compatibility
207207
208208
Based on CPython implementation here:
@@ -1558,7 +1558,7 @@ def tryParseIfCond(ln):
15581558
return cond, ln
15591559

15601560
def tryParseElse(ln):
1561-
match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
1561+
match = _caching_re_compile(r"^\s*%else\s*(%{)?").search(ln)
15621562
if not match:
15631563
return False, ln
15641564
if not match.group(1):

0 commit comments

Comments
 (0)