Function printToFile [src]
Prototype
pub fn printToFile(self: *Builder, path: []const u8) Allocator.Error!bool
Parameters
self: *Builder
path: []const u8
Source
pub fn printToFile(self: *Builder, path: []const u8) Allocator.Error!bool {
var file = std.fs.cwd().createFile(path, .{}) catch |err| {
log.err("failed printing LLVM module to \"{s}\": {s}", .{ path, @errorName(err) });
return false;
};
defer file.close();
self.print(file.writer()) catch |err| {
log.err("failed printing LLVM module to \"{s}\": {s}", .{ path, @errorName(err) });
return false;
};
return true;
}