[llvm] r343782 - [utils] simple refactor in update_mca_test_checks.py to make intent more readable
Greg Bedwell via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 4 07:42:07 PDT 2018
Author: gbedwell
Date: Thu Oct 4 07:42:06 2018
New Revision: 343782
URL: http://llvm.org/viewvc/llvm-project?rev=343782&view=rev
Log:
[utils] simple refactor in update_mca_test_checks.py to make intent more readable
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=343782&r1=343781&r2=343782&view=diff
==============================================================================
--- llvm/trunk/utils/update_mca_test_checks.py (original)
+++ llvm/trunk/utils/update_mca_test_checks.py Thu Oct 4 07:42:06 2018
@@ -492,21 +492,20 @@ def _write_output(test_path, input_lines
output_check_lines = []
used_prefixes = set()
for block_num in range(len(block_infos)):
- for block_text in sorted(block_infos[block_num]):
- if not block_text:
- continue
+ if type(block_infos[block_num]) is list:
+ # The block is of the type output from _break_down_block().
+ used_prefixes |= _write_block(output_check_lines,
+ block_infos[block_num],
+ not_prefix_set,
+ common_prefix,
+ prefix_pad)
+ else:
+ # _break_down_block() was unable to do do anything so output the block
+ # as-is.
+ for block_text in sorted(block_infos[block_num]):
+ if not block_text:
+ continue
- if type(block_infos[block_num]) is list:
- # The block is of the type output from _break_down_block().
- used_prefixes |= _write_block(output_check_lines,
- block_infos[block_num],
- not_prefix_set,
- common_prefix,
- prefix_pad)
- break
- elif block_infos[block_num][block_text]:
- # _break_down_block() was unable to do do anything so output the block
- # as-is.
lines = block_text.split('\n')
for prefix in block_infos[block_num][block_text]:
used_prefixes |= _write_block(output_check_lines,
More information about the llvm-commits
mailing list