def GeneratePrologue(self):
- self.implementationContent += """
+ self.implementationContent += r"""
/*===- Generated file -------------------------------------------*- C++ -*-===*\
|* *|
|* Introspection of available AST node SourceLocations *|
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,
)
)
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, ""))
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, ""))
injecting additional Lit output around it.
"""
parsed = ''
- for output in re.split('[$]\s*":"\s*"RUN: at line \d+"', fullOutput):
+ for output in re.split(r'[$]\s*":"\s*"RUN: at line \d+"', fullOutput):
if output: # skip blank lines
commandOutput = re.search("# command output:\n(.+)\n$", output, flags=re.DOTALL)
if commandOutput:
),
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)),
],
),
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,
],
),
),
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")
def quote_windows_command(seq):
- """
+ r"""
Reimplement Python's private subprocess.list2cmdline for MSys compatibility
Based on CPython implementation here:
return cond, ln
def tryParseElse(ln):
- match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
+ match = _caching_re_compile(r"^\s*%else\s*(%{)?").search(ln)
if not match:
return False, ln
if not match.group(1):