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]

Added build_c_cast to c-family?


Hello Everyone,
	Is it OK to move build_c_cast prototype into c-common.h? The reason for this is that, I would like to share some of the code between array notation for C and C++ and this function is sort of required for both places. Also, the exact same call is available for both C and C++ with the same parameters at the same locations. The change involves removing the prototype from c-tree.h and cp-tree.h and moving it to c-common.h.

	Here is the changelogs and the patch to accomplish what I am requesting. Please let me know if it is OK for the trunk.

gcc/c-family/ChangeLog
2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-common.h (build_c_cast): Added new extern prototype.

gcc/c/ChangeLog
 2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>
 
	* c-tree.h (build_c_cast): Remove prototype.

gcc/cp/ChangeLog
2013-06-03  Balaji V. Iyer  <balaji.v.iyer@intel.com>

	* c-tree.h (build_c_cast): Remove prototype.


Index: gcc/c-family/c-common.h
===================================================================
--- gcc/c-family/c-common.h	(revision 199630)
+++ gcc/c-family/c-common.h	(working copy)
@@ -538,6 +538,7 @@
 extern tree pushdecl (tree);
 extern tree build_modify_expr (location_t, tree, tree, enum tree_code,
 			       location_t, tree, tree);
+extern tree build_c_cast (location_t, tree, tree);
 extern tree build_array_notation_expr (location_t, tree, tree, enum tree_code,
 				       location_t, tree, tree);
 extern tree build_array_notation_ref (location_t, tree, tree, tree, tree, tree);

Index: gcc/c/c-tree.h
===================================================================
--- gcc/c/c-tree.h	(revision 199630)
+++ gcc/c/c-tree.h	(working copy)
@@ -600,7 +600,6 @@
 				    tree, tree);
 extern tree build_compound_expr (location_t, tree, tree);
 extern tree c_cast_expr (location_t, struct c_type_name *, tree);
-extern tree build_c_cast (location_t, tree, tree);
 extern void store_init_value (location_t, tree, tree, tree);
 extern void error_init (const char *);
 extern void pedwarn_init (location_t, int opt, const char *);

Index: gcc/cp/cp-tree.h
===================================================================
--- gcc/cp/cp-tree.h	(revision 199630)
+++ gcc/cp/cp-tree.h	(working copy)
@@ -6000,7 +6000,6 @@
 extern tree build_static_cast			(tree, tree, tsubst_flags_t);
 extern tree build_reinterpret_cast		(tree, tree, tsubst_flags_t);
 extern tree build_const_cast			(tree, tree, tsubst_flags_t);
-extern tree build_c_cast			(location_t, tree, tree);
 extern tree cp_build_c_cast			(tree, tree, tsubst_flags_t);
 extern tree build_x_modify_expr			(location_t, tree,
 						 enum tree_code, tree,
Thanks,

Balaji V. Iyer. 


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