aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2018-02-27 17:46:13 -0500
committerAndrew Kelley <superjoe30@gmail.com>2018-02-27 17:46:13 -0500
commit138d6f909321fb4fddeaa172357336c384c64eda (patch)
treee7a2ade11ed965e9e24f38e9b5c8e5d51c5eade5 /src/analyze.cpp
parent132e604aa399a3bcb91996e550cf8972bd88422c (diff)
downloadzig-138d6f909321fb4fddeaa172357336c384c64eda.tar.gz
zig-138d6f909321fb4fddeaa172357336c384c64eda.zip
revert workaround for alloc and free as coro params
reverts 4ac6c4d6bfb8f7ada2799ddb5ce3a9797be0518d the workaround didn't work
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp34
1 files changed, 4 insertions, 30 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 09c5566c5f..f95c9396cb 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -1006,13 +1006,13 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id) {
fn_type_id->return_type->id == TypeTableEntryIdErrorSet);
// +1 for maybe making the first argument the return value
// +1 for maybe first argument the error return trace
- // +4 for maybe arguments async allocator and error code pointer
- LLVMTypeRef *gen_param_types = allocate<LLVMTypeRef>(6 + fn_type_id->param_count);
+ // +2 for maybe arguments async allocator and error code pointer
+ LLVMTypeRef *gen_param_types = allocate<LLVMTypeRef>(4 + fn_type_id->param_count);
// +1 because 0 is the return type and
// +1 for maybe making first arg ret val and
// +1 for maybe first argument the error return trace
- // +4 for maybe arguments async allocator and error code pointer
- ZigLLVMDIType **param_di_types = allocate<ZigLLVMDIType*>(7 + fn_type_id->param_count);
+ // +2 for maybe arguments async allocator and error code pointer
+ ZigLLVMDIType **param_di_types = allocate<ZigLLVMDIType*>(5 + fn_type_id->param_count);
param_di_types[0] = fn_type_id->return_type->di_type;
size_t gen_param_index = 0;
TypeTableEntry *gen_return_type;
@@ -1053,32 +1053,6 @@ TypeTableEntry *get_fn_type(CodeGen *g, FnTypeId *fn_type_id) {
}
{
- // async alloc fn param
- assert(fn_type_id->async_allocator_type->id == TypeTableEntryIdPointer);
- TypeTableEntry *struct_type = fn_type_id->async_allocator_type->data.pointer.child_type;
- TypeStructField *alloc_fn_field = find_struct_type_field(struct_type, buf_create_from_str("allocFn"));
- assert(alloc_fn_field->type_entry->id == TypeTableEntryIdFn);
- TypeTableEntry *gen_type = alloc_fn_field->type_entry;
- gen_param_types[gen_param_index] = gen_type->type_ref;
- gen_param_index += 1;
- // after the gen_param_index += 1 because 0 is the return type
- param_di_types[gen_param_index] = gen_type->di_type;
- }
-
- {
- // async free fn param
- assert(fn_type_id->async_allocator_type->id == TypeTableEntryIdPointer);
- TypeTableEntry *struct_type = fn_type_id->async_allocator_type->data.pointer.child_type;
- TypeStructField *free_fn_field = find_struct_type_field(struct_type, buf_create_from_str("freeFn"));
- assert(free_fn_field->type_entry->id == TypeTableEntryIdFn);
- TypeTableEntry *gen_type = free_fn_field->type_entry;
- gen_param_types[gen_param_index] = gen_type->type_ref;
- gen_param_index += 1;
- // after the gen_param_index += 1 because 0 is the return type
- param_di_types[gen_param_index] = gen_type->di_type;
- }
-
- {
// error code pointer
TypeTableEntry *gen_type = get_pointer_to_type(g, g->builtin_types.entry_global_error_set, false);
gen_param_types[gen_param_index] = gen_type->type_ref;