support addressof operator and struct pointer field access

This commit is contained in:
Andrew Kelley
2015-12-15 20:08:53 -07:00
parent 5a8822c714
commit aa56f016f7
6 changed files with 52 additions and 9 deletions

View File

@@ -248,6 +248,8 @@ static LLVMValueRef gen_field_access_expr(CodeGen *g, AstNode *node) {
TypeTableEntry *type_entry;
LLVMValueRef ptr = gen_field_ptr(g, node, &type_entry);
return LLVMBuildLoad(g->builder, ptr, "");
} else if (struct_type->id == TypeTableEntryIdPointer) {
zig_panic("TODO struct pointer access");
} else {
zig_panic("gen_field_access_expr bad struct type");
}