c variadic calls
This commit is contained in:
@@ -324,7 +324,7 @@ lower_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instruction_Id {
|
||||
})
|
||||
}
|
||||
_ = pop(&stack)
|
||||
case .Widen, .Weaken_Pointer:
|
||||
case .Widen, .C_Vararg_Promote, .Weaken_Pointer:
|
||||
stack[frame_index].stage = 1
|
||||
append(&stack, Lower_Expr_Frame{expr=expr.left})
|
||||
case .Negate:
|
||||
@@ -358,7 +358,8 @@ lower_expr :: proc(state: ^State, expr_id: hir.Expr_Id) -> ir.Instruction_Id {
|
||||
}
|
||||
if frame.stage == 1 {
|
||||
last = append_instruction(state, ir.Instruction{
|
||||
op=.Weaken_Pointer if expr.kind == .Weaken_Pointer else .Widen,
|
||||
op=.Weaken_Pointer if expr.kind == .Weaken_Pointer else
|
||||
(.C_Vararg_Promote if expr.kind == .C_Vararg_Promote else .Widen),
|
||||
span=expr.span, type=expr.type, target=ir.INVALID_REF,
|
||||
a=last, b=ir.INVALID_INSTRUCTION, diagnostic=source.INVALID_DIAGNOSTIC,
|
||||
})
|
||||
@@ -611,6 +612,7 @@ lower :: proc(hir_module: ^hir.Module, allocator := context.allocator) -> ir.Mod
|
||||
implementation=.Declaration if function.implementation == .Declaration else .Definition,
|
||||
linkage=.External if function.linkage == .External else .Internal,
|
||||
is_main=function.is_main,
|
||||
variadic=function.variadic,
|
||||
param_types=param_types,
|
||||
result=function.result,
|
||||
instructions=nil if function.implementation == .Declaration else lower_body(hir_module, function, allocator),
|
||||
|
||||
Reference in New Issue
Block a user