I see from this question there is a way to dump a module to bitcode (.bc), but I would like to dump the IR to a .ll file so that I can view the IR.
I know llvm-dis
can convert .bc to .ll but in my case it does not work.
I have written some passes that transform the module in a way that llvm-dis
fails to convert the bitcode to IR.
Is there an API similar to LLVMWriteBitcodeToFile
that lets me dump a module to IR directly?