diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-09-07 23:10:23 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-09-07 23:10:51 -0400 |
| commit | 9fb4d1fd6c521e1bc3b656315b9c693a9e8aa715 (patch) | |
| tree | e5500f9bcf0d0d857e4531a7b9873c64684f61a2 /src/ir.cpp | |
| parent | 9dfaf3166d161e125d70fac7bca5aab1ad02625b (diff) | |
| download | zig-9fb4d1fd6c521e1bc3b656315b9c693a9e8aa715.tar.gz zig-9fb4d1fd6c521e1bc3b656315b9c693a9e8aa715.zip | |
std: os.ChildProcess knows when its child died
using signal handlers
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index 9e15bb1827..a30851d010 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -11513,6 +11513,28 @@ static TypeTableEntry *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstru buf_ptr(&child_type->name), buf_ptr(field_name))); return ira->codegen->builtin_types.entry_invalid; } + } else if (child_type->id == TypeTableEntryIdArray) { + if (buf_eql_str(field_name, "child")) { + bool ptr_is_const = true; + bool ptr_is_volatile = false; + return ir_analyze_const_ptr(ira, &field_ptr_instruction->base, + create_const_type(ira->codegen, child_type->data.array.child_type), + ira->codegen->builtin_types.entry_type, + ConstPtrMutComptimeConst, ptr_is_const, ptr_is_volatile); + } else if (buf_eql_str(field_name, "len")) { + bool ptr_is_const = true; + bool ptr_is_volatile = false; + return ir_analyze_const_ptr(ira, &field_ptr_instruction->base, + create_const_unsigned_negative(ira->codegen->builtin_types.entry_num_lit_int, + child_type->data.array.len, false), + ira->codegen->builtin_types.entry_num_lit_int, + ConstPtrMutComptimeConst, ptr_is_const, ptr_is_volatile); + } else { + ir_add_error(ira, &field_ptr_instruction->base, + buf_sprintf("type '%s' has no member called '%s'", + buf_ptr(&child_type->name), buf_ptr(field_name))); + return ira->codegen->builtin_types.entry_invalid; + } } else { ir_add_error(ira, &field_ptr_instruction->base, buf_sprintf("type '%s' does not support field access", buf_ptr(&child_type->name))); |
