Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorious3 committed Apr 15, 2024
1 parent 655e65b commit 2b25522
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/compiler.pr
Original file line number Diff line number Diff line change
Expand Up @@ -3213,7 +3213,7 @@ def walk_Identifier(node: &parser::Node, state: &State) -> Value {
if val.module != state.module and
not is_function(val.tpe) and
not state.module.result.globals.contains(name) {

state.module.result.globals(name) = [
tpe = val.tpe,
name = name,
Expand Down Expand Up @@ -5924,7 +5924,7 @@ def walk_Defer(node: &parser::Node, state: &State) {
_tpe = typechecking::pointer(current_function.env)
] !typechecking::NamedParameter)

let tpe = typechecking::make_function_type_n(parser::make_identifier("defer"), parameter_t, vector::make(type &typechecking::Type))
let tpe = typechecking::make_function_type_n(parser::make_identifier("defer"), parameter_t, vector::make(type &typechecking::Type), context = state.module)

let keys_locals = map::keys(current_function.locals)

Expand Down Expand Up @@ -6784,7 +6784,7 @@ def defer_unroll(node: &parser::Node, state: &State) {
_tpe = typechecking::pointer(state.current_function.env)
] !typechecking::NamedParameter)

let tpe = typechecking::make_function_type_n(parser::make_identifier("defer"), parameter_t, vector::make(type &typechecking::Type))
let tpe = typechecking::make_function_type_n(parser::make_identifier("defer"), parameter_t, vector::make(type &typechecking::Type), context = state.module)

let br_to_start = make_insn(InsnKind::BR_UNC)
push_insn(br_to_start, state)
Expand Down Expand Up @@ -7582,9 +7582,8 @@ export def create_function(
let return_t = vector::make(type &typechecking::Type)
return_t.push(function.optional)
let impl_tpe = typechecking::make_function_type_n(parser::make_identifier(tpe.name + ".impl"),
parameter_t, return_t, state.module
parameter_t, return_t, state.module, context = state.module
)
impl_tpe.type_name = typechecking::mangle_function_name(impl_tpe.name, tpe.parameter_t)

state.store(
[ kind = ValueKind::LOCAL, tpe = pointer(builtins::int_), name = "__block" ] !Value,
Expand Down Expand Up @@ -7627,9 +7626,8 @@ export def create_function(
let parameter_t2 = vector::make(typechecking::NamedParameter)
parameter_t2.push([ name = "__context", _tpe = typechecking::pointer(null) ] !typechecking::NamedParameter)
let free_context_tpe = typechecking::make_function_type_n(parser::make_identifier(tpe.name + ".free_context"),
free_context_parameters, vector::make(type &typechecking::Type), state.module
free_context_parameters, vector::make(type &typechecking::Type), state.module, context = state.module
)
free_context_tpe.type_name = typechecking::mangle_function_name(free_context_tpe.name, tpe.parameter_t)

let free_context = predeclare_function(free_context_tpe, state.module)
free_context.is_compiled = true
Expand Down

0 comments on commit 2b25522

Please sign in to comment.