| 33 | static final int DUMP_DISASSEMBLE = 1<<31; |
| 34 | |
| 35 | static void usage() { |
| 36 | System.out.println( |
| 37 | """ |
| 38 | simple [options] <input-file> ...args... |
| 39 | Options: |
| 40 | --dump - dump final intermediate representation |
| 41 | --dump-after-parse - dump intermediate representation after parse |
| 42 | --dump-after-opto - dump intermediate representation after opto pass |
| 43 | --dump-after-type-check - dump intermediate representation after type check pass |
| 44 | --dump-after-select - dump intermediate representation after instrution selection pass |
| 45 | --dump-after-gcm - dump intermediate representation after GCM pass |
| 46 | --dump-after-local-sched - dump intermediate representation after local scheduling pass |
| 47 | --dump-after-reg-alloc - dump intermediate representation after register allocation pass |
| 48 | --dump-after-encode - dump intermediate representation after encoding pass |
| 49 | --dump-after-all - dump intermediate representation after all passes |
| 50 | --dot - dump grapical representation of intermediate code into *.dot file(s) |
| 51 | -S - dump generated assembler code |
| 52 | --eval - evaluate the compiled code in emulator |
| 53 | --run - run the compiled code natively; this is the default |
| 54 | --dump-size - print the size of generated code |
| 55 | --dump-time - print compilation and execution times |
| 56 | --cpu <cpu-name> - use specific CPU (x86_64_v2, riscv, arm) |
| 57 | --abi <abi-name> - use speific ABI variant (SystemV) |
| 58 | --target - print native CPU and ABI |
| 59 | --version |
| 60 | --help |
| 61 | """ |
| 62 | ); |
| 63 | System.exit(0); |
| 64 | } |
| 65 | |
| 66 | static void bad_usage() { bad("Invalid usage (use --help)"); } |
| 67 | static RuntimeException bad(String err) { |