Skip to content
This repository was archived by the owner on Jun 20, 2019. It is now read-only.

Commit f7ad1ef

Browse files
committed
Merge pull request #128 from ibuclaw/rm_irstate
Remove all IRState methods from GDC
2 parents 3c220ea + d8998e4 commit f7ad1ef

26 files changed

+1576
-1698
lines changed

gcc/d/ChangeLog

+119
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,122 @@
1+
2015-08-07 Iain Buclaw <[email protected]>
2+
3+
* d-codegen.cc(build_closure): Update signature, update all callers.
4+
(build_vthis): Likewise.
5+
(get_frame_for_symbol): Likewise.
6+
(build_local_var): Likewise.
7+
(get_decl_tree): Likewise.
8+
(start_function): Likewise.
9+
* d-irstate.h(IRState): Move func, mod, sthis, deferred,
10+
statementList, and varsInScope fields to...
11+
* d-tree.h(language_function): Here, updated all uses.
12+
* d-irstate.h: Remove file.
13+
(IRState): Remove all uses everywhere.
14+
15+
2015-08-07 Iain Buclaw <[email protected]>
16+
17+
* Make-lang.in(D_GLUE_OBJS): Remove d-irstate.o.
18+
* d-tree.h(d_label_use_entry): New structure.
19+
(d_label_entry): New structure.
20+
(binding_level): Add level_kind field.
21+
(language_function): Add hash table field for labels.
22+
(D_LABEL_VARIABLE_CASE): New macro.
23+
* d-codegen.cc(pop_binding_label): New function.
24+
(pop_label): New function.
25+
(push_binding_level): Update signature.
26+
(pop_binding_level): Update signature. Handle declared or used labels.
27+
(build_array_set): Update for push/pop binding changes.
28+
(check_goto): New function.
29+
(check_previous_goto): New function.
30+
(d_lookup_label): Remove function.
31+
(lookup_label): New function.
32+
(lookup_bc_label): New function.
33+
(define_label): New function.
34+
* d-objfile(FuncDeclaration::toObjFile): Update for push/pop binding
35+
changes.
36+
* toir.cc(IRVisitor): Add break and continue label fields.
37+
(IRVisitor::IRVisitor): Initialize here.
38+
(IRVisitor::start_scope): Update signature.
39+
(IRVisitor::end_scope): Return the finished scope, updated all callers.
40+
(IRVisitor::push_break_label): New function.
41+
(IRVisitor::pop_break_label): New function.
42+
(IRVisitor::push_continue_label): New function.
43+
(IRVisitor::pop_continue_label): New function.
44+
(IRVisitor::start_condition): Remove function.
45+
(IRVisitor::start_else): Remove function.
46+
(IRVisitor::end_condition): Remove function.
47+
(IRVisitor::start_catches): Remove function.
48+
(IRVisitor::start_catch): Remove function.
49+
(IRVisitor::end_catch): Remove function.
50+
(IRVisitor::end_catches): Remove function.
51+
(IRVisitor::start_finally): Remove function.
52+
(IRVisitor::end_finally): Remove function.
53+
(IRVisitor::start_case): Remove function.
54+
(IRVisitor::end_case): Remove function.
55+
* d-irstate.cc: Remove.
56+
57+
2015-08-06 Iain Buclaw <[email protected]>
58+
59+
* config-lang.in(gtfiles): Replace d-lang.h for d-tree.h
60+
* d-lang.h: Move all GTY structures to d-tree.h, updated all source
61+
header dependencies.
62+
* d-tree.h: New file.
63+
64+
2015-08-04 Iain Buclaw <[email protected]>
65+
66+
* toir.cc(IRVisitor::start_condition): Don't cache condition.
67+
(IRVisitor::start_else): Return the then body, updated all callers.
68+
(IRVisitor::end_condition): Update signature.
69+
(IRVisitor::start_catches): Return the try body, updated all callers.
70+
(IRVisitor::start_catch): Don't cache catch type.
71+
(IRVisitor::end_catch): Update signature.
72+
(IRVisitor::end_catches): Update signature.
73+
(IRVisitor::start_finally): Return the try body, updated all callers.
74+
(IRVisitor::end_finally): Update signature.
75+
(IRVisitor::start_case): Don't cache the condition.
76+
(IRVisitor::end_case): Update signature.
77+
* d-codegen.cc(convert_for_assignment): Use size_type_node for index.
78+
* d-irstate.cc(IRState::beginFlow): Remove call to push_stmt_list.
79+
80+
2015-08-04 Iain Buclaw <[email protected]>
81+
82+
* d-codegen.cc(push_stmt_list): New function.
83+
(pop_stmt_list): New function.
84+
(add_stmt): New function.
85+
(start_function): New function.
86+
(end_function): New function.
87+
(expand_decl): Update to use new interface.
88+
(build_closure): Likewise.
89+
(push_binding_level): Moved from d-lang.cc.
90+
(pop_binding_level): Likewise.
91+
* d-lang.cc(d_init): Inline call to init_global_binding_level.
92+
(alloc_binding_level): Remove function.
93+
(push_binding_level): Remove function.
94+
(pop_binding_level): Remove function.
95+
(init_global_binding_level): Remove function.
96+
(set_decl_binding_chain): Remove function.
97+
* d-elem.cc(DeclarationExp::toElem): Likewise.
98+
* d-objfile.cc(VarDeclaration::toObjFile): Likewise.
99+
(FuncDeclaration::toObjFile): Likewise.
100+
* toir.cc(IRVisitor::start_scope): Moved from d-irstate.cc, updated
101+
all callers in IRVisitor.
102+
(IRVisitor::end_scope): Likewise.
103+
(IRVisitor::is_return_label): Likewise.
104+
(IRVisitor::do_label): Likewise.
105+
(IRVisitor::do_jump): Likewise.
106+
(IRVisitor::start_condition): Likewise.
107+
(IRVisitor::start_else): Likewise.
108+
(IRVisitor::end_condition): Likewise.
109+
(IRVisitor::start_catches): Likewise.
110+
(IRVisitor::start_catch): Likewise.
111+
(IRVisitor::end_catch): Likewise.
112+
(IRVisitor::end_catches): Likewise.
113+
(IRVisitor::start_finally): Likewise.
114+
(IRVisitor::end_finally): Likewise.
115+
(IRVisitor::end_loop): Likewise.
116+
(IRVisitor::start_case): Likewise.
117+
(IRVisitor::end_case): Likewise.
118+
(build_ir): Update signature.
119+
1120
2015-08-01 Iain Buclaw <[email protected]>
2121

