wrangle the llvm bitcode CLI options #19778
Labels
backend-llvm
The LLVM backend outputs an LLVM IR Module.
enhancement
Solving this issue will likely involve adding new logic or components to the codebase.
Milestone
With #16270 in mind, let's reevaluate the CLI options that relate to LLVM IR modules.
-femit-llvm-bc
and-femit-llvm-ir
: Currently this is post LLVM optimization. This should continue to be the case, however these options should print an error if you try to use them with a build of zig that does not have LLVM enabled. When #16270 is implemented, these options will disappear entirely. Before that, they should be renamed into-femit-llvm-opt-bc
and-femit-llvm-opt-ir
.-ofmt=bc
: This option should be introduced, making LLVM IR modules an additional object format that can be selected in a similar fashion to the C backend (-ofmt=c
). This is how you specify to emit LLVM bitcode modules with a zig compiler that does not have LLVM enabled. When #16270 is implemented,-fllvm
and-fno-llvm
disappear entirely but-ofmt=bc
remains. When this target is selected, Zig optimization pipeline is run but LLVM's is not.--verbose-llvm-ir
: Should be changed into-femit-llvm-ir
for debugging convenience. Corresponding exactly to-ofmt=bc
, this emits LLVM IR after Zig optimizations; before LLVM optimizations. After #16270 is implemented, this (changed) option remains because it is useful in combination with-ofmt=bc
.The text was updated successfully, but these errors were encountered: