@@ -329,6 +329,7 @@ export type InsnCall = struct {
329329}
330330
331331export def call(state: &State, name: Str, tpe: typechecking::TypeId, args: &[Value], loc: &Value = null) -> Value {
332+ assert name
332333 let name_v = [ kind = ValueKind::GLOBAL, name = name ] !Value
333334 return call(state, name_v, tpe, args, parser::InlineSpecifier::NONE, null, loc)
334335}
@@ -8759,9 +8760,8 @@ def create_destructor(tpe: &typechecking::Type, value: Value, state: &State) {
87598760 let destructor = typechecking::get_builtin_destructor(field.tpe)
87608761
87618762 if destructor {
8762- let dtortpe = destructor.get_type().resolve()
87638763 let field_value = state.gep(ptpe, structure_type.id, obj, [make_int_value(0), make_int_value(i)])
8764- state.call(dtortpe.type_name , 0, [field_value])
8764+ state.call(destructor.fdef.name , 0, [field_value])
87658765 }
87668766 }
87678767 }
@@ -8834,7 +8834,7 @@ def create_destructor(tpe: &typechecking::Type, value: Value, state: &State) {
88348834}
88358835
88368836def do_create_type(tpe: &typechecking::Type, svalue: &scope::Value, module: &toolchain::Module) -> &Value {
8837- if toolchain::no_stdlib { return NO_VALUE }
8837+ // if toolchain::no_stdlib { return NO_VALUE }
88388838
88398839 //let generic = typechecking::get_generic(tpe)
88408840 //if generic and generic.tc_incomplete { return null }
@@ -8854,11 +8854,9 @@ def do_create_type(tpe: &typechecking::Type, svalue: &scope::Value, module: &too
88548854 toolchain::types.result.globals(global2.name) = global2
88558855 toolchain::types.imported.add(global2.name)
88568856
8857- let name_str = debug::type_to_str(tpe, full_name = true)
8858-
88598857 let type_ = builtins::type_t().resolve()
88608858 value.values = allocate_ref(Value, 3)
8861- value.values(0) = [ kind = ValueKind::INT, tpe = builtins::int64_, i = md5::high(md5::md5(name_str)) ] !Value
8859+ value.values(0) = [ kind = ValueKind::INT, tpe = builtins::int64_, i = tpe.id ] !Value
88628860 value.values(1) = [ kind = ValueKind::ZEROINITIALIZER, tpe = type_.field_types(1).tpe ] !Value
88638861 value.values(2) = [ kind = ValueKind::ZEROINITIALIZER, tpe = type_.field_types(2).tpe ] !Value
88648862
@@ -8992,9 +8990,7 @@ export def create_type(tpe: &typechecking::Type, module: &toolchain::Module, res
89928990
89938991 let state = toolchain::types_state
89948992 let assembly_name = scope::assembly_name(svalue, state)
8995- if not state.consteval and
8996- not map::contains(module.result.globals, assembly_name) {
8997-
8993+ if not map::contains(module.result.globals, assembly_name) {
89988994 let global = [
89998995 external = true,
90008996 name = assembly_name,
@@ -9042,9 +9038,8 @@ def change_value_to_type(tpe: &typechecking::Type, loc: &Value, state: &State) -
90429038
90439039 let fun = declare_reflection_type_id_fun(state)
90449040 if not fun { return NO_VALUE }
9045- let hash = md5::high(md5::md5(debug::type_to_str(tpe, full_name = true)))
90469041 let tmp = state.alloca(builtins::type_t(), loc)
9047- let res = state.call(fun.fdef.name, builtins::TypeT_, [[ tpe = builtins::uint64_, kind = ValueKind::INT, i = hash ] !Value], loc)
9042+ let res = state.call(fun.fdef.name, builtins::TypeT_, [[ tpe = builtins::uint64_, kind = ValueKind::INT, i = tpe.id ] !Value], loc)
90489043 state.store(tmp, res, loc)
90499044 create_temporary(tmp, res, loc, state)
90509045 return res
@@ -9468,7 +9463,7 @@ def generate_vtable_function(function: &Function, fdef: typechecking::FunctionDe
94689463 let type_entry = typechecking::type_registry(keys(i))
94699464 if is_ref(type_entry.tpe) and typechecking::implements(type_entry, intf, state.scope) {
94709465 // FIXME This whole branch isn't working yet because interfaces don't work right now
9471- let hash = md5::high(md5::md5(debug::type_to_str( type_entry, full_name = true)))
9466+ let hash = type_entry.id
94729467 if hashes.contains(hash) { continue }
94739468 hashes.add(hash)
94749469
0 commit comments