[PATCH] D88289: [lldb][NFC] Fix some invalid escapes sequences in Python strings

Raphael Isemann via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 13 07:04:51 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rG777df5c93da8: [lldb][NFC] Fix some invalid escapes sequences in Python strings (authored by teemperor).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88289/new/

https://reviews.llvm.org/D88289

Files:
  llvm/utils/lit/lit/TestRunner.py
  llvm/utils/lit/lit/llvm/config.py


Index: llvm/utils/lit/lit/llvm/config.py
===================================================================
--- llvm/utils/lit/lit/llvm/config.py
+++ llvm/utils/lit/lit/llvm/config.py
@@ -439,7 +439,7 @@
         self.config.substitutions.append(
             (' clang ', """\"*** Do not use 'clang' in tests, use '%clang'. ***\""""))
         self.config.substitutions.append(
-            (' clang\+\+ ', """\"*** Do not use 'clang++' in tests, use '%clangxx'. ***\""""))
+            (r' clang\+\+ ', """\"*** Do not use 'clang++' in tests, use '%clangxx'. ***\""""))
         self.config.substitutions.append(
             (' clang-cc ',
              """\"*** Do not use 'clang-cc' in tests, use '%clang_cc1'. ***\""""))
@@ -494,11 +494,11 @@
         was_found = ld_lld and lld_link and ld64_lld and wasm_ld
         tool_substitutions = []
         if ld_lld:
-            tool_substitutions.append(ToolSubst('ld\.lld', command=ld_lld))
+            tool_substitutions.append(ToolSubst(r'ld\.lld', command=ld_lld))
         if lld_link:
             tool_substitutions.append(ToolSubst('lld-link', command=lld_link))
         if ld64_lld:
-            tool_substitutions.append(ToolSubst('ld64\.lld', command=ld64_lld))
+            tool_substitutions.append(ToolSubst(r'ld64\.lld', command=ld64_lld))
         if wasm_ld:
             tool_substitutions.append(ToolSubst('wasm-ld', command=wasm_ld))
         self.add_tool_substitutions(tool_substitutions)
Index: llvm/utils/lit/lit/TestRunner.py
===================================================================
--- llvm/utils/lit/lit/TestRunner.py
+++ llvm/utils/lit/lit/TestRunner.py
@@ -1105,8 +1105,8 @@
     # "%{/[STpst]:regex_replacement}" should be normalized like "%/[STpst]" but we're
     # also in a regex replacement context of a s@@@ regex.
     def regex_escape(s):
-        s = s.replace('@', '\@')
-        s = s.replace('&', '\&')
+        s = s.replace('@', r'\@')
+        s = s.replace('&', r'\&')
         return s
     substitutions.extend([
             ('%{/s:regex_replacement}',


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D88289.297851.patch
Type: text/x-patch
Size: 2068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201013/56b829c6/attachment.bin>


More information about the llvm-commits mailing list