Provide build3() for older compilers and replace all build() statements 
with build2() and build3() in d glue layer.

Patch is against: svn revision 193

diffstat:
 d/d-builtins2.cc |    2 -
 d/d-codegen.cc   |   40 ++++++++++++-------------
 d/d-codegen.h    |   12 +++----
 d/d-convert.cc   |    8 ++---
 d/d-glue.cc      |   88 ++++++++++++++++++++++++++++-----------------------------
 d/d-lang.h       |    1 
 d/d-objfile.cc   |   10 +++---
 7 files changed, 81 insertions(+), 80 deletions(-)

=== d/d-glue.cc
==================================================================
--- d/d-glue.cc	(/mirror/dgcc)	(revision 163)
+++ d/d-glue.cc	(/local/dgcc)	(revision 163)
@@ -43,7 +43,7 @@
     tree cn = irs->convertForCondition( econd );
     tree t1 = e1->toElem( irs );
     tree t2 = e2->toElem( irs );
-    return build(COND_EXPR, type->toCtype(), cn, t1, t2);
+    return build3(COND_EXPR, type->toCtype(), cn, t1, t2);
 }
 
 static void
@@ -194,8 +194,8 @@
 		e1 = irs->maybeMakeTemp(e1);
 		e2 = irs->maybeMakeTemp(e2);
 		return irs->boolOp(TRUTH_ORIF_EXPR,
-		    build(LT_EXPR, boolean_type_node, e1, e2),
-		    build(GT_EXPR, boolean_type_node, e1, e2));
+		    build2(LT_EXPR, boolean_type_node, e1, e2),
+		    build2(GT_EXPR, boolean_type_node, e1, e2));
 	    }
 	    break;
 	default:
@@ -235,7 +235,7 @@
     if (is_compare)
 	signed_compare_check(& e1, & e2);
 
