aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/update_test_checks.py
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2016-03-27 20:43:02 +0000
committerSanjay Patel <spatel@rotateright.com>2016-03-27 20:43:02 +0000
commitd859271d5d7c8b9f105a2163a8272f9072aa50b6 (patch)
treeea1be4df8e1c44cc8bfc66c60775e8cb08685a28 /llvm/utils/update_test_checks.py
parent507d696cac837a37c8a1ca52a6daf91a53c7402e (diff)
downloadllvm-d859271d5d7c8b9f105a2163a8272f9072aa50b6.zip
llvm-d859271d5d7c8b9f105a2163a8272f9072aa50b6.tar.gz
llvm-d859271d5d7c8b9f105a2163a8272f9072aa50b6.tar.bz2
add scrubber for excessive leading whitespace
llvm-svn: 264542
Diffstat (limited to 'llvm/utils/update_test_checks.py')
-rwxr-xr-xllvm/utils/update_test_checks.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/utils/update_test_checks.py b/llvm/utils/update_test_checks.py
index f43d12c..e36af39 100755
--- a/llvm/utils/update_test_checks.py
+++ b/llvm/utils/update_test_checks.py
@@ -19,6 +19,7 @@ import re
# RegEx: this is where the magic happens.
+SCRUB_LEADING_WHITESPACE_RE = re.compile(r'^(\s+)')
SCRUB_WHITESPACE_RE = re.compile(r'(?!^(| \w))[ \t]+', flags=re.M)
SCRUB_TRAILING_WHITESPACE_RE = re.compile(r'[ \t]+$', flags=re.M)
SCRUB_X86_SHUFFLES_RE = (
@@ -321,6 +322,8 @@ def main():
if is_in_function:
if should_add_line_to_output(input_line, prefix_set) == True:
# This input line of the function body will go as-is into the output.
+ # Except make leading whitespace uniform: 2 spaces.
+ input_line = SCRUB_LEADING_WHITESPACE_RE.sub(r' ', input_line)
output_lines.append(input_line)
else:
continue