Browse Source

Type_Info initialization

gingerBill 5 years ago
parent
commit
a27c68f526
3 changed files with 470 additions and 251 deletions
  1. 1 1
      core/runtime/core.odin
  2. 458 249
      src/llvm_backend.cpp
  3. 11 1
      src/llvm_backend.hpp

+ 1 - 1
core/runtime/core.odin

@@ -24,7 +24,7 @@ import "intrinsics"
 // implemented within the compiler rather than in this "preload" file
 // implemented within the compiler rather than in this "preload" file
 
 
 // NOTE(bill): This must match the compiler's
 // NOTE(bill): This must match the compiler's
-Calling_Convention :: enum {
+Calling_Convention :: enum u8 {
 	Invalid     = 0,
 	Invalid     = 0,
 	Odin        = 1,
 	Odin        = 1,
 	Contextless = 2,
 	Contextless = 2,

File diff suppressed because it is too large
+ 458 - 249
src/llvm_backend.cpp


+ 11 - 1
src/llvm_backend.hpp

@@ -247,7 +247,7 @@ lbValue lb_build_gep(lbProcedure *p, lbValue const &value, i32 index) ;
 
 
 lbValue lb_emit_struct_ep(lbProcedure *p, lbValue s, i32 index);
 lbValue lb_emit_struct_ep(lbProcedure *p, lbValue s, i32 index);
 lbValue lb_emit_struct_ev(lbProcedure *p, lbValue s, i32 index);
 lbValue lb_emit_struct_ev(lbProcedure *p, lbValue s, i32 index);
-lbValue lb_emit_array_epi(lbProcedure *p, lbValue value, i32 index);
+lbValue lb_emit_array_epi(lbProcedure *p, lbValue value, isize index);
 lbValue lb_emit_array_ep(lbProcedure *p, lbValue s, lbValue index);
 lbValue lb_emit_array_ep(lbProcedure *p, lbValue s, lbValue index);
 lbValue lb_emit_deep_field_gep(lbProcedure *p, lbValue e, Selection sel);
 lbValue lb_emit_deep_field_gep(lbProcedure *p, lbValue e, Selection sel);
 lbValue lb_emit_deep_field_ev(lbProcedure *p, lbValue e, Selection sel);
 lbValue lb_emit_deep_field_ev(lbProcedure *p, lbValue e, Selection sel);
@@ -280,6 +280,16 @@ lbAddr lb_add_local_generated(lbProcedure *p, Type *type, bool zero_init);
 lbValue lb_emit_runtime_call(lbProcedure *p, char const *c_name, Array<lbValue> const &args);
 lbValue lb_emit_runtime_call(lbProcedure *p, char const *c_name, Array<lbValue> const &args);
 
 
 
 
+#define LB_STARTUP_RUNTIME_PROC_NAME "__$startup_runtime"
+#define LB_TYPE_INFO_DATA_NAME       "__$type_info_data"
+#define LB_TYPE_INFO_TYPES_NAME      "__$type_info_types_data"
+#define LB_TYPE_INFO_NAMES_NAME      "__$type_info_names_data"
+#define LB_TYPE_INFO_OFFSETS_NAME    "__$type_info_offsets_data"
+#define LB_TYPE_INFO_USINGS_NAME     "__$type_info_usings_data"
+#define LB_TYPE_INFO_TAGS_NAME       "__$type_info_tags_data"
+
+
+
 enum lbCallingConventionKind {
 enum lbCallingConventionKind {
     lbCallingConvention_C = 0,
     lbCallingConvention_C = 0,
     lbCallingConvention_Fast = 8,
     lbCallingConvention_Fast = 8,

Some files were not shown because too many files changed in this diff