Tiny progress on the self-hosted compiler
All checks were successful
All checks were successful
This commit is contained in:
parent
4dedaf3006
commit
c19f456156
@ -7204,6 +7204,13 @@ pub const Module = struct {
|
|||||||
u64_type.resolve(module);
|
u64_type.resolve(module);
|
||||||
_ = module.llvm.builder.create_memset(left_llvm, u8_type.llvm.abi.?.get_zero().to_value(), u64_type.llvm.abi.?.to_integer().get_constant(value_type.get_byte_size(), 0).to_value(), pointer_type.bb.pointer.alignment);
|
_ = module.llvm.builder.create_memset(left_llvm, u8_type.llvm.abi.?.get_zero().to_value(), u64_type.llvm.abi.?.to_integer().get_constant(value_type.get_byte_size(), 0).to_value(), pointer_type.bb.pointer.alignment);
|
||||||
},
|
},
|
||||||
|
.variable_reference => |variable| switch (right.kind) {
|
||||||
|
.left => @trap(),
|
||||||
|
.right => {
|
||||||
|
const uint64 = module.integer_type(64, false);
|
||||||
|
_ = module.llvm.builder.create_memcpy(left_llvm, pointer_type.bb.pointer.alignment, variable.storage.?.llvm.?, variable.storage.?.type.?.bb.pointer.alignment, uint64.llvm.abi.?.to_integer().get_constant(value_type.get_byte_size(), @intFromBool(false)).to_value());
|
||||||
|
},
|
||||||
|
},
|
||||||
else => @trap(),
|
else => @trap(),
|
||||||
},
|
},
|
||||||
.complex => @trap(),
|
.complex => @trap(),
|
||||||
|
@ -243,9 +243,22 @@ BuildMode = enum
|
|||||||
aggressively_optimize_for_size,
|
aggressively_optimize_for_size,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CompileFile = struct
|
||||||
|
{
|
||||||
|
relative_file_path: []u8,
|
||||||
|
build_mode: BuildMode,
|
||||||
|
has_debug_info: u1,
|
||||||
|
silent: u1,
|
||||||
|
}
|
||||||
|
|
||||||
|
compile_file = fn (arena: &Arena, compile: CompileFile) void
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
[export] main = fn [cc(c)] (argument_count: u32, argv: &&u8) s32
|
[export] main = fn [cc(c)] (argument_count: u32, argv: &&u8) s32
|
||||||
{
|
{
|
||||||
global_state_initialize();
|
global_state_initialize();
|
||||||
|
>arena = global_state.arena;
|
||||||
|
|
||||||
if (argument_count < 2)
|
if (argument_count < 2)
|
||||||
{
|
{
|
||||||
@ -323,6 +336,13 @@ BuildMode = enum
|
|||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
compile_file(arena, {
|
||||||
|
.relative_file_path = relative_file_path,
|
||||||
|
.build_mode = build_mode,
|
||||||
|
.has_debug_info = has_debug_info,
|
||||||
|
.silent = 0,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
.test =>
|
.test =>
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user