This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] Replace build with buildN in the front ends


Hi,

Quite obvious.  Can there a "pre-approved-rule" for changes like this?

Gr.
Steven

	* objc/objc-act.c (objc_build_exc_ptr): Use build0 to build a
	EXC_PTR_EXPR.
	(next_sjlj_build_enter_and_setjmp): Use build2 to build a
	COMPOUND_EXPR, and build3 to build a COND_EXPR.
	(next_sjlj_build_exc_extract): Use build2 for a MODIFY_EXPR.
	(next_sjlj_build_catch_list): Use build3 for a COND_EXPR, and
	build2 for a MODIFY_EXPR.
	(next_sjlj_build_try_catch_finally): Use build3 for a BIND_EPXR,
	and build2 for a MODIFY_EXPR and a TRY_FINALLY_EXPR.
	(objc_begin_catch_clause): Use build2 for a MODIFY_EXPR.
	(build_objc_method_call): Use build3 for an OBJ_TYPE_REF.

cp/
	* decl.c (expand_static_init): Use build3, not build, to build
	a COND_EXPR.  Use build2 for a MODIFY_EXPR.

java/
	* class.c (finish_class): Use build1 to build a RETURN_EXPR.
	* expr.c (java_create_object): Use build3 to build a CALL_EXPR.
	* java-gimplify.c (java_gimplify_labeled_block_expr): Use build1
	to build a LABEL_EXPR, and build2 to build a COMPOUND_EXPR.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1371
diff -u -3 -p -r1.1371 decl.c
--- cp/decl.c	24 Feb 2005 21:21:27 -0000	1.1371
+++ cp/decl.c	26 Feb 2005 20:04:18 -0000
@@ -5294,15 +5294,16 @@ expand_static_init (tree decl, tree init
 	  flag = TARGET_EXPR_SLOT (begin);
 
 	  TARGET_EXPR_CLEANUP (begin)
-	    = build (COND_EXPR, void_type_node, flag,
-		     void_zero_node,
-		     build_call (abort_fn, guard_addr_list));
+	    = build3 (COND_EXPR, void_type_node, flag,
+		      void_zero_node,
+		      build_call (abort_fn, guard_addr_list));
 	  CLEANUP_EH_ONLY (begin) = 1;
 
 	  /* Do the initialization itself.  */
 	  init = add_stmt_to_compound (begin, init);
 	  init = add_stmt_to_compound
-	    (init, build (MODIFY_EXPR, void_type_node, flag, boolean_true_node));
+	    (init, build2 (MODIFY_EXPR, void_type_node, flag,
+			   boolean_true_node));
 	  init = add_stmt_to_compound
 	    (init, build_call (release_fn, guard_addr_list));
 	}
Index: java/class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.220
diff -u -3 -p -r1.220 class.c
--- java/class.c	24 Jan 2005 19:07:05 -0000	1.220
+++ java/class.c	26 Feb 2005 20:04:19 -0000
@@ -1890,7 +1890,7 @@ finish_class (void)
       tree verify_method = TYPE_VERIFY_METHOD (output_class);
       DECL_SAVED_TREE (verify_method) 
 	= add_stmt_to_compound (DECL_SAVED_TREE (verify_method), void_type_node,
-				build (RETURN_EXPR, void_type_node, NULL));
+				build1 (RETURN_EXPR, void_type_node, NULL));
       java_genericize (verify_method);
       cgraph_finalize_function (verify_method, false);
       TYPE_ASSERTIONS (current_class) = NULL;
Index: java/expr.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/expr.c,v
retrieving revision 1.218
diff -u -3 -p -r1.218 expr.c
--- java/expr.c	14 Feb 2005 14:58:22 -0000	1.218
+++ java/expr.c	26 Feb 2005 20:04:20 -0000
@@ -1364,10 +1364,10 @@ java_create_object (tree type)
 		     ? alloc_object_node
 		     : alloc_no_finalizer_node);
   
-  return build (CALL_EXPR, promote_type (type),
-		build_address_of (alloc_node),
-		build_tree_list (NULL_TREE, build_class_ref (type)),
-		NULL_TREE);
+  return build3 (CALL_EXPR, promote_type (type),
+		 build_address_of (alloc_node),
+		 build_tree_list (NULL_TREE, build_class_ref (type)),
+		 NULL_TREE);
 }
 
 static void
Index: java/java-gimplify.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/java-gimplify.c,v
retrieving revision 1.18
diff -u -3 -p -r1.18 java-gimplify.c
--- java/java-gimplify.c	2 Dec 2004 16:37:41 -0000	1.18
+++ java/java-gimplify.c	26 Feb 2005 20:04:20 -0000
@@ -186,9 +186,9 @@ java_gimplify_labeled_block_expr (tree e
   tree t;
 
   DECL_CONTEXT (label) = current_function_decl;
-  t = build (LABEL_EXPR, void_type_node, label);
+  t = build1 (LABEL_EXPR, void_type_node, label);
   if (body != NULL_TREE)
-    t = build (COMPOUND_EXPR, void_type_node, body, t);
+    t = build2 (COMPOUND_EXPR, void_type_node, body, t);
   return t;
 }
 
