diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-08-30 02:41:27 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-08-30 02:41:27 -0400 |
| commit | 010b725bdef57eee969668087c8737e053b10e9f (patch) | |
| tree | 39945bc7b66f480d281d76b7e112e0a1f36f71ae /src/ir.cpp | |
| parent | 5482f9f9e8b66ba0ad1c38384b1c3df8e1381308 (diff) | |
| download | zig-010b725bdef57eee969668087c8737e053b10e9f.tar.gz zig-010b725bdef57eee969668087c8737e053b10e9f.zip | |
add alignment field to pointer type
Diffstat (limited to 'src/ir.cpp')
| -rw-r--r-- | src/ir.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ir.cpp b/src/ir.cpp index e5f72f901e..40d1a3d10c 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -11472,6 +11472,14 @@ static TypeTableEntry *ir_analyze_instruction_field_ptr(IrAnalyze *ira, IrInstru create_const_type(ira->codegen, child_type->data.pointer.child_type), ira->codegen->builtin_types.entry_type, ConstPtrMutComptimeConst, ptr_is_const, ptr_is_volatile); + } else if (buf_eql_str(field_name, "alignment")) { + 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.pointer.alignment, 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'", |
