diff options
-rw-r--r-- | src/codegen.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/codegen.c b/src/codegen.c index 35e19f9..2ec3be7 100644 --- a/src/codegen.c +++ b/src/codegen.c @@ -109,10 +109,12 @@ codegen(const char *file, bitset_t *cnst, fold_t *folds, scope_t *scps, err("codegen: %s", error); if (lflag) { - if (oflag == NULL) - LLVMDumpModule(ctx.mod); - else if (LLVMPrintModuleToFile(llmod, oflag, &error) == 1) + if (LLVMPrintModuleToFile(llmod, oflag == NULL ? "/dev/stdout" : oflag, + &error) + == 1) + { err("codegen: %s", error); + } } else { LLVMCodeGenFileType ft; const char *dst = oflag == NULL ? "out.o" : oflag; |