Index: objc/objc-act.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/objc/objc-act.c,v
retrieving revision 1.266
diff -u -3 -p -r1.266 objc-act.c
--- objc/objc-act.c	29 Jan 2005 12:16:34 -0000	1.266
+++ objc/objc-act.c	26 Feb 2005 20:04:22 -0000
@@ -2978,7 +2978,7 @@ objc_build_exc_ptr (void)
       return var;
     }
   else
-    return build (EXC_PTR_EXPR, objc_object_type);
+    return build0 (EXC_PTR_EXPR, objc_object_type);
 }
 
 /* Build "objc_exception_try_exit(&_stack)".  */
@@ -3018,10 +3018,10 @@ next_sjlj_build_enter_and_setjmp (void)
   t = tree_cons (NULL, t, NULL);
   sj = build_function_call (objc_setjmp_decl, t);
 
-  cond = build (COMPOUND_EXPR, TREE_TYPE (sj), enter, sj);
+  cond = build2 (COMPOUND_EXPR, TREE_TYPE (sj), enter, sj);
   cond = lang_hooks.truthvalue_conversion (cond);
 
-  return build (COND_EXPR, void_type_node, cond, NULL, NULL);
+  return build3 (COND_EXPR, void_type_node, cond, NULL, NULL);
 }
 
 /* Build
@@ -3037,7 +3037,7 @@ next_sjlj_build_exc_extract (tree decl)
   t = tree_cons (NULL, t, NULL);
   t = build_function_call (objc_exception_extract_decl, t);
   t = convert (TREE_TYPE (decl), t);
-  t = build (MODIFY_EXPR, void_type_node, decl, t);
+  t = build2 (MODIFY_EXPR, void_type_node, decl, t);
 
   return t;
 }
@@ -3088,7 +3088,7 @@ next_sjlj_build_catch_list (void)
 	      t = build_function_call (objc_exception_match_decl, args);
 	      cond = lang_hooks.truthvalue_conversion (t);
 	    }
-	  t = build (COND_EXPR, void_type_node, cond, body, NULL);
+	  t = build3 (COND_EXPR, void_type_node, cond, body, NULL);
 	  SET_EXPR_LOCUS (t, EXPR_LOCUS (stmt));
 
 	  *last = t;
@@ -3098,8 +3098,8 @@ next_sjlj_build_catch_list (void)
 
   if (!saw_id)
     {
-      t = build (MODIFY_EXPR, void_type_node, cur_try_context->rethrow_decl,
-		 cur_try_context->caught_decl);
+      t = build2 (MODIFY_EXPR, void_type_node, cur_try_context->rethrow_decl,
+		  cur_try_context->caught_decl);
       SET_EXPR_LOCATION (t, cur_try_context->end_catch_locus);
       append_to_statement_list (t, last);
 
@@ -3164,18 +3164,18 @@ next_sjlj_build_try_catch_finally (void)
   TREE_CHAIN (rethrow_decl) = stack_decl;
 
   /* Build the outermost variable binding level.  */
-  bind = build (BIND_EXPR, void_type_node, rethrow_decl, NULL, NULL);
+  bind = build3 (BIND_EXPR, void_type_node, rethrow_decl, NULL, NULL);
   SET_EXPR_LOCATION (bind, cur_try_context->try_locus);
   TREE_SIDE_EFFECTS (bind) = 1;
 
   /* Initialize rethrow_decl.  */
-  t = build (MODIFY_EXPR, void_type_node, rethrow_decl,
-	     convert (objc_object_type, null_pointer_node));
+  t = build2 (MODIFY_EXPR, void_type_node, rethrow_decl,
+	      convert (objc_object_type, null_pointer_node));
   SET_EXPR_LOCATION (t, cur_try_context->try_locus);
   append_to_statement_list (t, &BIND_EXPR_BODY (bind));
 
   /* Build the outermost TRY_FINALLY_EXPR.  */
-  try_fin = build (TRY_FINALLY_EXPR, void_type_node, NULL, NULL);
+  try_fin = build2 (TRY_FINALLY_EXPR, void_type_node, NULL, NULL);
   SET_EXPR_LOCATION (try_fin, cur_try_context->try_locus);
   TREE_SIDE_EFFECTS (try_fin) = 1;
   append_to_statement_list (try_fin, &BIND_EXPR_BODY (bind));
@@ -3305,7 +3305,7 @@ objc_begin_catch_clause (tree decl)
   /* Initialize the decl from the EXC_PTR_EXPR we get from the runtime.  */
   t = objc_build_exc_ptr ();
   t = convert (TREE_TYPE (decl), t);
-  t = build (MODIFY_EXPR, void_type_node, decl, t);
+  t = build2 (MODIFY_EXPR, void_type_node, decl, t);
   add_stmt (t);
 }
 
@@ -5850,7 +5850,7 @@ build_objc_method_call (int super_flag, 
 
   /* ??? Selector is not at this point something we can use inside
      the compiler itself.  Set it to garbage for the nonce.  */
-  t = build (OBJ_TYPE_REF, sender_cast, method, lookup_object, size_zero_node);
+  t = build3 (OBJ_TYPE_REF, sender_cast, method, lookup_object, size_zero_node);
   return build_function_call (t, method_params);
 }
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]