[llvm] 2dad717 - [UpdateTestChecks] Fix invalid python string escapes

Alex Richardson via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 30 02:36:34 PDT 2019


Author: Alex Richardson
Date: 2019-10-30T09:36:20Z
New Revision: 2dad717c9af5056d0e4cfab0ced2831c03dfaf71

URL: https://github.com/llvm/llvm-project/commit/2dad717c9af5056d0e4cfab0ced2831c03dfaf71
DIFF: https://github.com/llvm/llvm-project/commit/2dad717c9af5056d0e4cfab0ced2831c03dfaf71.diff

LOG: [UpdateTestChecks] Fix invalid python string escapes

Added: 
    

Modified: 
    llvm/utils/UpdateTestChecks/common.py

Removed: 
    


################################################################################
diff  --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index 972b65505b45..b521e16c1644 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -45,8 +45,8 @@ def invoke_tool(exe, cmd_args, ir):
 
 ##### LLVM IR parser
 
-RUN_LINE_RE = re.compile('^\s*[;#]\s*RUN:\s*(.*)$')
-CHECK_PREFIX_RE = re.compile('--?check-prefix(?:es)?[= ](\S+)')
+RUN_LINE_RE = re.compile(r'^\s*[;#]\s*RUN:\s*(.*)$')
+CHECK_PREFIX_RE = re.compile(r'--?check-prefix(?:es)?[= ](\S+)')
 PREFIX_RE = re.compile('^[a-zA-Z0-9_-]+$')
 CHECK_RE = re.compile(r'^\s*[;#]\s*([^:]+?)(?:-NEXT|-NOT|-DAG|-LABEL)?:')
 
@@ -60,7 +60,7 @@ def invoke_tool(exe, cmd_args, ir):
     r'\s*\n(?P<body>.*)$',
     flags=(re.X | re.S))
 
-IR_FUNCTION_RE = re.compile('^\s*define\s+(?:internal\s+)?[^@]*@(\w+)\s*\(')
+IR_FUNCTION_RE = re.compile(r'^\s*define\s+(?:internal\s+)?[^@]*@(\w+)\s*\(')
 TRIPLE_IR_RE = re.compile(r'^\s*target\s+triple\s*=\s*"([^"]+)"$')
 TRIPLE_ARG_RE = re.compile(r'-mtriple[= ]([^ ]+)')
 MARCH_ARG_RE = re.compile(r'-march[= ]([^ ]+)')


        


More information about the llvm-commits mailing list