More declarations
This commit is contained in:
parent
8c164a3b09
commit
2aa64f4a37
@ -38,6 +38,7 @@ static AST *varify(AST *tlc, AST *chunk, AST **stmtPrev, AST *stmt, AST *e) {
|
||||
assign->nodeKind = AST_STMT_ASSIGN;
|
||||
assign->what = (AST*) ev[0];
|
||||
assign->to = e;
|
||||
vte->data.var.declaration = (AST*) assign;
|
||||
|
||||
if(*stmtPrev) {
|
||||
(*stmtPrev)->statement.next = (AST*) assign;
|
||||
@ -96,6 +97,7 @@ static void ast_segmented_dereference_visitor(AST **aptr, AST *stmt, AST *stmtPr
|
||||
ass->what = (AST*) ev;
|
||||
ass->to = (AST*) edseg;
|
||||
ass->next = (AST*) stmt;
|
||||
si->data.var.declaration = (AST*) ass;
|
||||
if(stmtPrev)
|
||||
stmtPrev->statement.next = (AST*) ass;
|
||||
else
|
||||
|
||||
@ -51,6 +51,7 @@ static void ast_decompose_automatic_record(AST *tlc, ScopeItem *target) {
|
||||
si->kind = SCOPEITEM_VAR;
|
||||
si->type = target->type->record.fieldTypes[f];
|
||||
si->data.var.name = malp("%s_sroa_%s", target->data.var.name, target->type->record.fieldNames[f]);
|
||||
si->data.var.declaration = target->data.var.declaration;
|
||||
state.replacements[f] = si;
|
||||
|
||||
tlc->chunk.vars[tlc->chunk.varCount++] = si;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user