| '\s*(i[0-9]+|float|double|x86_fp80|fp128|ppc_fp128|\[\[.*?\]\]|\[2 x \[\[[A-Z_0-9]+\]\]\]|<.*?>|{.*?}|\[[0-9]+ x .*?\]|%["a-z:A-Z0-9._]+({{.*?}})?|%{{.*?}}|{{.*?}}|\[\[.*?\]\])(\s*(\*|addrspace\(.*?\)|dereferenceable\(.*?\)|byval\(.*?\)|sret|zeroext|inreg|returned|signext|nocapture|align \d+|swiftself|swifterror|readonly|noalias|inalloca|nocapture))*\s*' |
| annoying_pos = s.find("{{[^(]+}}") |
| at_pos = annoying_pos + 9 |
| paren_pos = s.find("(", at_pos) |
| if s.startswith(",") or s.startswith(")"): |
| def process_file(contents): |
| PREFIX = re.compile(r"check-prefix(es)?(=|\s+)([a-zA-Z0-9,]+)") |
| check_prefixes = ["CHECK"] |
| for line in contents.split("\n"): |
| check_prefixes.extend(m.group(3).split(",")) |
| for prefix in check_prefixes: |
| if not found_check or "define" not in line: |
| # We have a check for a function definition. Number the args. |
| print(f"Processing {sys.argv[1]}") |
| content = process_file(content) |
| f = open(sys.argv[1], "w") |
| if __name__ == "__main__": |