zig
zig copied to clipboard
main: add debug option to dump unoptimized llvm ir
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-irstill prints unoptimized llvm ir to stdout--verbose-llvm-ir=file.llnow writes unoptimized llvm ir to a file--verbose-llvm-bc=file.bcnow writes unoptimized llvm bc to a file-femit-llvm-ir=file.llstill writes optimized llvm ir to a file-femit-llvm-bc=file.bcstill 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.