Skip to content

Commit

Permalink
Remove blank lines from llvm-size in emsize.py (emscripten-core#10143)
Browse files Browse the repository at this point in the history
llvm-size was previously emitting one blank line after the total, it
started emitting two. We don't care about them in general, so just
filter them out.
  • Loading branch information
jgravelle-google authored Jan 3, 2020
1 parent aac24eb commit a5b9e9e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions emsize.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,14 @@ def print_sizes(js_file):

sizes = shared.check_call([LLVM_SIZE, '-format=sysv', wasm_file],
stdout=subprocess.PIPE).stdout
lines = sizes.splitlines()
# llvm-size may emit some number of blank lines (after the total), ignore them
lines = [line for line in sizes.splitlines() if line]

# Last line is '', next-to-to last is the total. Add the JS size.
total = int(lines[-2].split()[-1])
# Last line is the total. Add the JS size.
total = int(lines[-1].split()[-1])
total += js_size

for line in lines[:-2]:
for line in lines[:-1]:
print(line)

print('JS\t\t%s\t0' % js_size)
Expand Down

0 comments on commit a5b9e9e

Please sign in to comment.