-    tree t = build(out_code, boolean_type_node, // exp->type->toCtype(),
+    tree t = build2(out_code, boolean_type_node, // exp->type->toCtype(),
 	e1, e2);
 #if D_GCC_VER >= 40
     /* Need to use fold().  Otherwise, complex-var == complex-cst is not
@@ -272,7 +272,7 @@
 
     switch (ty1) {
     case Tsarray:
-	return build(op == TOKidentity ? EQ_EXPR : NE_EXPR,
+	return build2(op == TOKidentity ? EQ_EXPR : NE_EXPR,
 	    type->toCtype(),
 	    irs->addressOf(e1->toElem(irs)),
 	    irs->addressOf(e2->toElem(irs)));
@@ -347,7 +347,7 @@
 	    tree result;
 	    tree size;
 
-	    size = build(MULT_EXPR, size_type_node,
+	    size = build2(MULT_EXPR, size_type_node,
 		convert(size_type_node, len_expr[0]), // should be size_type already, though
 		size_int(elem_type->size()));
 	    size = fold( size );
@@ -439,7 +439,7 @@
 	case TOKunord: 
 	case TOKleg:
 	    // %% Could do a check for side effects and drop the unused condition
-	    return build(COMPOUND_EXPR, boolean_type_node,
+	    return build2(COMPOUND_EXPR, boolean_type_node,
 		result, 
 		d_truthvalue_conversion( this->op == TOKunord ? integer_zero_node : integer_one_node ));
 	case TOKule: out_code = LE_EXPR; break;
@@ -453,7 +453,7 @@
 	    return 0;
 	}
 
-	result = build(out_code, boolean_type_node, result, integer_zero_node);
+	result = build2(out_code, boolean_type_node, result, integer_zero_node);
 	return convert(type->toCtype(), result);
     } else {
 	return make_bool_binop(this, irs);
@@ -488,7 +488,7 @@
 	    e_imag = e1;
 	}
 
-	return build(COMPLEX_EXPR, exp_type->toCtype(), e_real, e_imag);
+	return build2(COMPLEX_EXPR, exp_type->toCtype(), e_real, e_imag);
 	
     } else {
 	switch (op) {
@@ -527,7 +527,7 @@
 	tree e_new_type_1 = is_unsigned ?
 	    d_unsigned_type(exp_type->toCtype()) :
 	    d_signed_type(exp_type->toCtype());
-	tree t = build(out_code, e_new_type_1, e1, e2);
+	tree t = build2(out_code, e_new_type_1, e1, e2);
 	return convert(exp_type->toCtype(), t);
     } else {
 	/* Front-end does not do this conversion and GCC does not
@@ -539,7 +539,7 @@
 	else if (tc2 == COMPLEX_TYPE && tc1 != COMPLEX_TYPE)
 	    e1 = irs->convertTo(e1, e1_type, e2_type);
 
-	return build(out_code, exp_type->toCtype(), e1, e2);
+	return build2(out_code, exp_type->toCtype(), e1, e2);
     }
 }
 
@@ -559,7 +559,7 @@
     if (e2->type->toBasetype()->ty != Tvoid)
 	return make_bool_binop(this, irs);
     else
-	return build(COND_EXPR, type->toCtype(),
+	return build3(COND_EXPR, type->toCtype(),
 	    e1->toElem(irs), e2->toElem(irs), d_void_zero_node);
 }
 
@@ -569,7 +569,7 @@
     if (e2->type->toBasetype()->ty != Tvoid)
 	return make_bool_binop(this, irs);
     else
-	return build(COND_EXPR, type->toCtype(),
+	return build3(COND_EXPR, type->toCtype(),
 	    build1(TRUTH_NOT_EXPR, boolean_type_node, e1->toElem(irs)),
 	    e2->toElem(irs), d_void_zero_node);
 }
@@ -796,7 +796,7 @@
     tree src = make_math_op(out_code, lhs, lhs_type,
 	exp->e2->toElem(irs), exp->e2->type,
 	src_type, irs);
-    result = build(MODIFY_EXPR, exp->type->toCtype(),
+    result = build2(MODIFY_EXPR, exp->type->toCtype(),
 	tgt, irs->convertForAssignment(src, src_type, e1_to_use->type));
 
     return result;
@@ -878,14 +878,14 @@
 
     irs->continueHere();
     
-    irs->exitIfFalse( build(NE_EXPR, boolean_type_node, integer_zero_node, count_var) );
+    irs->exitIfFalse( build2(NE_EXPR, boolean_type_node, integer_zero_node, count_var) );
 
-    irs->doExp( build(MODIFY_EXPR, void_type_node, irs->indirect(ptr_var), value_to_use));
-    irs->doExp( build(MODIFY_EXPR, void_type_node, ptr_var,
-		    build(PLUS_EXPR, TREE_TYPE(ptr_var), ptr_var,
+    irs->doExp( build2(MODIFY_EXPR, void_type_node, irs->indirect(ptr_var), value_to_use));
+    irs->doExp( build2(MODIFY_EXPR, void_type_node, ptr_var,
+		    build2(PLUS_EXPR, TREE_TYPE(ptr_var), ptr_var,
 			TYPE_SIZE_UNIT(TREE_TYPE(TREE_TYPE(ptr_var))))) );
-    irs->doExp( build(MODIFY_EXPR, void_type_node, count_var,
-		    build(MINUS_EXPR, TREE_TYPE(count_var), count_var, integer_one_node)) );
+    irs->doExp( build2(MODIFY_EXPR, void_type_node, count_var,
+		    build2(MINUS_EXPR, TREE_TYPE(count_var), count_var, integer_one_node)) );
 
     irs->endLoop();
 
@@ -972,7 +972,7 @@
 		tree result;
 		tree size;
 
-		size = build(MULT_EXPR, size_type_node,
+		size = build2(MULT_EXPR, size_type_node,
 		    convert(size_type_node, irs->darrayLenRef(array[0])),
 		    size_int(elem_type->size()));
 		size = fold( size );
@@ -990,7 +990,7 @@
 	// Simple assignment
 	
 	tree lhs = irs->toElemLvalue(e1);
-	tree result = build(MODIFY_EXPR, type->toCtype(),
+	tree result = build2(MODIFY_EXPR, type->toCtype(),
 	    lhs, irs->convertForAssignment(e2, e1->type));
 
 	return result;
@@ -1010,7 +1010,7 @@
 	gcc_unreachable();
 	return irs->errorMark(type);
     }
-    tree result = build(tc, type->toCtype(),
+    tree result = build2(tc, type->toCtype(),
 	irs->toElemLvalue(e1), e2->toElem(irs));
     TREE_SIDE_EFFECTS(result) = 1;
     return result;
@@ -1040,7 +1040,7 @@
 	t = aoe.finish(irs, t);
 	if (global.params.useArrayBounds) {
 	    t = save_expr(t);
-	    t = build(COND_EXPR, TREE_TYPE(t), t, t,
+	    t = build3(COND_EXPR, TREE_TYPE(t), t, t,
 		irs->assertCall(loc, LIBCALL_ARRAY_BOUNDS));
 	}
 	t = irs->indirect(t, type->toCtype());
@@ -1064,7 +1064,7 @@
     }
     tree t1 = e1->toElem( irs );
     tree t2 = e2->toElem( irs );
-    return build(COMPOUND_EXPR, type->toCtype(), t1, t2);
+    return build2(COMPOUND_EXPR, type->toCtype(), t1, t2);
 }
 
 elem *
@@ -1136,7 +1136,7 @@
 	if (lwr_tree) {
 	    lwr_tree = irs->maybeMakeTemp(lwr_tree);
 	    // %% type
-	    final_len_expr = build(MINUS_EXPR, TREE_TYPE(final_len_expr), final_len_expr, lwr_tree);
+	    final_len_expr = build2(MINUS_EXPR, TREE_TYPE(final_len_expr), final_len_expr, lwr_tree);
 	}
     } else {
 	// If this is the case, than there is no lower bound specified and
@@ -1456,7 +1456,7 @@
 	    tree arg = e1->toElem(irs);
 	    if (cd->isCOMclass())
 	    {
-		return build(COND_EXPR, void_type_node,
+		return build3(COND_EXPR, void_type_node,
 		    irs->boolOp(NE_EXPR, arg, d_null_pointer),
 		    d_void_zero_node, assert_call);
 	    }
@@ -1484,11 +1484,11 @@
 		}
 	    }
 
-	    result = build(COND_EXPR, void_type_node,
+	    result = build3(COND_EXPR, void_type_node,
 		irs->convertForCondition( e1_t, e1->type ),
 		d_void_zero_node, assert_call);
 	    if (invc)
-		result = build(COMPOUND_EXPR, void_type_node, result, invc);
+		result = build2(COMPOUND_EXPR, void_type_node, result, invc);
 	    return result;
 	}
     } else
@@ -1663,7 +1663,7 @@
 	return convert(type->toCtype(), a);
     
     b = irs->integerConstant(offset, Type::tsize_t);
-    return build(PLUS_EXPR, type->toCtype(), a, b) ;
+    return build2(PLUS_EXPR, type->toCtype(), a, b) ;
 }
 
 bool
@@ -1761,14 +1761,14 @@
 		tree stack_var = irs->localVar( rec_type );
 		irs->expandDecl(stack_var);
 		new_call = irs->addressOf(stack_var);
-		setup_exp = build(MODIFY_EXPR, rec_type,
+		setup_exp = build2(MODIFY_EXPR, rec_type,
 		    irs->indirect(new_call, rec_type),
 		    class_decl->toInitializer()->Stree);
 	    } else if (allocator) {
 		new_call = irs->call(allocator, newargs);
 		new_call = save_expr( new_call );
 		// copy memory...
-		setup_exp = build(MODIFY_EXPR, rec_type,
+		setup_exp = build2(MODIFY_EXPR, rec_type,
 		    irs->indirect(new_call, rec_type),
 		    class_decl->toInitializer()->Stree);
 	    } else {
@@ -1814,7 +1814,7 @@
 		if (vthis_value) {
 		    new_call = save_expr( new_call );
 		    setup_exp = irs->maybeCompound(setup_exp,
-			build(MODIFY_EXPR, TREE_TYPE(vthis_field),
+			build2(MODIFY_EXPR, TREE_TYPE(vthis_field),
 			    irs->component( irs->indirect(new_call, rec_type),
 				vthis_field ),
 			    vthis_value));
@@ -1921,7 +1921,7 @@
 		// Save the result allocation call.
 		new_call = save_expr( new_call );
 		t = irs->indirect(new_call);
-		t = build(MODIFY_EXPR, TREE_TYPE(t), t,
+		t = build2(MODIFY_EXPR, TREE_TYPE(t), t,
 		    irs->convertForAssignment(object_type->defaultInit(), object_type) );
 		new_call = irs->compound(t, new_call);
 	    }
@@ -2554,7 +2554,7 @@
 	
 	irs->expandDecl(result_var);
 	irs->doAsm(nop_str, out_arg, NULL_TREE, NULL_TREE);
-	irs->doReturn( build(MODIFY_EXPR, TREE_TYPE(result_decl),
+	irs->doReturn( build2(MODIFY_EXPR, TREE_TYPE(result_decl),
 			   result_decl, result_var) );
     }
 #endif
@@ -3365,7 +3365,7 @@
     // %% doc: this is not the same as a start_eh/end_eh_cleanup sequence
     tree t_body = body ? irs->makeStmtExpr(body) : d_void_zero_node;
     tree t_finl = finalbody ? irs->makeStmtExpr(finalbody) : d_void_zero_node;
-    tree tf = build(TRY_FINALLY_EXPR, void_type_node, t_body, t_finl);
+    tree tf = build2(TRY_FINALLY_EXPR, void_type_node, t_body, t_finl);
     // TREE_SIDE_EFFECTS(tf) = 1; // probably not needed
     irs->doLineNote(loc);
     irs->doExp(tf);
@@ -3545,7 +3545,7 @@
                 ret_type = Type::tint32;
 	    
 	    tree result_decl = DECL_RESULT( irs->func->toSymbol()->Stree );
-	    tree result_assign = build ( MODIFY_EXPR,
+	    tree result_assign = build2 ( MODIFY_EXPR,
 		TREE_TYPE( result_decl ), result_decl,
 		// %% convert for init -- if we were returning a reference,
 		// would want to take the address...
@@ -3757,21 +3757,21 @@
 	iter_op = MINUS_EXPR;
     }
 
-    tree condition = build(NE_EXPR, boolean_type_node, iter_decl, bound_expr);
+    tree condition = build2(NE_EXPR, boolean_type_node, iter_decl, bound_expr);
     tree incr_expr =
-	build(MODIFY_EXPR, void_type_node, iter_decl,
-	    build(iter_op, TREE_TYPE(iter_decl), iter_decl,
+	build2(MODIFY_EXPR, void_type_node, iter_decl,
+	    build2(iter_op, TREE_TYPE(iter_decl), iter_decl,
 		size_int(elem_type->size())));
     if (key) {
 	tree key_decl = key->toSymbol()->Stree;
 	tree key_incr_expr =
-	    build(MODIFY_EXPR, void_type_node, key_decl,
-		build(iter_op, TREE_TYPE(key_decl), key_decl,
+	    build2(MODIFY_EXPR, void_type_node, key_decl,
+		build2(iter_op, TREE_TYPE(key_decl), key_decl,
 		    irs->integerConstant(1, TREE_TYPE(key_decl))));
 	incr_expr = irs->compound(incr_expr, key_incr_expr);
     }
 
-    irs->doExp( build(MODIFY_EXPR, void_type_node, iter_decl, iter_init_expr) );
+    irs->doExp( build2(MODIFY_EXPR, void_type_node, iter_decl, iter_init_expr) );
 
     irs->startLoop(this);
     irs->exitIfFalse(condition);
@@ -3779,7 +3779,7 @@
 	irs->doExp( incr_expr );
     if ( iter_decl != value->toSymbol()->Stree ) {
 	// %% check..
-	irs->doExp( build(MODIFY_EXPR, void_type_node, value->toSymbol()->Stree,
+	irs->doExp( build2(MODIFY_EXPR, void_type_node, value->toSymbol()->Stree,
 			irs->indirect(iter_decl)) );
     }
     if (body)
=== d/d-objfile.cc
==================================================================
--- d/d-objfile.cc	(/mirror/dgcc)	(revision 163)
+++ d/d-objfile.cc	(/local/dgcc)	(revision 163)
@@ -710,7 +710,7 @@
 	    if (! exp)
 		exp = call_exp;
 	    else {
-		exp = build(COMPOUND_EXPR, void_type_node, exp, call_exp);
+		exp = build2(COMPOUND_EXPR, void_type_node, exp, call_exp);
 	    }
 	}
 
@@ -859,7 +859,7 @@
 	// %% make sure this is the target word type
 	return gen.integerConstant(dt->DTint, Type::tsize_t);
     case DT_xoff:
-	return build(PLUS_EXPR, ptr_type_node,
+	return build2(PLUS_EXPR, ptr_type_node,
 	    gen.addressOf(check_static_sym(dt->DTsym)),
 	    gen.integerConstant(dt->DTint, Type::tsize_t) );
     case DT_tree:
@@ -1048,12 +1048,12 @@
     DECL_EXTERNAL( the_mod_ref ) = 1;
     TREE_PUBLIC( the_mod_ref ) = 1;
 
-    tree m1 = build(MODIFY_EXPR, void_type_node,
+    tree m1 = build2(MODIFY_EXPR, void_type_node,
 	gen.component(our_mod_ref, f0),
 	the_mod_ref);
-    tree m2 = build(MODIFY_EXPR, void_type_node,
+    tree m2 = build2(MODIFY_EXPR, void_type_node,
 	the_mod_ref, gen.addressOf(our_mod_ref));
-    tree exp = build(COMPOUND_EXPR, void_type_node, m1, m2);
+    tree exp = build2(COMPOUND_EXPR, void_type_node, m1, m2);
 
     g.ofile->doSimpleFunction("*__modinit", exp, true);
 }
=== d/d-codegen.cc
==================================================================
--- d/d-codegen.cc	(/mirror/dgcc)	(revision 163)
+++ d/d-codegen.cc	(/local/dgcc)	(revision 163)
@@ -269,9 +269,9 @@
 		} else if (offset) {
 		    tree t = target_type->toCtype();
 		    exp = maybeMakeTemp(exp);
-		    return build(COND_EXPR, t,
+		    return build3(COND_EXPR, t,
 			boolOp(NE_EXPR, exp, nullPointer()),
-			build(PLUS_EXPR, t, exp, size_int(offset)),
+			build2(PLUS_EXPR, t, exp, size_int(offset)),
 			nullPointer());
 		} else {
 		    // d_convert will make a NOP cast
@@ -427,7 +427,7 @@
 		// default conversion
 		break;
 	    }
-	    result = build(COMPLEX_EXPR, target_type->toCtype(), c1, c2);
+	    result = build2(COMPLEX_EXPR, target_type->toCtype(), c1, c2);
 	} else {
 	    assert( TREE_CODE( exp ) != STRING_CST );
 	    // default conversion
@@ -505,7 +505,7 @@
 	TREE_TYPE( ctor ) = target_type->toCtype();
 	if (count) {
 	    CtorEltMaker ce;
-	    ce.cons( build(RANGE_EXPR, Type::tsize_t->toCtype(),
+	    ce.cons( build2(RANGE_EXPR, Type::tsize_t->toCtype(),
 		    integer_zero_node, integerConstant( count - 1 )),
 		g.ofile->stripVarDecl(convertForAssignment(exp, sa_type->next)));
 	    CONSTRUCTOR_ELTS( ctor ) = ce.head;
@@ -570,12 +570,12 @@
 	a = delegateObjectRef(tmp);
 	b = delegateMethodRef(tmp);
 	if (TYPE_MODE(TREE_TYPE(a)) == TYPE_MODE(TREE_TYPE(b)))
-	    result = build(BIT_IOR_EXPR, TREE_TYPE(a), a, b);
+	    result = build2(BIT_IOR_EXPR, TREE_TYPE(a), a, b);
 	else {
 	    a = d_truthvalue_conversion(a);
 	    b = d_truthvalue_conversion(b);
 	    // probably not worth TRUTH_OROR ...
-	    result = build(TRUTH_OR_EXPR, TREE_TYPE(a), a, b);
+	    result = build2(TRUTH_OR_EXPR, TREE_TYPE(a), a, b);
 	}
 	break;
     case Tdelegate:
@@ -590,7 +590,7 @@
 	}
 	// not worth using  or TRUTH_ORIF...
 	// %%TODO: Is this okay for all targets?
-	result = build(BIT_IOR_EXPR, TREE_TYPE(a), a, b);
+	result = build2(BIT_IOR_EXPR, TREE_TYPE(a), a, b);
 	break;
     default:
 	break;
@@ -646,7 +646,7 @@
     if ( integer_zerop(intop) )
 	return ptr_node;
     else
-	return build(PLUS_EXPR, result_type_node, ptr_node, intop);
+	return build2(PLUS_EXPR, result_type_node, ptr_node, intop);
 }
 
 // Doesn't do some of the omptimizations in ::makeArrayElemRef
@@ -654,7 +654,7 @@
 IRState::checkedIndex(Loc loc, tree index, tree upper_bound, bool inclusive)
 {
     if (global.params.useArrayBounds) {
-	return build(COND_EXPR, TREE_TYPE(index),
+	return build3(COND_EXPR, TREE_TYPE(index),
 	    boundsCond(index, upper_bound, inclusive),
 	    index,
 	    assertCall(loc, LIBCALL_ARRAY_BOUNDS));
@@ -670,14 +670,14 @@
 {
     tree bound_check;
 
-    bound_check = build(inclusive ? LE_EXPR : LT_EXPR, boolean_type_node,
+    bound_check = build2(inclusive ? LE_EXPR : LT_EXPR, boolean_type_node,
 	convert( d_unsigned_type(TREE_TYPE(index)), index ),
 	upper_bound);
     
     if (! TREE_UNSIGNED( TREE_TYPE( index ))) {
-	bound_check = build(TRUTH_ANDIF_EXPR, boolean_type_node, bound_check,
+	bound_check = build2(TRUTH_ANDIF_EXPR, boolean_type_node, bound_check,
 	    // %% conversions
-	    build(GE_EXPR, boolean_type_node, index, integer_zero_node));
+	    build2(GE_EXPR, boolean_type_node, index, integer_zero_node));
     }
 
     return bound_check;
@@ -1488,7 +1488,7 @@
 		oob_cond = boundsCond(index_expr, array_len_expr, false);
 		throw_expr = assertCall(aer_exp->loc, LIBCALL_ARRAY_BOUNDS);
 
-		subscript_expr = build( COND_EXPR, TREE_TYPE( index_expr ),
+		subscript_expr = build3( COND_EXPR, TREE_TYPE( index_expr ),
 		    oob_cond, index_expr, throw_expr );
 	    }
 
@@ -1524,7 +1524,7 @@
     // Get the backend type for the array and pick out the array data
     // pointer field (assumed to be the second field.)
     tree ptr_field = TREE_CHAIN( TYPE_FIELDS( TREE_TYPE( exp )));
-    //return build(COMPONENT_REF, TREE_TYPE( ptr_field ), exp, ptr_field);
+    //return build2(COMPONENT_REF, TREE_TYPE( ptr_field ), exp, ptr_field);
     return component(exp, ptr_field);
 }
 
@@ -1734,7 +1734,7 @@
     // Get the backend type for the array and pick out the array data
     // pointer field (assumed to be the first field.)
     tree obj_field = TYPE_FIELDS( TREE_TYPE( exp ));
-    //return build(COMPONENT_REF, TREE_TYPE( obj_field ), exp, obj_field);
+    //return build2(COMPONENT_REF, TREE_TYPE( obj_field ), exp, obj_field);
     return component(exp, obj_field);
 }
 
@@ -1744,7 +1744,7 @@
     // Get the backend type for the array and pick out the array length
     // field (assumed to be the second field.)
     tree method_field = TREE_CHAIN( TYPE_FIELDS( TREE_TYPE( exp )));
-    //return build(COMPONENT_REF, TREE_TYPE( method_field ), exp, method_field);
+    //return build2(COMPONENT_REF, TREE_TYPE( method_field ), exp, method_field);
     return component(exp, method_field);
 }
 
@@ -1850,10 +1850,10 @@
 		vtbl_ref = indirect(this_expr);
 		
 	    tree field = TYPE_FIELDS( TREE_TYPE( vtbl_ref )); // the vtbl is the first field
-	    //vtbl_ref = build( COMPONENT_REF, TREE_TYPE( field ), vtbl_ref, field ); // vtbl field (a pointer)
+	    //vtbl_ref = build2( COMPONENT_REF, TREE_TYPE( field ), vtbl_ref, field ); // vtbl field (a pointer)
 	    vtbl_ref = component( vtbl_ref, field ); // vtbl field (a pointer)
 	    // %% better to do with array ref?
-	    vtbl_ref = build( PLUS_EXPR, TREE_TYPE(vtbl_ref), vtbl_ref,
+	    vtbl_ref = build2( PLUS_EXPR, TREE_TYPE(vtbl_ref), vtbl_ref,
 		size_int( PTRSIZE * func->vtblIndex ));
 	    vtbl_ref = indirect(vtbl_ref, TREE_TYPE( functionPointer(func) ));
 
@@ -2275,9 +2275,9 @@
     tree obj_type = getObjectType()->toCtype();
     // Like gjc, the actual D exception object is one
     // pointer behind the exception header
-    tree t = build (EXC_PTR_EXPR, ptr_type_node);
+    tree t = build0 (EXC_PTR_EXPR, ptr_type_node);
     t = build1(NOP_EXPR, build_pointer_type(obj_type), t); // treat exception header as ( Object* )
-    t = build(MINUS_EXPR, TREE_TYPE(t), t, TYPE_SIZE_UNIT(TREE_TYPE(t)));
+    t = build2(MINUS_EXPR, TREE_TYPE(t), t, TYPE_SIZE_UNIT(TREE_TYPE(t)));
     t = build1(INDIRECT_REF, obj_type, t);
     return t;
 }
=== d/d-lang.h
==================================================================
--- d/d-lang.h	(/mirror/dgcc)	(revision 163)
+++ d/d-lang.h	(/local/dgcc)	(revision 163)
@@ -211,6 +211,7 @@
 
 #if D_GCC_VER < 40
 static inline tree build2(enum tree_code c, tree t, tree a, tree b) { return build(c, t, a, b); }
+static inline tree build3(enum tree_code c, tree t, tree a, tree b, tree c) { return build(c, t, a, b, c); }
 #define gcc_assert(x) (assert(x))
 #define gcc_unreachable(x) (assert(0))
 #endif
=== d/d-builtins2.cc
==================================================================
--- d/d-builtins2.cc	(/mirror/dgcc)	(revision 163)
+++ d/d-builtins2.cc	(/local/dgcc)	(revision 163)
@@ -137,7 +137,7 @@
 	    tree length	    
 		= size_binop (PLUS_EXPR, size_one_node,
 				 convert (sizetype,
-					  fold (build (MINUS_EXPR,
+					  fold (build2 (MINUS_EXPR,
 						       TREE_TYPE (lb),
 						       ub, lb))));
 	    d = new TypeSArray(d,
=== d/d-convert.cc
==================================================================
--- d/d-convert.cc	(/mirror/dgcc)	(revision 163)
+++ d/d-convert.cc	(/local/dgcc)	(revision 163)
@@ -144,7 +144,7 @@
 	    op1 = convert (result_type, op1);
     }
 
-    return build(code, boolean_type_node, op0, op1);
+    return build2(code, boolean_type_node, op0, op1);
 }
 
 // These functions support calls from the backend.  This happens
@@ -272,7 +272,7 @@
 	break;
 
       if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 0)))
-	return build (COMPOUND_EXPR, boolean_type_node,
+	return build2 (COMPOUND_EXPR, boolean_type_node,
 		      TREE_OPERAND (expr, 0), boolean_true_node);
       else
 	return boolean_true_node;
@@ -296,14 +296,14 @@
       /* These don't change whether an object is zero or nonzero, but
 	 we can't ignore them if their second arg has side-effects.  */
       if (TREE_SIDE_EFFECTS (TREE_OPERAND (expr, 1)))
-	return build (COMPOUND_EXPR, boolean_type_node, TREE_OPERAND (expr, 1),
+	return build2 (COMPOUND_EXPR, boolean_type_node, TREE_OPERAND (expr, 1),
 		      d_truthvalue_conversion (TREE_OPERAND (expr, 0)));
       else
 	return d_truthvalue_conversion (TREE_OPERAND (expr, 0));
 
     case COND_EXPR:
       /* Distribute the conversion into the arms of a COND_EXPR.  */
-      return fold (build (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0),
+      return fold (build3 (COND_EXPR, boolean_type_node, TREE_OPERAND (expr, 0),
 		d_truthvalue_conversion (TREE_OPERAND (expr, 1)),
 		d_truthvalue_conversion (TREE_OPERAND (expr, 2))));
 
=== d/d-codegen.h
==================================================================
--- d/d-codegen.h	(/mirror/dgcc)	(revision 163)
+++ d/d-codegen.h	(/local/dgcc)	(revision 163)
@@ -288,7 +288,7 @@
     }
 
     tree boolOp(enum tree_code code, tree a, tree b) {
-	return build(code, boolean_type_node, a, b);
+	return build2(code, boolean_type_node, a, b);
     }
     
     tree checkedIndex(Loc loc, tree index, tree upper_bound, bool inclusive);
@@ -299,14 +299,14 @@
 #if D_GCC_VER < 40
     static tree binding(tree var_chain, tree body)
     {
-	return build(BIND_EXPR, TREE_TYPE(body), var_chain, body, NULL_TREE);
+	return build3(BIND_EXPR, TREE_TYPE(body), var_chain, body, NULL_TREE);
     }
 #else
     static tree binding(tree var_chain, tree body);
 #endif
     
     static tree compound(tree a, tree b, tree type = 0) {
-	return build(COMPOUND_EXPR, type ? type : TREE_TYPE(b), a, b);
+	return build2(COMPOUND_EXPR, type ? type : TREE_TYPE(b), a, b);
     }
     tree voidCompound(tree a, tree b) { return compound(a, b, void_type_node); }
     tree maybeCompound(tree a, tree b) {
@@ -315,13 +315,13 @@
 	else if (b == NULL_TREE)
 	    return a;
 	else
-	    return build(COMPOUND_EXPR, TREE_TYPE(b), a, b);
+	    return build2(COMPOUND_EXPR, TREE_TYPE(b), a, b);
     }
 
     static tree component(tree v, tree f)
     {
 #if D_GCC_VER < 40
-	return build(COMPONENT_REF, TREE_TYPE(f), v, f);
+	return build2(COMPONENT_REF, TREE_TYPE(f), v, f);
 #else
 	return build3(COMPONENT_REF, TREE_TYPE(f), v, f, NULL_TREE);
 #endif
@@ -356,7 +356,7 @@
     // and the SIDE_EFFECTS flags of the arguments.
     static tree buildCall(tree type, tree callee, tree args) {
 #if D_GCC_VER < 40
-	tree t = build(CALL_EXPR, type, callee, args);
+	tree t = build2(CALL_EXPR, type, callee, args);
 #else
 	tree t = build3(CALL_EXPR, type, callee, args, NULL_TREE);
 #endif

