From 6f85ec960be44b09d471f8b93e01c22009ff5ed2 Mon Sep 17 00:00:00 2001 From: Kirill Naumov Date: Fri, 20 Mar 2020 15:26:30 +0000 Subject: [PATCH] [Tools] Fixed bug with llvm/utils/chunk-print-before-all.py script. Prior to the fix, the script was not annotating the first line of chunk-0.ll. Because of that, a compilation with ./bin/opt was failing. The extra if-statement ensures that the corner case is covered Reviewed-By: apilipenko Differential Revision: https://reviews.llvm.org/D76507 --- llvm/utils/chunk-print-before-all.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/llvm/utils/chunk-print-before-all.py b/llvm/utils/chunk-print-before-all.py index b036e380ef9f..d17bae85cdd3 100755 --- a/llvm/utils/chunk-print-before-all.py +++ b/llvm/utils/chunk-print-before-all.py @@ -24,9 +24,10 @@ def print_chunk(lines): is_dump = False cur = [] for line in sys.stdin: - if line.startswith("*** IR Dump Before ") and len(cur) != 0: - print_chunk(cur); - cur = [] + if line.startswith("*** IR Dump Before "): + if len(cur) != 0: + print_chunk(cur); + cur = [] cur.append("; " + line) elif line.startswith("Stack dump:"): print_chunk(cur);