Closed tibbe closed 7 years ago
An example of how this helps. The above error message is
llc-3.8: /tmp/test.ll:1:12: error: pointers to void are invalid - use i8* instead
define void* @id(void *x) {
^
if you run llc with the corresponding LLVM assembly. This is a considerably better error message for debugging.
@tibbe Are you looking for something like withModuleFromAST ctx mod moduleLLVMAssembly
? Otherwise, I don’t understand what you are asking for.
I just realized you are probably looking for a way to pretty-print without lowering because lowering is the part causing the error. In that case https://github.com/sdiehl/llvm-pp might be what you are looking for.
llvm-pp was what I was looking for. Thanks!
I frequently find myself wanting myself to print the LLVM AST in the human-readable LLVM assembly format. It is possible to pretty-print the AST in a Haskell source code format, and that's sometimes useful, but it would be easier to debug errors such as:
If you could pretty-print the LLVM assembly and tinker with it.