aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2019-12-08 22:53:51 -0500
committerAndrew Kelley <andrew@ziglang.org>2019-12-08 22:53:51 -0500
commit8b2622cdd58cec697d9d1f8f49717b6ce7ee3e2e (patch)
tree3de817be4757dd1ad0bbdc0c7c3f863deb0f1d43 /src
parent5874cb04bd544ca155d1489bb0bdf9397fa3b41c (diff)
downloadzig-8b2622cdd58cec697d9d1f8f49717b6ce7ee3e2e.tar.gz
zig-8b2622cdd58cec697d9d1f8f49717b6ce7ee3e2e.zip
std.fmt.format: tuple parameter instead of var args
Diffstat (limited to 'src')
-rw-r--r--src/ir.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ir.cpp b/src/ir.cpp
index 09e0b70928..0f66965a80 100644
--- a/src/ir.cpp
+++ b/src/ir.cpp
@@ -17025,7 +17025,7 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, IrInstruction *suspend_s
{
result_loc_pass1 = no_result_loc();
}
- bool was_written = result_loc_pass1->written;
+ bool was_already_resolved = result_loc_pass1->resolved_loc != nullptr;
IrInstruction *result_loc = ir_resolve_result_raw(ira, suspend_source_instr, result_loc_pass1, value_type,
value, force_runtime, non_null_comptime, allow_discard);
if (result_loc == nullptr || (instr_is_unreachable(result_loc) || type_is_invalid(result_loc->value->type)))
@@ -17038,7 +17038,7 @@ static IrInstruction *ir_resolve_result(IrAnalyze *ira, IrInstruction *suspend_s
}
InferredStructField *isf = result_loc->value->type->data.pointer.inferred_struct_field;
- if (!was_written && isf != nullptr) {
+ if (!was_already_resolved && isf != nullptr) {
// Now it's time to add the field to the struct type.
uint32_t old_field_count = isf->inferred_struct_type->data.structure.src_field_count;
uint32_t new_field_count = old_field_count + 1;
@@ -18077,7 +18077,11 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstruction *source_i
if (type_is_invalid(result_loc->value->type) || instr_is_unreachable(result_loc)) {
return result_loc;
}
- if (!handle_is_ptr(result_loc->value->type->data.pointer.child_type)) {
+ ZigType *res_child_type = result_loc->value->type->data.pointer.child_type;
+ if (res_child_type == ira->codegen->builtin_types.entry_var) {
+ res_child_type = impl_fn_type_id->return_type;
+ }
+ if (!handle_is_ptr(res_child_type)) {
ir_reset_result(call_result_loc);
result_loc = nullptr;
}
@@ -18240,7 +18244,11 @@ static IrInstruction *ir_analyze_fn_call(IrAnalyze *ira, IrInstruction *source_i
if (type_is_invalid(result_loc->value->type) || instr_is_unreachable(result_loc)) {
return result_loc;
}
- if (!handle_is_ptr(result_loc->value->type->data.pointer.child_type)) {
+ ZigType *res_child_type = result_loc->value->type->data.pointer.child_type;
+ if (res_child_type == ira->codegen->builtin_types.entry_var) {
+ res_child_type = return_type;
+ }
+ if (!handle_is_ptr(res_child_type)) {
ir_reset_result(call_result_loc);
result_loc = nullptr;
}