commit
d01384928f
@ -3523,11 +3523,11 @@ fn worker_thread(thread_index: u32, cpu_count: *u32) void {
|
|||||||
const debug_info = false;
|
const debug_info = false;
|
||||||
|
|
||||||
for (thread.external_functions.slice()) |*nat_function| {
|
for (thread.external_functions.slice()) |*nat_function| {
|
||||||
_ = llvm_get_function(thread, nat_function, true);
|
llvm_emit_function_declaration(thread, nat_function);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (thread.functions.slice()) |*nat_function| {
|
for (thread.functions.slice()) |*nat_function| {
|
||||||
_ = llvm_get_function(thread, &nat_function.declaration, false);
|
llvm_emit_function_declaration(thread, &nat_function.declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (thread.global_variables.slice()) |*nat_global| {
|
for (thread.global_variables.slice()) |*nat_global| {
|
||||||
@ -4017,9 +4017,8 @@ fn llvm_get_file(thread: *Thread, file_index: u32) *LLVMFile {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn llvm_get_function(thread: *Thread, nat_function: *Function.Declaration, override_extern: bool) *LLVM.Value.Constant.Function {
|
fn llvm_emit_function_declaration(thread: *Thread, nat_function: *Function.Declaration) void {
|
||||||
if (nat_function.global_symbol.value.llvm) |llvm| return llvm.toFunction() orelse unreachable else {
|
assert(nat_function.global_symbol.value.llvm == null);
|
||||||
_ = override_extern; // autofix
|
|
||||||
const function_name = thread.identifiers.get(nat_function.global_symbol.global_declaration.declaration.name) orelse unreachable;
|
const function_name = thread.identifiers.get(nat_function.global_symbol.global_declaration.declaration.name) orelse unreachable;
|
||||||
const nat_function_type = nat_function.get_type();
|
const nat_function_type = nat_function.get_type();
|
||||||
const function_type = llvm_get_type(thread, &nat_function_type.type);
|
const function_type = llvm_get_type(thread, &nat_function_type.type);
|
||||||
@ -4096,8 +4095,6 @@ fn llvm_get_function(thread: *Thread, nat_function: *Function.Declaration, overr
|
|||||||
}
|
}
|
||||||
|
|
||||||
nat_function.global_symbol.value.llvm = function.toValue();
|
nat_function.global_symbol.value.llvm = function.toValue();
|
||||||
return function;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn create_basic_block(thread: *Thread) *BasicBlock {
|
fn create_basic_block(thread: *Thread) *BasicBlock {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user