This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++ PATCH: applied
- To: egcs-patches at egcs dot cygnus dot com
- Subject: C++ PATCH: applied
- From: Nathan Sidwell <nathan at acm dot org>
- Date: Wed, 28 Apr 1999 12:04:31 +0100
- Organization: University of Bristol
- Reply-To: nathan at compsci dot bristol dot ac dot uk
I have just checked in the attached approved patch. It cleans up some cruft to
do with build_component_addr.
nathan
--
Dr Nathan Sidwell :: Computer Science Department :: Bristol University
You can up the bandwidth, but you can't up the speed of light
nathan@acm.org http://www.cs.bris.ac.uk/~nathan/ nathan@cs.bris.ac.uk
Index: egcs/gcc/cp/ChangeLog
===================================================================
RCS file: /cvs/egcs/egcs/gcc/cp/ChangeLog,v
retrieving revision 1.1019
diff -c -3 -p -r1.1019 ChangeLog
*** ChangeLog 1999/04/27 13:27:18 1.1019
--- ChangeLog 1999/04/28 08:17:11
***************
*** 1,3 ****
--- 1,13 ----
+ 1999-04-28 Nathan Sidwell <nathan@acm.org>
+
+ * cp-tree.h (build_component_addr): Remove prototype.
+ * typeck.c (build_component_addr): Make static. Remove MSG
+ argument.
+ (build_component_addr): Remove MSG parameter, clean up
+ comment.
+ (build_x_function_call): Use cp_error.
+ (build_unary_op): Adjust call of build_component_addr.
+
1999-04-27 Nathan Sidwell <nathan@acm.org>
* rtti.c (build_x_typeid): Check rtti is enabled.
Index: egcs/gcc/cp/cp-tree.h
===================================================================
RCS file: /cvs/egcs/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.226
diff -c -3 -p -r1.226 cp-tree.h
*** cp-tree.h 1999/04/22 23:12:58 1.226
--- cp-tree.h 1999/04/28 08:17:16
*************** extern tree convert_arguments PROTO((t
*** 3441,3447 ****
extern tree build_x_binary_op PROTO((enum tree_code, tree, tree));
extern tree build_binary_op PROTO((enum tree_code, tree, tree));
extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code));
- extern tree build_component_addr PROTO((tree, tree, const char *));
extern tree build_x_unary_op PROTO((enum tree_code, tree));
extern tree build_unary_op PROTO((enum tree_code, tree, int));
extern tree unary_complex_lvalue PROTO((enum tree_code, tree));
--- 3441,3446 ----
Index: egcs/gcc/cp/typeck.c
===================================================================
RCS file: /cvs/egcs/egcs/gcc/cp/typeck.c,v
retrieving revision 1.153
diff -c -3 -p -r1.153 typeck.c
*** typeck.c 1999/04/20 21:48:52 1.153
--- typeck.c 1999/04/28 08:17:31
*************** static tree convert_sequence PROTO((tree
*** 55,60 ****
--- 55,61 ----
#endif
static tree lookup_anon_field PROTO((tree, tree));
static tree pointer_diff PROTO((tree, tree, tree));
+ static tree build_component_addr PROTO((tree, tree));
static tree qualify_type PROTO((tree, tree));
static tree get_delta_difference PROTO((tree, tree, int));
static int comp_cv_target_types PROTO((tree, tree, int));
*************** build_x_function_call (function, params,
*** 2687,2694 ****
{
if (current_class_type == NULL_TREE)
{
! error ("object missing in call to method `%s'",
! IDENTIFIER_POINTER (function));
return error_mark_node;
}
/* Yow: call from a static member function. */
--- 2688,2694 ----
{
if (current_class_type == NULL_TREE)
{
! cp_error ("object missing in call to method `%D'", function);
return error_mark_node;
}
/* Yow: call from a static member function. */
*************** pointer_diff (op0, op1, ptrtype)
*** 4244,4260 ****
}
/* Handle the case of taking the address of a COMPONENT_REF.
! Called by `build_unary_op' and `build_up_reference'.
ARG is the COMPONENT_REF whose address we want.
! ARGTYPE is the pointer type that this address should have.
! MSG is an error message to print if this COMPONENT_REF is not
! addressable (such as a bitfield). */
! tree
! build_component_addr (arg, argtype, msg)
tree arg, argtype;
- const char *msg;
{
tree field = TREE_OPERAND (arg, 1);
tree basetype = decl_type_context (field);
--- 4244,4257 ----
}
/* Handle the case of taking the address of a COMPONENT_REF.
! Called by `build_unary_op'.
ARG is the COMPONENT_REF whose address we want.
! ARGTYPE is the pointer type that this address should have. */
! static tree
! build_component_addr (arg, argtype)
tree arg, argtype;
{
tree field = TREE_OPERAND (arg, 1);
tree basetype = decl_type_context (field);
*************** build_component_addr (arg, argtype, msg)
*** 4264,4270 ****
if (DECL_C_BIT_FIELD (field))
{
! error (msg, IDENTIFIER_POINTER (DECL_NAME (field)));
return error_mark_node;
}
--- 4261,4268 ----
if (DECL_C_BIT_FIELD (field))
{
! cp_error ("attempt to take address of bit-field structure member `%D'",
! field);
return error_mark_node;
}
*************** build_unary_op (code, xarg, noconvert)
*** 4749,4757 ****
tree addr;
if (TREE_CODE (arg) == COMPONENT_REF)
! addr = build_component_addr
! (arg, argtype,
! "attempt to take address of bit-field structure member `%s'");
else
addr = build1 (ADDR_EXPR, argtype, arg);
--- 4747,4753 ----
tree addr;
if (TREE_CODE (arg) == COMPONENT_REF)
! addr = build_component_addr (arg, argtype);
else
addr = build1 (ADDR_EXPR, argtype, arg);