Skip to content

Commit efdbede

Browse files
committed
breaking: remove field alignment kludge
This breaks behavior tests as well as compile error notes for generic function calls. However it introduces better circular dependency compile errors. The next step is to add Lazy Values to fix the regressions.
1 parent 81c441f commit efdbede

File tree

5 files changed

+201
-312
lines changed

5 files changed

+201
-312
lines changed

src/all_types.hpp

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,9 @@ struct IrExecutable {
6969
IrExecutable *source_exec;
7070
IrAnalyze *analysis;
7171
Scope *begin_scope;
72+
ErrorMsg *first_err_trace_msg;
7273
ZigList<Tld *> tld_list;
7374

74-
bool invalid;
7575
bool is_inline;
7676
bool is_generic_instantiation;
7777
bool need_err_code_spill;
@@ -1129,11 +1129,10 @@ struct ZigTypeStruct {
11291129
ResolveStatus resolve_status;
11301130

11311131
bool is_slice;
1132-
bool resolve_loop_flag; // set this flag temporarily to detect infinite loops
1133-
bool reported_infinite_err;
11341132
// whether any of the fields require comptime
11351133
// known after ResolveStatusZeroBitsKnown
11361134
bool requires_comptime;
1135+
bool resolve_loop_flag;
11371136
};
11381137

11391138
struct ZigTypeOptional {
@@ -1155,26 +1154,20 @@ struct ZigTypeErrorSet {
11551154

11561155
struct ZigTypeEnum {
11571156
AstNode *decl_node;
1158-
ContainerLayout layout;
1159-
uint32_t src_field_count;
11601157
TypeEnumField *fields;
1161-
bool is_invalid; // true if any fields are invalid
11621158
ZigType *tag_int_type;
11631159

11641160
ScopeDecls *decls_scope;
11651161

1166-
// set this flag temporarily to detect infinite loops
1167-
bool embedded_in_current;
1168-
bool reported_infinite_err;
1169-
// whether we've finished resolving it
1170-
bool complete;
1171-
1172-
bool zero_bits_loop_flag;
1173-
bool zero_bits_known;
1174-
11751162
LLVMValueRef name_function;
11761163

11771164
HashMap<Buf *, TypeEnumField *, buf_hash, buf_eql_buf> fields_by_name;
1165+
uint32_t src_field_count;
1166+
1167+
ContainerLayout layout;
1168+
ResolveStatus resolve_status;
1169+
1170+
bool resolve_loop_flag;
11781171
};
11791172

11801173
uint32_t type_ptr_hash(const ZigType *ptr);
@@ -1199,11 +1192,10 @@ struct ZigTypeUnion {
11991192
ResolveStatus resolve_status;
12001193

12011194
bool have_explicit_tag_type;
1202-
bool resolve_loop_flag; // set this flag temporarily to detect infinite loops
1203-
bool reported_infinite_err;
12041195
// whether any of the fields require comptime
12051196
// the value is not valid until zero_bits_known == true
12061197
bool requires_comptime;
1198+
bool resolve_loop_flag;
12071199
};
12081200

12091201
struct FnGenParamInfo {
@@ -1715,6 +1707,7 @@ struct CodeGen {
17151707
//////////////////////////// Runtime State
17161708
LLVMModuleRef module;
17171709
ZigList<ErrorMsg*> errors;
1710+
ErrorMsg *trace_err;
17181711
LLVMBuilderRef builder;
17191712
ZigLLVMDIBuilder *dbuilder;
17201713
ZigLLVMDICompileUnit *compile_unit;
@@ -1767,7 +1760,6 @@ struct CodeGen {
17671760
ZigList<Tld *> resolve_queue;
17681761
size_t resolve_queue_index;
17691762
ZigList<TimeEvent> timing_events;
1770-
ZigList<AstNode *> tld_ref_source_node_stack;
17711763
ZigList<ZigFn *> inline_fns;
17721764
ZigList<ZigFn *> test_fns;
17731765
ZigList<ErrorTableEntry *> errors_by_index;
@@ -1852,7 +1844,6 @@ struct CodeGen {
18521844
ZigFn *main_fn;
18531845
ZigFn *panic_fn;
18541846
TldFn *panic_tld_fn;
1855-
AstNode *root_export_decl;
18561847

18571848
WantPIC want_pic;
18581849
WantStackCheck want_stack_check;

0 commit comments

Comments
 (0)