4242#include " d-tree.h"
4343#include " d-lang.h"
4444#include " d-objfile.h"
45- #include " d-irstate.h"
4645#include " d-codegen.h"
4746#include " id.h"
4847
@@ -213,7 +212,7 @@ add_stmt(tree t)
213212}
214213
215214//
216- IRState *
215+ void
217216start_function (FuncDeclaration *decl)
218217{
219218 cfun->language = ggc_cleared_alloc<language_function>();
@@ -231,8 +230,6 @@ start_function(FuncDeclaration *decl)
231230 }
232231 gcc_assert (cfun->language ->module != NULL );
233232
234- current_irstate = new IRState ();
235-
236233 // Check if we have a static this or unitest function.
237234 ModuleInfo *mi = current_module_info;
238235
@@ -256,8 +253,6 @@ start_function(FuncDeclaration *decl)
256253 }
257254 else if (decl->isUnitTestDeclaration ())
258255 mi->unitTests .safe_push (decl);
259-
260- return current_irstate;
261256}
262257
263258void
@@ -921,11 +916,11 @@ d_array_convert (Expression *exp)
921916 TY ty = exp->type ->toBasetype ()->ty ;
922917
923918 if (ty == Tarray)
924- return exp->toElem (current_irstate );
919+ return exp->toElem ( NULL );
925920 else if (ty == Tsarray)
926921 {
927922 Type *totype = exp->type ->toBasetype ()->nextOf ()->arrayOf ();
928- return convert_expr (exp->toElem (current_irstate ), exp->type , totype);
923+ return convert_expr (exp->toElem ( NULL ), exp->type , totype);
929924 }
930925
931926 // Invalid type passed.
@@ -1172,7 +1167,7 @@ build_attributes (Expressions *in_attrs)
11721167 aet = build_string (s->len , (const char *) s->string );
11731168 }
11741169 else
1175- aet = ae->toElem (current_irstate );
1170+ aet = ae->toElem ( NULL );
11761171
11771172 args = chainon (args, build_tree_list (0 , aet));
11781173 }
@@ -2211,13 +2206,13 @@ build_binop_assignment(tree_code code, Expression *e1, Expression *e2)
22112206 if (e1b->op == TOKcomma)
22122207 {
22132208 CommaExp *ce = (CommaExp *) e1b;
2214- lexpr = ce->e1 ->toElem (current_irstate );
2215- lhs = ce->e2 ->toElem (current_irstate );
2209+ lexpr = ce->e1 ->toElem (NULL );
2210+ lhs = ce->e2 ->toElem (NULL );
22162211 }
22172212 else
2218- lhs = e1b->toElem (current_irstate );
2213+ lhs = e1b->toElem (NULL );
22192214
2220- tree rhs = e2 ->toElem (current_irstate );
2215+ tree rhs = e2 ->toElem (NULL );
22212216
22222217 // Build assignment expression. Stabilize lhs for assignment.
22232218 lhs = stabilize_reference (lhs);
@@ -2392,7 +2387,6 @@ d_build_call (FuncDeclaration *fd, tree object, Expressions *args)
23922387tree
23932388d_build_call (TypeFunction *tf, tree callable, tree object, Expressions *arguments)
23942389{
2395- IRState *irs = cfun ? current_irstate : NULL ;
23962390 tree ctype = TREE_TYPE (callable);
23972391 tree callee = callable;
23982392 tree saved_args = NULL_TREE ;
@@ -2452,7 +2446,7 @@ d_build_call (TypeFunction *tf, tree callable, tree object, Expressions *argumen
24522446 if (arg->op == TOKcomma)
24532447 {
24542448 CommaExp *ce = (CommaExp *) arg;
2455- tree tce = ce->e1 ->toElem (irs );
2449+ tree tce = ce->e1 ->toElem ( NULL );
24562450 saved_args = maybe_vcompound_expr (saved_args, tce);
24572451 (*arguments)[i] = ce->e2 ;
24582452 goto Lagain;
@@ -2472,19 +2466,19 @@ d_build_call (TypeFunction *tf, tree callable, tree object, Expressions *argumen
24722466 if (i < dvarargs)
24732467 {
24742468 // The hidden _arguments parameter
2475- targ = arg->toElem (irs );
2469+ targ = arg->toElem ( NULL );
24762470 }
24772471 else if (i - dvarargs < nparams && i >= dvarargs)
24782472 {
24792473 // Actual arguments for declared formal arguments
24802474 Parameter *parg = Parameter::getNth (tf->parameters , i - dvarargs);
2481- targ = convert_for_argument (arg->toElem (irs ), arg, parg);
2475+ targ = convert_for_argument (arg->toElem ( NULL ), arg, parg);
24822476 }
24832477 else
24842478 {
24852479 // Not all targets support passing unpromoted types, so
24862480 // promote anyway.
2487- targ = arg->toElem (irs );
2481+ targ = arg->toElem ( NULL );
24882482 tree ptype = lang_hooks.types .type_promotes_to (TREE_TYPE (targ));
24892483
24902484 if (ptype != TREE_TYPE (targ))
@@ -3136,7 +3130,7 @@ build_float_modulus (tree type, tree arg0, tree arg1)
31363130tree
31373131build_typeinfo (Type *t)
31383132{
3139- tree tinfo = t->getInternalTypeInfo (NULL )->toElem (current_irstate );
3133+ tree tinfo = t->getInternalTypeInfo (NULL )->toElem ( NULL );
31403134 gcc_assert (POINTER_TYPE_P (TREE_TYPE (tinfo)));
31413135 return tinfo;
31423136}
0 commit comments