[llvm] r333894 - [llvm-mca][UpdateTestChecks] Prevent an IndexError being raised when given empty input
Greg Bedwell via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 4 05:30:10 PDT 2018
Author: gbedwell
Date: Mon Jun 4 05:30:10 2018
New Revision: 333894
URL: http://llvm.org/viewvc/llvm-project?rev=333894&view=rev
Log:
[llvm-mca][UpdateTestChecks] Prevent an IndexError being raised when given empty input
Modified:
llvm/trunk/utils/update_mca_test_checks.py
Modified: llvm/trunk/utils/update_mca_test_checks.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/update_mca_test_checks.py?rev=333894&r1=333893&r2=333894&view=diff
==============================================================================
--- llvm/trunk/utils/update_mca_test_checks.py (original)
+++ llvm/trunk/utils/update_mca_test_checks.py Mon Jun 4 05:30:10 2018
@@ -409,7 +409,7 @@ def _write_output(test_path, input_lines
continue
# Add a blank line before the new checks if required.
- if output_lines[-1]:
+ if len(output_lines) > 0 and output_lines[-1]:
output_lines.append('')
output_check_lines = []
More information about the llvm-commits
mailing list