[llvm] c293107 - Fix line endings produced by update_cc_test_checks.py
Alex Richardson via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 14 07:18:37 PST 2020
Author: Alex Richardson
Date: 2020-02-14T15:17:27Z
New Revision: c29310707e9a85e70a226277657cd9d9182a5d04
URL: https://github.com/llvm/llvm-project/commit/c29310707e9a85e70a226277657cd9d9182a5d04
DIFF: https://github.com/llvm/llvm-project/commit/c29310707e9a85e70a226277657cd9d9182a5d04.diff
LOG: Fix line endings produced by update_cc_test_checks.py
Use the same appraoch as update_llc_test_checks.py to always write \n
line endings. This should fix the Windows buildbots.
Added:
Modified:
llvm/utils/update_cc_test_checks.py
Removed:
################################################################################
diff --git a/llvm/utils/update_cc_test_checks.py b/llvm/utils/update_cc_test_checks.py
index 21cc5b4e5e30..9b236dbd2431 100755
--- a/llvm/utils/update_cc_test_checks.py
+++ b/llvm/utils/update_cc_test_checks.py
@@ -292,10 +292,10 @@ def main():
False, args.function_signature)
output_lines.append(line.rstrip('\n'))
- # Update the test file.
- with open(filename, 'w') as f:
- for line in output_lines:
- f.write(line + '\n')
+
+ common.debug('Writing %d lines to %s...' % (len(output_lines), filename))
+ with open(filename, 'wb') as f:
+ f.writelines(['{}\n'.format(l).encode('utf-8') for l in output_lines])
return 0
More information about the llvm-commits
mailing list