This commit is contained in:
agra
2026-03-02 21:00:55 +02:00
parent 2f4f898d54
commit bbb5426777
42 changed files with 483 additions and 9023 deletions

View File

@@ -106,6 +106,18 @@ pub const Compilation = struct {
self.ir_emitter = emitter;
}
/// Get link flags accumulated from #run build blocks.
pub fn getBuildLinkFlags(self: *Compilation) []const []const u8 {
if (self.ir_emitter) |*e| return e.build_config.link_flags.items;
return &.{};
}
/// Get output path set from #run build blocks, if any.
pub fn getBuildOutputPath(self: *Compilation) ?[]const u8 {
if (self.ir_emitter) |*e| return e.build_config.output_path;
return null;
}
/// Collect C import source info from the resolved AST.
pub fn collectCImportSources(self: *Compilation) ![]c_import.CImportInfo {
const root = self.resolved_root orelse self.root orelse return &.{};
@@ -117,7 +129,7 @@ pub const Compilation = struct {
const root = self.resolved_root orelse self.root orelse return ir.Module.init(self.allocator);
var module = ir.Module.init(self.allocator);
//TODO: find a better place for this
if (self.target_config.isWasm()) {
if (self.target_config.isWasm32()) {
module.types.pointer_size = 4;
}
var lowering = ir.Lowering.init(&module);