zig icon indicating copy to clipboard operation
zig copied to clipboard

main: add debug option to dump unoptimized llvm ir

Open jacobly0 opened this issue 2 years ago • 0 comments

I opted to not spend too much time thinking about naming and syntax and just implement some badly needed debugging functionality. This is specifically needed for debugging the current non-determinism issue.

  • --verbose-llvm-ir still prints unoptimized llvm ir to stdout
  • --verbose-llvm-ir=file.ll now writes unoptimized llvm ir to a file
  • --verbose-llvm-bc=file.bc now writes unoptimized llvm bc to a file
  • -femit-llvm-ir=file.ll still writes optimized llvm ir to a file
  • -femit-llvm-bc=file.bc still writes optimized llvm bc to a file

While it was technically possible to use --verbose-llvm-ir and redirect stderr to a file, if there was other output interleaved on stderr it was very difficult to reconstruct a valid llvm module.

jacobly0 avatar Mar 16 '23 05:03 jacobly0