-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix python SyntaxWarnings in check-all output #72538
Conversation
@llvm/pr-subscribers-clang Author: Georgios Eleftheriou (eleftg) Changesby converting the offending strings to raw @lattner Full diff: https://github.com/llvm/llvm-project/pull/72538.diff 4 Files Affected:
diff --git a/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py b/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
index dafb332961ede86..7671f9691c09610 100755
--- a/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
+++ b/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
@@ -25,7 +25,7 @@ def __init__(self, templateClasses):
def GeneratePrologue(self):
- self.implementationContent += """
+ self.implementationContent += r"""
/*===- Generated file -------------------------------------------*- C++ -*-===*\
|* *|
|* Introspection of available AST node SourceLocations *|
diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index 230efd580199cb6..7a91558d515420f 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -800,7 +800,7 @@ def is_windows_lto_supported():
config.substitutions.append(
(
"%ld_flags_rpath_exe" + postfix,
- "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec"
+ r"-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec"
+ postfix,
)
)
@@ -809,7 +809,7 @@ def is_windows_lto_supported():
config.substitutions.append(
(
"%ld_flags_rpath_exe" + postfix,
- "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
+ r"-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
)
)
config.substitutions.append(("%ld_flags_rpath_so" + postfix, ""))
@@ -817,7 +817,7 @@ def is_windows_lto_supported():
config.substitutions.append(
(
"%ld_flags_rpath_exe" + postfix,
- "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
+ r"-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
)
)
config.substitutions.append(("%ld_flags_rpath_so" + postfix, ""))
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index e31130572df6576..3fedbf972c0c822 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -114,7 +114,7 @@ def getStdFlag(cfg, std):
),
actions=lambda std: [
AddFeature(std),
- AddSubstitution("%{cxx_std}", re.sub("\+", "x", std)),
+ AddSubstitution("%{cxx_std}", re.sub(r"\+", "x", std)),
AddCompileFlag(lambda cfg: getStdFlag(cfg, std)),
],
),
@@ -187,7 +187,7 @@ def getStdFlag(cfg, std):
AddFeature("stdlib={}".format(stdlib)),
# Also add an umbrella feature 'stdlib=libc++' for all flavors of libc++, to simplify
# the test suite.
- AddFeature("stdlib=libc++") if re.match(".+-libc\+\+", stdlib) else None,
+ AddFeature("stdlib=libc++") if re.match(r".+-libc\+\+", stdlib) else None,
],
),
),
diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index f3b49a398e76062..8319093408020fc 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -271,7 +271,7 @@ def ptxas_version(ptxas):
ptxas_cmd = subprocess.Popen([ptxas, "--version"], stdout=subprocess.PIPE)
ptxas_out = ptxas_cmd.stdout.read().decode("ascii")
ptxas_cmd.wait()
- match = re.search("release (\d+)\.(\d+)", ptxas_out)
+ match = re.search(r"release (\d+)\.(\d+)", ptxas_out)
if match:
return (int(match.group(1)), int(match.group(2)))
print("couldn't determine ptxas version")
|
@llvm/pr-subscribers-libcxx Author: Georgios Eleftheriou (eleftg) Changesby converting the offending strings to raw @lattner Full diff: https://github.com/llvm/llvm-project/pull/72538.diff 4 Files Affected:
diff --git a/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py b/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
index dafb332961ede86..7671f9691c09610 100755
--- a/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
+++ b/clang/lib/Tooling/DumpTool/generate_cxx_src_locs.py
@@ -25,7 +25,7 @@ def __init__(self, templateClasses):
def GeneratePrologue(self):
- self.implementationContent += """
+ self.implementationContent += r"""
/*===- Generated file -------------------------------------------*- C++ -*-===*\
|* *|
|* Introspection of available AST node SourceLocations *|
diff --git a/compiler-rt/test/lit.common.cfg.py b/compiler-rt/test/lit.common.cfg.py
index 230efd580199cb6..7a91558d515420f 100644
--- a/compiler-rt/test/lit.common.cfg.py
+++ b/compiler-rt/test/lit.common.cfg.py
@@ -800,7 +800,7 @@ def is_windows_lto_supported():
config.substitutions.append(
(
"%ld_flags_rpath_exe" + postfix,
- "-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec"
+ r"-Wl,-z,origin -Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec"
+ postfix,
)
)
@@ -809,7 +809,7 @@ def is_windows_lto_supported():
config.substitutions.append(
(
"%ld_flags_rpath_exe" + postfix,
- "-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
+ r"-Wl,-rpath,\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
)
)
config.substitutions.append(("%ld_flags_rpath_so" + postfix, ""))
@@ -817,7 +817,7 @@ def is_windows_lto_supported():
config.substitutions.append(
(
"%ld_flags_rpath_exe" + postfix,
- "-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
+ r"-Wl,-R\$ORIGIN -L%T -l%xdynamiclib_namespec" + postfix,
)
)
config.substitutions.append(("%ld_flags_rpath_so" + postfix, ""))
diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py
index e31130572df6576..3fedbf972c0c822 100644
--- a/libcxx/utils/libcxx/test/params.py
+++ b/libcxx/utils/libcxx/test/params.py
@@ -114,7 +114,7 @@ def getStdFlag(cfg, std):
),
actions=lambda std: [
AddFeature(std),
- AddSubstitution("%{cxx_std}", re.sub("\+", "x", std)),
+ AddSubstitution("%{cxx_std}", re.sub(r"\+", "x", std)),
AddCompileFlag(lambda cfg: getStdFlag(cfg, std)),
],
),
@@ -187,7 +187,7 @@ def getStdFlag(cfg, std):
AddFeature("stdlib={}".format(stdlib)),
# Also add an umbrella feature 'stdlib=libc++' for all flavors of libc++, to simplify
# the test suite.
- AddFeature("stdlib=libc++") if re.match(".+-libc\+\+", stdlib) else None,
+ AddFeature("stdlib=libc++") if re.match(r".+-libc\+\+", stdlib) else None,
],
),
),
diff --git a/llvm/test/lit.cfg.py b/llvm/test/lit.cfg.py
index f3b49a398e76062..8319093408020fc 100644
--- a/llvm/test/lit.cfg.py
+++ b/llvm/test/lit.cfg.py
@@ -271,7 +271,7 @@ def ptxas_version(ptxas):
ptxas_cmd = subprocess.Popen([ptxas, "--version"], stdout=subprocess.PIPE)
ptxas_out = ptxas_cmd.stdout.read().decode("ascii")
ptxas_cmd.wait()
- match = re.search("release (\d+)\.(\d+)", ptxas_out)
+ match = re.search(r"release (\d+)\.(\d+)", ptxas_out)
if match:
return (int(match.group(1)), int(match.group(2)))
print("couldn't determine ptxas version")
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. @petrhosek might want to take a quick look at the compiler-rt part though.
By converting the offending strings to raw string literals.
By converting the offending strings to raw string literals.
by converting the offending strings to raw
@lattner