mirror of
https://github.com/odin-lang/Odin.git
synced 2026-02-15 23:54:07 +00:00
Improve minimum dependency for complex numbers and quaternion numbers.
This commit is contained in:
@@ -437,12 +437,14 @@ default_logger :: proc() -> Logger {
|
||||
}
|
||||
|
||||
|
||||
@private
|
||||
__init_context_from_ptr :: proc "contextless" (c: ^Context, other: ^Context) {
|
||||
if c == nil do return;
|
||||
c^ = other^;
|
||||
__init_context(c);
|
||||
}
|
||||
|
||||
@private
|
||||
__init_context :: proc "contextless" (c: ^Context) {
|
||||
if c == nil do return;
|
||||
|
||||
|
||||
@@ -2668,6 +2668,22 @@ void check_binary_expr(CheckerContext *c, Operand *x, Ast *node, Type *type_hint
|
||||
return;
|
||||
}
|
||||
|
||||
if (op.kind == Token_Quo || op.kind == Token_QuoEq) {
|
||||
Type *bt = base_type(x->type);
|
||||
if (bt->kind == Type_Basic) switch (bt->Basic.kind) {
|
||||
case Basic_complex64: add_package_dependency(c, "runtime", "quo_complex64"); break;
|
||||
case Basic_complex128: add_package_dependency(c, "runtime", "quo_complex128"); break;
|
||||
case Basic_quaternion128: add_package_dependency(c, "runtime", "quo_quaternion128"); break;
|
||||
case Basic_quaternion256: add_package_dependency(c, "runtime", "quo_quaternion256"); break;
|
||||
}
|
||||
} else if (op.kind == Token_Mul || op.kind == Token_MulEq) {
|
||||
Type *bt = base_type(x->type);
|
||||
if (bt->kind == Type_Basic) switch (bt->Basic.kind) {
|
||||
case Basic_quaternion128: add_package_dependency(c, "runtime", "mul_quaternion128"); break;
|
||||
case Basic_quaternion256: add_package_dependency(c, "runtime", "mul_quaternion256"); break;
|
||||
}
|
||||
}
|
||||
|
||||
x->mode = Addressing_Value;
|
||||
}
|
||||
|
||||
|
||||
@@ -1665,12 +1665,10 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
|
||||
str_lit("mem_zero"),
|
||||
|
||||
str_lit("__init_context"),
|
||||
str_lit("default_assertion_failure_proc"),
|
||||
|
||||
str_lit("args__"),
|
||||
str_lit("type_table"),
|
||||
str_lit("__type_info_of"),
|
||||
str_lit("global_default_temp_allocator_data"),
|
||||
str_lit("default_temp_allocator"),
|
||||
str_lit("default_temp_allocator_init"),
|
||||
str_lit("default_temp_allocator_destroy"),
|
||||
@@ -1680,13 +1678,7 @@ void generate_minimum_dependency_set(Checker *c, Entity *start) {
|
||||
str_lit("Source_Code_Location"),
|
||||
str_lit("Context"),
|
||||
|
||||
str_lit("quo_complex64"),
|
||||
str_lit("quo_complex128"),
|
||||
str_lit("mul_quaternion128"),
|
||||
str_lit("mul_quaternion256"),
|
||||
str_lit("quo_quaternion128"),
|
||||
str_lit("quo_quaternion256"),
|
||||
str_lit("cstring_to_string"),
|
||||
str_lit("cstring_to_string"), // Is tihs needed?
|
||||
|
||||
str_lit("umodti3"),
|
||||
str_lit("udivti3"),
|
||||
|
||||
Reference in New Issue
Block a user