mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 07:38:48 +00:00
Correct SysV ABI for -> (f32, bool)
This commit is contained in:
@@ -549,6 +549,11 @@ namespace lbAbiAmd64SysV {
|
|||||||
} else if (oldv == RegClass_Memory || newv == RegClass_Memory) {
|
} else if (oldv == RegClass_Memory || newv == RegClass_Memory) {
|
||||||
return;
|
return;
|
||||||
} else if (oldv == RegClass_Int || newv == RegClass_Int) {
|
} else if (oldv == RegClass_Int || newv == RegClass_Int) {
|
||||||
|
if (oldv == RegClass_SSEFv || oldv == RegClass_SSEFs) {
|
||||||
|
oldv = RegClass_Int;
|
||||||
|
} else if (newv == RegClass_SSEFv || newv == RegClass_SSEFs) {
|
||||||
|
oldv = RegClass_Int;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
} else if (oldv == RegClass_X87 || oldv == RegClass_X87Up || oldv == RegClass_ComplexX87 ||
|
} else if (oldv == RegClass_X87 || oldv == RegClass_X87Up || oldv == RegClass_ComplexX87 ||
|
||||||
newv == RegClass_X87 || newv == RegClass_X87Up || newv == RegClass_ComplexX87) {
|
newv == RegClass_X87 || newv == RegClass_X87Up || newv == RegClass_ComplexX87) {
|
||||||
|
|||||||
+21
-6
@@ -5794,9 +5794,15 @@ lbValue lb_find_value_from_entity(lbModule *m, Entity *e) {
|
|||||||
|
|
||||||
if (USE_SEPARTE_MODULES) {
|
if (USE_SEPARTE_MODULES) {
|
||||||
lbModule *other_module = lb_pkg_module(m->gen, e->pkg);
|
lbModule *other_module = lb_pkg_module(m->gen, e->pkg);
|
||||||
|
|
||||||
|
// TODO(bill): correct this logic
|
||||||
bool is_external = other_module != m;
|
bool is_external = other_module != m;
|
||||||
if (!is_external) {
|
if (!is_external) {
|
||||||
other_module = e->code_gen_module;
|
if (e->code_gen_module != nullptr) {
|
||||||
|
other_module = e->code_gen_module;
|
||||||
|
} else {
|
||||||
|
other_module = nullptr;
|
||||||
|
}
|
||||||
is_external = other_module != m;
|
is_external = other_module != m;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -5806,8 +5812,20 @@ lbValue lb_find_value_from_entity(lbModule *m, Entity *e) {
|
|||||||
lbValue g = {};
|
lbValue g = {};
|
||||||
g.value = LLVMAddGlobal(m->mod, lb_type(m, e->type), alloc_cstring(permanent_allocator(), name));
|
g.value = LLVMAddGlobal(m->mod, lb_type(m, e->type), alloc_cstring(permanent_allocator(), name));
|
||||||
g.type = alloc_type_pointer(e->type);
|
g.type = alloc_type_pointer(e->type);
|
||||||
|
lb_add_entity(m, e, g);
|
||||||
|
lb_add_member(m, name, g);
|
||||||
|
|
||||||
LLVMSetLinkage(g.value, LLVMExternalLinkage);
|
LLVMSetLinkage(g.value, LLVMExternalLinkage);
|
||||||
|
|
||||||
|
// if (other_module != nullptr) {
|
||||||
|
// lbValue *other_found = string_map_get(&other_module->members, name);
|
||||||
|
// if (other_found) {
|
||||||
|
// lbValue other_g = *other_found;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// LLVMSetLinkage(other_g.value, LLVMExternalLinkage);
|
||||||
|
|
||||||
if (e->Variable.thread_local_model != "") {
|
if (e->Variable.thread_local_model != "") {
|
||||||
LLVMSetThreadLocal(g.value, true);
|
LLVMSetThreadLocal(g.value, true);
|
||||||
|
|
||||||
@@ -5827,8 +5845,7 @@ lbValue lb_find_value_from_entity(lbModule *m, Entity *e) {
|
|||||||
LLVMSetThreadLocalMode(g.value, mode);
|
LLVMSetThreadLocalMode(g.value, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
lb_add_entity(m, e, g);
|
|
||||||
lb_add_member(m, name, g);
|
|
||||||
return g;
|
return g;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -14713,9 +14730,7 @@ void lb_generate_code(lbGenerator *gen) {
|
|||||||
if (is_export) {
|
if (is_export) {
|
||||||
LLVMSetLinkage(g.value, LLVMDLLExportLinkage);
|
LLVMSetLinkage(g.value, LLVMDLLExportLinkage);
|
||||||
LLVMSetDLLStorageClass(g.value, LLVMDLLExportStorageClass);
|
LLVMSetDLLStorageClass(g.value, LLVMDLLExportStorageClass);
|
||||||
}
|
} else {
|
||||||
|
|
||||||
if (e->flags & EntityFlag_Static) {
|
|
||||||
// LLVMSetLinkage(g.value, LLVMInternalLinkage);
|
// LLVMSetLinkage(g.value, LLVMInternalLinkage);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user