brintos

brintos / llvm-project-archived public Read only

0
0
Text · 626 B · bbd14d3 Raw
27 lines · python
1#2# Dump the dependency file (produced with -dependency_info) to text3# format for testing purposes.4#5 6import sys7 8f = open(sys.argv[1], "rb")9byte = f.read(1)10while byte != b"":11    if byte == b"\x00":12        sys.stdout.write("lld-version: ")13    elif byte == b"\x10":14        sys.stdout.write("input-file: ")15    elif byte == b"\x11":16        sys.stdout.write("not-found: ")17    elif byte == b"\x40":18        sys.stdout.write("output-file: ")19    byte = f.read(1)20    while byte != b"\x00":21        sys.stdout.write(byte.decode("ascii"))22        byte = f.read(1)23    sys.stdout.write("\n")24    byte = f.read(1)25 26f.close()27