sm
This commit is contained in:
14
src/core.zig
14
src/core.zig
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user