cgen: output .bc file

This commit is contained in:
Luna 2019-09-21 12:37:41 -03:00
parent 243e3cc694
commit 86e899e771
2 changed files with 6 additions and 2 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
zig-cache/
*.bc
*.ll

View file

@ -74,8 +74,6 @@ pub const Codegen = struct {
try self.genNode(mod, &child);
}
std.debug.warn("cgen: done\n");
var err: ?[*]u8 = null;
_ = llvm.LLVMVerifyModule(
mod,
@ -83,5 +81,9 @@ pub const Codegen = struct {
&err,
);
llvm.LLVMDisposeMessage(err);
if (llvm.LLVMWriteBitcodeToFile(mod, c"awoo.bc") != 0) {
std.debug.warn("error writing bitcode to file\n");
}
}
};