+ The Odin programming language is fast, concise, readable, pragmatic and open sourced. It is designed with the intent of replacing C with the following goals:
+ * simplicity
+ * high performance
+ * built for modern systems
+ * joy of programming
+
+ # Installing Odin
+ Getting Started - https://odin-lang.org/docs/install/
+ Instructions for downloading and install the Odin compiler and libraries.
+
+ # Learning Odin
+ Overview of Odin - https://odin-lang.org/docs/overview/
- error(p->token, "Overloaded procedure '%.*s' as the same type as another procedure in this scope", LIT(name));
+ error(p->token, "Overloaded procedure '%.*s' as the same type as another procedure in the procedure group '%.*s'", LIT(name), LIT(proc_group_name));
is_invalid = true;
is_invalid = true;
break;
break;
// case ProcOverload_CallingConvention:
// case ProcOverload_CallingConvention:
- // error(p->token, "Overloaded procedure '%.*s' as the same type as another procedure in this scope", LIT(name));
+ // error(p->token, "Overloaded procedure '%.*s' as the same type as another procedure in the procedure group '%.*s'", LIT(name), LIT(proc_group_name));
// is_invalid = true;
// is_invalid = true;
// break;
// break;
case ProcOverload_ParamVariadic:
case ProcOverload_ParamVariadic:
- error(p->token, "Overloaded procedure '%.*s' as the same type as another procedure in this scope", LIT(name));
+ error(p->token, "Overloaded procedure '%.*s' as the same type as another procedure in the procedure group '%.*s'", LIT(name), LIT(proc_group_name));
is_invalid = true;
is_invalid = true;
break;
break;
case ProcOverload_ResultCount:
case ProcOverload_ResultCount:
case ProcOverload_ResultTypes:
case ProcOverload_ResultTypes:
- error(p->token, "Overloaded procedure '%.*s' as the same parameters but different results in this scope", LIT(name));
+ error(p->token, "Overloaded procedure '%.*s' as the same parameters but different results in the procedure group '%.*s'", LIT(name), LIT(proc_group_name));
is_invalid = true;
is_invalid = true;
break;
break;
case ProcOverload_Polymorphic:
case ProcOverload_Polymorphic:
#if 0
#if 0
- error(p->token, "Overloaded procedure '%.*s' has a polymorphic counterpart in this scope which is not allowed", LIT(name));
+ error(p->token, "Overloaded procedure '%.*s' has a polymorphic counterpart in the procedure group '%.*s' which is not allowed", LIT(name), LIT(proc_group_name));
+ if (ctx->inline_for_depth >= MAX_INLINE_FOR_DEPTH && prev_inline_for_depth < MAX_INLINE_FOR_DEPTH) {
+ if (prev_inline_for_depth > 0) {
+ error(node, "Nested 'inline for' loop cannot be inlined as it exceeds the maximum inline for depth (%lld levels >= %lld maximum levels)", v, MAX_INLINE_FOR_DEPTH);
+ } else {
+ error(node, "'inline for' loop cannot be inlined as it exceeds the maximum inline for depth (%lld levels >= %lld maximum levels)", v, MAX_INLINE_FOR_DEPTH);
+ }
+ error_line("\tUse a normal 'for' loop instead by removing the 'inline' prefix\n");
+ // TODO(bill): Handle this case which will be caused by #packed most likely
+ switch (otsz) {
+ case 1:
+ case 2:
+ case 4:
+ case 8:
+ GB_PANIC("Incorrectly handled case for handle_struct_system_v_amd64_abi_type, %s %lld vs %s %lld", type_to_string(final_type), ftsz, type_to_string(original_type), otsz);
+ }
+ }
+
+ return final_type;
+ }
+}
+
Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCallingConvention cc) {
Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCallingConvention cc) {
Type *new_type = original_type;
Type *new_type = original_type;
@@ -1889,6 +2195,7 @@ Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCall
{
{
i64 align = type_align_of(original_type);
i64 align = type_align_of(original_type);
i64 size = type_size_of(original_type);
i64 size = type_size_of(original_type);
+
switch (8*size) {
switch (8*size) {
case 8: new_type = t_u8; break;
case 8: new_type = t_u8; break;
case 16: new_type = t_u16; break;
case 16: new_type = t_u16; break;
@@ -1903,7 +2210,7 @@ Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCall
}
}
}
}
} else if (build_context.ODIN_OS == "linux" ||
} else if (build_context.ODIN_OS == "linux" ||
- build_context.ODIN_OS == "osx") {
+ build_context.ODIN_OS == "darwin") {
Type *bt = core_type(original_type);
Type *bt = core_type(original_type);
switch (bt->kind) {
switch (bt->kind) {
// Okay to pass by value (usually)
// Okay to pass by value (usually)
@@ -1920,18 +2227,17 @@ Type *type_to_abi_compat_param_type(gbAllocator a, Type *original_type, ProcCall
case Type_Pointer: break;
case Type_Pointer: break;
case Type_Proc: break; // NOTE(bill): Just a pointer
case Type_Proc: break; // NOTE(bill): Just a pointer
- // Odin specific
- case Type_Slice:
- case Type_Array:
- case Type_DynamicArray:
- case Type_Map:
- case Type_Union:
- // Could be in C too
- case Type_Struct: {
- i64 align = type_align_of(original_type);
- i64 size = type_size_of(original_type);
- if (8*size > 16) {
+ default: {
+ i64 size = type_size_of(original_type);
+ if (size > 16) {
new_type = alloc_type_pointer(original_type);
new_type = alloc_type_pointer(original_type);
+ } else if (build_context.ODIN_ARCH == "amd64") {