import c
This commit is contained in:
@@ -5,6 +5,7 @@ const imports = @import("imports.zig");
|
||||
const sema = @import("sema.zig");
|
||||
const codegen = @import("codegen.zig");
|
||||
const errors = @import("errors.zig");
|
||||
const c_import = @import("c_import.zig");
|
||||
const Node = ast.Node;
|
||||
|
||||
pub const TargetConfig = codegen.TargetConfig;
|
||||
@@ -93,9 +94,17 @@ pub const Compilation = struct {
|
||||
cg.sema_result = sr;
|
||||
}
|
||||
cg.generate(root) catch return error.CompileError;
|
||||
|
||||
self.cg = cg;
|
||||
}
|
||||
|
||||
/// Collect C import source info from the resolved AST.
|
||||
/// Called after generateCode() to compile C sources natively (not merged into LLVM module).
|
||||
pub fn collectCImportSources(self: *Compilation) ![]c_import.CImportInfo {
|
||||
const root = self.resolved_root orelse self.root orelse return &.{};
|
||||
return c_import.collectCImportSources(self.allocator, root);
|
||||
}
|
||||
|
||||
pub fn renderErrors(self: *const Compilation) void {
|
||||
self.diagnostics.renderDebug();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user