This is an ongoing series of commits that are reformatting our Python code. This catches the last of the python files to reformat. Since they where so few I bunched them together. Reformatting is done with `black`. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Reviewed By: jhenderson, #libc, Mordante, sivachandra Differential Revision: https://reviews.llvm.org/D150784
27 lines
626 B
Python
27 lines
626 B
Python
#
|
|
# Dump the dependency file (produced with -dependency_info) to text
|
|
# format for testing purposes.
|
|
#
|
|
|
|
import sys
|
|
|
|
f = open(sys.argv[1], "rb")
|
|
byte = f.read(1)
|
|
while byte != b"":
|
|
if byte == b"\x00":
|
|
sys.stdout.write("lld-version: ")
|
|
elif byte == b"\x10":
|
|
sys.stdout.write("input-file: ")
|
|
elif byte == b"\x11":
|
|
sys.stdout.write("not-found: ")
|
|
elif byte == b"\x40":
|
|
sys.stdout.write("output-file: ")
|
|
byte = f.read(1)
|
|
while byte != b"\x00":
|
|
sys.stdout.write(byte.decode("ascii"))
|
|
byte = f.read(1)
|
|
sys.stdout.write("\n")
|
|
byte = f.read(1)
|
|
|
|
f.close()
|