3122
* Make-lang.in(DMD_COMPILE): Declare as COMPILE with WARN_CXXFLAGS

gcc/d/Make-lang.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ D_GENERATED_OBJS = d/id.o d/impcnvtab.o
8484

8585
# D Glue object files.
8686
D_GLUE_OBJS = d/d-attribs.o d/d-lang.o d/d-decls.o \
87-
d/d-codegen.o d/d-objfile.o d/d-irstate.o \
87+
d/d-codegen.o d/d-objfile.o \
8888
d/d-convert.o d/d-todt.o d/d-longdouble.o \
8989
d/d-builtins.o d/d-incpath.o d/types.o \
9090
d/d-elem.o d/toir.o d/d-typinf.o \

gcc/d/config-lang.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ compilers="cc1d\$(exeext)"
2828

2929
target_libs="target-libphobos target-zlib target-libbacktrace"
3030

31-
gtfiles="\$(srcdir)/d/d-builtins.cc \$(srcdir)/d/d-lang.cc \$(srcdir)/d/d-lang.h"
31+
gtfiles="\$(srcdir)/d/d-tree.h \$(srcdir)/d/d-builtins.cc \$(srcdir)/d/d-lang.cc"
3232

3333
# Do not build by default.
3434
build_by_default="no"

gcc/d/d-attribs.c

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "varasm.h"
4040
#include "attribs.h"
4141

42+
#include "d-tree.h"
4243
#include "d-lang.h"
4344
#include "d-codegen.h"
4445

gcc/d/d-builtins.cc

+1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include "stringpool.h"
3636
#include "stor-layout.h"
3737

38+
#include "d-tree.h"
3839
#include "d-lang.h"
3940
#include "d-codegen.h"
4041
#include "d-objfile.h"

0 commit comments

Comments
 (0)