aboutsummaryrefslogtreecommitdiff
path: root/src/codegen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/codegen.c')
-rw-r--r--src/codegen.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/codegen.c b/src/codegen.c
index 5cd7ed4..14d7c20 100644
--- a/src/codegen.c
+++ b/src/codegen.c
@@ -111,15 +111,10 @@ codegen(const char *file, bitset_t *cnst, fold_t *folds, scope_t *scps,
LLVMDisposeMessage(error);
if (lflag) {
- if (oflag == NULL)
- oflag = "/dev/stdout";
- /* Stupid hack to make this work with Neovim */
- if (LLVMPrintModuleToFile(llmod, oflag, &error) == 1) {
- if (errno != ENXIO)
- err("codegen: %s: %s", oflag, error);
- LLVMDisposeMessage(error);
- LLVMDumpModule(llmod);
- }
+ /* Needlessly inefficient… but that’s LLVM for you */
+ char *s = LLVMPrintModuleToString(llmod);
+ fputs(s, stdout);
+ LLVMDisposeMessage(s);
} else {
LLVMCodeGenFileType ft;
const char *dst = oflag == NULL ? "out.o" : oflag;