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]

[patch] delete old dead code


The attached patch deletes #if 0 blocks that have existed since the
beginning of egcs.  From the comments, some have existed much longer
than that - one references gcc 2.4 in the future, and two are from
1994.  

This only handles the c and c++ front ends.  More later.  

No changelog as of yet, since writing this changelog will be really
boring, and I don't want to have to do it more than once.  

Two additional questions - is there CVS history available anywhere
from before egcs began?  And are the archives of the pre-egcs mailing
lists available?

Thanks
           
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dyndns.org/decss

Index: c-common.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-common.c,v
retrieving revision 1.236
diff -u -r1.236 c-common.c
--- c-common.c	2001/05/25 20:00:54	1.236
+++ c-common.c	2001/05/28 14:23:21
@@ -2535,28 +2535,6 @@
   if (TREE_CODE (expr) == ERROR_MARK)
     return expr;
 
-#if 0 /* This appears to be wrong for C++.  */
-  /* These really should return error_mark_node after 2.4 is stable.
-     But not all callers handle ERROR_MARK properly.  */
-  switch (TREE_CODE (TREE_TYPE (expr)))
-    {
-    case RECORD_TYPE:
-      error ("struct type value used where scalar is required");
-      return boolean_false_node;
-
-    case UNION_TYPE:
-      error ("union type value used where scalar is required");
-      return boolean_false_node;
-
-    case ARRAY_TYPE:
-      error ("array type value used where scalar is required");
-      return boolean_false_node;
-
-    default:
-      break;
-    }
-#endif /* 0 */
-
   switch (TREE_CODE (expr))
     {
     case EQ_EXPR:
Index: c-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-tree.h,v
retrieving revision 1.61
diff -u -r1.61 c-tree.h
--- c-tree.h	2001/05/26 01:31:33	1.61
+++ c-tree.h	2001/05/28 14:23:21
@@ -110,13 +110,6 @@
 #define C_TYPE_VARIABLE_SIZE(type) TYPE_LANG_FLAG_1 (type)
 #define C_DECL_VARIABLE_SIZE(type) DECL_LANG_FLAG_0 (type)
 
-#if 0 /* Not used.  */
-/* Record whether a decl for a function or function pointer has
-   already been mentioned (in a warning) because it was called
-   but didn't have a prototype.  */
-#define C_MISSING_PROTOTYPE_WARNED(decl) DECL_LANG_FLAG_2(decl)
-#endif
-
 /* Store a value in that field.  */
 #define C_SET_EXP_ORIGINAL_CODE(exp, code) \
   (TREE_COMPLEXITY (exp) = (int) (code))
Index: c-convert.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-convert.c,v
retrieving revision 1.11
diff -u -r1.11 c-convert.c
--- c-convert.c	2001/04/23 22:55:31	1.11
+++ c-convert.c	2001/05/28 14:23:22
@@ -80,12 +80,6 @@
     }
   if (code == VOID_TYPE)
     return build1 (CONVERT_EXPR, type, e);
-#if 0
-  /* This is incorrect.  A truncation can't be stripped this way.
-     Extensions will be stripped by the use of get_unwidened.  */
-  if (TREE_CODE (expr) == NOP_EXPR)
-    return convert (type, TREE_OPERAND (expr, 0));
-#endif
   if (code == INTEGER_TYPE || code == ENUMERAL_TYPE)
     return fold (convert_to_integer (type, e));
   if (code == BOOLEAN_TYPE)
Index: c-typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-typeck.c,v
retrieving revision 1.121
diff -u -r1.121 c-typeck.c
--- c-typeck.c	2001/05/25 06:34:16	1.121
+++ c-typeck.c	2001/05/28 14:23:25
@@ -303,10 +303,6 @@
 				  TYPE_QUALS (pointed_to_2)));
 	return build_type_attribute_variant (t1, attributes);
       }
-#if 0
-      t1 = build_pointer_type (common_type (TREE_TYPE (t1), TREE_TYPE (t2)));
-      return build_type_attribute_variant (t1, attributes);
-#endif
 
     case ARRAY_TYPE:
       {
@@ -3100,28 +3096,6 @@
       if (val != 0)
 	return val;
 
-#if 0 /* Turned off because inconsistent;
-	 float f; *&(int)f = 3.4 stores in int format
-	 whereas (int)f = 3.4 stores in float format.  */
-      /* Address of a cast is just a cast of the address
-	 of the operand of the cast.  */
-      switch (TREE_CODE (arg))
-	{
-	case NOP_EXPR:
-	case CONVERT_EXPR:
-	case FLOAT_EXPR:
-	case FIX_TRUNC_EXPR:
-	case FIX_FLOOR_EXPR:
-	case FIX_ROUND_EXPR:
-	case FIX_CEIL_EXPR:
-	  if (pedantic)
-	    pedwarn ("ISO C forbids the address of a cast expression");
-	  return convert (build_pointer_type (TREE_TYPE (arg)),
-			  build_unary_op (ADDR_EXPR, TREE_OPERAND (arg, 0),
-					  0));
-	}
-#endif
-
       /* Allow the address of a constructor if all the elements
 	 are constant.  */
       if (TREE_CODE (arg) == CONSTRUCTOR && TREE_CONSTANT (arg))
@@ -3191,35 +3165,6 @@
   return fold (build1 (code, argtype, arg));
 }
 
-#if 0
-/* If CONVERSIONS is a conversion expression or a nested sequence of such,
-   convert ARG with the same conversions in the same order
-   and return the result.  */
-
-static tree
-convert_sequence (conversions, arg)
-     tree conversions;
-     tree arg;
-{
-  switch (TREE_CODE (conversions))
-    {
-    case NOP_EXPR:
-    case CONVERT_EXPR:
-    case FLOAT_EXPR:
-    case FIX_TRUNC_EXPR:
-    case FIX_FLOOR_EXPR:
-    case FIX_ROUND_EXPR:
-    case FIX_CEIL_EXPR:
-      return convert (TREE_TYPE (conversions),
-		      convert_sequence (TREE_OPERAND (conversions, 0),
-					arg));
-
-    default:
-      return arg;
-    }
-}
-#endif /* 0 */
-
 /* Return nonzero if REF is an lvalue valid for this language.
    Lvalues can be assigned, unless their type has TYPE_READONLY.
    Lvalues can have their address taken, unless they have DECL_REGISTER.  */
@@ -3436,10 +3381,6 @@
 	/* drops in */
       case FUNCTION_DECL:
 	TREE_ADDRESSABLE (x) = 1;
-#if 0  /* poplevel deals with this now.  */
-	if (DECL_CONTEXT (x) == 0)
-	  TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
-#endif
 
       default:
 	return 1;
@@ -3461,23 +3402,6 @@
 
   ifexp = truthvalue_conversion (default_conversion (ifexp));
 
-#if 0 /* Produces wrong result if within sizeof.  */
-  /* Don't promote the operands separately if they promote
-     the same way.  Return the unpromoted type and let the combined
-     value get promoted if necessary.  */
-
-  if (TREE_TYPE (op1) == TREE_TYPE (op2)
-      && TREE_CODE (TREE_TYPE (op1)) != ARRAY_TYPE
-      && TREE_CODE (TREE_TYPE (op1)) != ENUMERAL_TYPE
-      && TREE_CODE (TREE_TYPE (op1)) != FUNCTION_TYPE)
-    {
-      if (TREE_CODE (ifexp) == INTEGER_CST)
-	return pedantic_non_lvalue (integer_zerop (ifexp) ? op2 : op1);
-
-      return fold (build (COND_EXPR, TREE_TYPE (op1), ifexp, op1, op2));
-    }
-#endif
-
   /* Promote both alternatives.  */
 
   if (TREE_CODE (TREE_TYPE (op1)) != VOID_TYPE)
@@ -3648,14 +3572,6 @@
       if (!first_p && TREE_CODE (TREE_TYPE (TREE_VALUE (list))) == ARRAY_TYPE)
 	TREE_VALUE (list) = default_conversion (TREE_VALUE (list));
 
-#if 0 /* If something inside inhibited lvalueness, we should not override.  */
-      /* Consider (x, y+0), which is not an lvalue since y+0 is not.  */
-
-      /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue.  */
-      if (TREE_CODE (list) == NON_LVALUE_EXPR)
-	list = TREE_OPERAND (list, 0);
-#endif
-
       /* Don't let (0, 0) be null pointer constant.  */
       if (!first_p && integer_zerop (TREE_VALUE (list)))
 	return non_lvalue (TREE_VALUE (list));
@@ -3703,12 +3619,6 @@
     return error_mark_node;
   type = TYPE_MAIN_VARIANT (type);
 
-#if 0
-  /* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue.  */
-  if (TREE_CODE (value) == NON_LVALUE_EXPR)
-    value = TREE_OPERAND (value, 0);
-#endif
-
   if (TREE_CODE (type) == ARRAY_TYPE)
     {
       error ("cast specifies array type");
@@ -4439,37 +4349,6 @@
   value = digest_init (type, init, TREE_STATIC (decl),
 		       TREE_STATIC (decl) || (pedantic && !flag_isoc99));
 
-  /* Store the expression if valid; else report error.  */
-
-#if 0
-  /* Note that this is the only place we can detect the error
-     in a case such as   struct foo bar = (struct foo) { x, y };
-     where there is one initial value which is a constructor expression.  */
-  if (value == error_mark_node)
-    ;
-  else if (TREE_STATIC (decl) && ! TREE_CONSTANT (value))
-    {
-      error ("initializer for static variable is not constant");
-      value = error_mark_node;
-    }
-  else if (TREE_STATIC (decl)
-	   && initializer_constant_valid_p (value, TREE_TYPE (value)) == 0)
-    {
-      error ("initializer for static variable uses complicated arithmetic");
-      value = error_mark_node;
-    }
-  else
-    {
-      if (pedantic && TREE_CODE (value) == CONSTRUCTOR)
-	{
-	  if (! TREE_CONSTANT (value))
-	    pedwarn ("aggregate initializer is not constant");
-	  else if (! TREE_STATIC (value))
-	    pedwarn ("aggregate initializer uses complicated arithmetic");
-	}
-    }
-#endif
-
   if (warn_traditional && !in_system_header
       && AGGREGATE_TYPE_P (TREE_TYPE (decl)) && ! TREE_STATIC (decl))
     warning ("traditional C rejects automatic aggregate initialization");
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.224
diff -u -r1.224 c-decl.c
--- c-decl.c	2001/05/27 21:04:27	1.224
+++ c-decl.c	2001/05/28 14:23:28
@@ -1004,33 +1004,6 @@
 
   keep |= current_binding_level->keep;
 
-  /* This warning is turned off because it causes warnings for
-     declarations like `extern struct foo *x'.  */
-#if 0
-  /* Warn about incomplete structure types in this level.  */
-  for (link = tags; link; link = TREE_CHAIN (link))
-    if (!COMPLETE_TYPE_P (TREE_VALUE (link)))
-      {
-	tree type = TREE_VALUE (link);
-	tree type_name = TYPE_NAME (type);
-	char *id = IDENTIFIER_POINTER (TREE_CODE (type_name) == IDENTIFIER_NODE
-				       ? type_name
-				       : DECL_NAME (type_name));
-	switch (TREE_CODE (type))
-	  {
-	  case RECORD_TYPE:
-	    error ("`struct %s' incomplete in scope ending here", id);
-	    break;
-	  case UNION_TYPE:
-	    error ("`union %s' incomplete in scope ending here", id);
-	    break;
-	  case ENUMERAL_TYPE:
-	    error ("`enum %s' incomplete in scope ending here", id);
-	    break;
-	  }
-      }
-#endif /* 0 */
-
   /* Get the decls in the order they were written.
      Usually current_binding_level->names is in reverse order.
      But parameter decls were previously put in forward order.  */
@@ -3725,17 +3698,6 @@
   decl_attributes (decl, TREE_VALUE (TREE_VALUE (parm)),
 		   TREE_PURPOSE (TREE_VALUE (parm)));
 
-#if 0
-  if (DECL_NAME (decl))
-    {
-      tree olddecl;
-      olddecl = lookup_name (DECL_NAME (decl));
-      if (pedantic && olddecl != 0 && TREE_CODE (olddecl) == TYPE_DECL)
-	pedwarn_with_decl (decl,
-			   "ANSI C forbids parameter `%s' shadowing typedef");
-    }
-#endif
-
   decl = pushdecl (decl);
 
   immediate_size_expand = old_immediate_size_expand;
@@ -4832,10 +4794,6 @@
 	    type = build_array_type (c_build_qualified_type (TREE_TYPE (type),
 							     type_quals),
 				     TYPE_DOMAIN (type));
-#if 0
-	    /* Leave the field const or volatile as well.  */
-	    type_quals = TYPE_UNQUALIFIED;
-#endif
 	  }
 	decl = build_decl (FIELD_DECL, declarator, type);
 	DECL_NONADDRESSABLE_P (decl) = bitfield;
@@ -5013,10 +4971,6 @@
 	 These tags can never be defined in the scope of the declaration,
 	 so the types can never be completed,
 	 and no call can be compiled successfully.  */
-#if 0
-      /* In a fcn definition, arg types must be complete.  */
-      if (funcdef_flag)
-#endif
 	for (parm = last_function_parms, typelt = first_parm;
 	     parm;
 	     parm = TREE_CHAIN (parm))
@@ -6230,22 +6184,6 @@
 	 and record in the function.  */
       DECL_ARGUMENTS (fndecl) = getdecls ();
 
-#if 0
-      /* If this function takes a variable number of arguments,
-	 add a phony parameter to the end of the parm list,
-	 to represent the position of the first unnamed argument.  */
-      if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (fndecl))))
-	  != void_type_node)
-	{
-	  tree dummy = build_decl (PARM_DECL, NULL_TREE, void_type_node);
-	  /* Let's hope the address of the unnamed parm
-	     won't depend on its type.  */
-	  TREE_TYPE (dummy) = integer_type_node;
-	  DECL_ARG_TYPE (dummy) = integer_type_node;
-	  DECL_ARGUMENTS (fndecl) = chainon (DECL_ARGUMENTS (fndecl), dummy);
-	}
-#endif
-
       /* Now pushdecl the enum constants.  */
       for (parm = others; parm; parm = next)
 	{
@@ -6523,12 +6461,6 @@
      Otherwise, the dbx output is wrong.  */
 
   keep_next_if_subblocks = 1;
-
-  /* ??? This might be an improvement,
-     but needs to be thought about some more.  */
-#if 0
-  keep_next_level_flag = 1;
-#endif
 
   /* Write a record describing this function definition to the prototypes
      file (if requested).  */
Index: c-lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-lex.c,v
retrieving revision 1.141
diff -u -r1.141 c-lex.c
--- c-lex.c	2001/05/23 19:05:37	1.141
+++ c-lex.c	2001/05/28 14:23:30
@@ -654,26 +654,6 @@
   while (shift);
 }
 #endif
-
-#if 0
-struct try_type
-{
-  tree *node_var;
-  char unsigned_flag;
-  char long_flag;
-  char long_long_flag;
-};
-
-struct try_type type_sequence[] =
-{
-  { &integer_type_node, 0, 0, 0},
-  { &unsigned_type_node, 1, 0, 0},
-  { &long_integer_type_node, 0, 1, 0},
-  { &long_unsigned_type_node, 1, 1, 0},
-  { &long_long_integer_type_node, 0, 1, 1},
-  { &long_long_unsigned_type_node, 1, 1, 1}
-};
-#endif /* 0 */
 
 struct pf_args
 {
Index: cp/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.244
diff -u -r1.244 tree.c
--- tree.c	2001/05/22 19:41:55	1.244
+++ tree.c	2001/05/28 10:41:09
@@ -353,15 +353,6 @@
       return exp;
 
     case 'd':  /* A decl node */
-#if 0                               /* This is bogus.  jason 9/21/94 */
-
-      t1 = break_out_calls (DECL_INITIAL (exp));
-      if (t1 != DECL_INITIAL (exp))
-	{
-	  exp = copy_node (exp);
-	  DECL_INITIAL (exp) = t1;
-	}
-#endif
       return exp;
 
     case 'b':  /* A block node */
Index: cp/search.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/search.c,v
retrieving revision 1.209
diff -u -r1.209 search.c
--- search.c	2001/05/02 14:38:32	1.209
+++ search.c	2001/05/28 10:41:10
@@ -2636,11 +2636,6 @@
 				      is_not_base_vtable, can_elide, addr,
 				      orig_addr, type, vbase, vbase_offsets);
     }
-#if 0
-  /* Before turning this on, make sure it is correct.  */
-  if (can_elide && ! BINFO_MODIFIED (binfo))
-    return;
-#endif
   /* Should we use something besides CLASSTYPE_VFIELDS? */
   if (init_self && CLASSTYPE_VFIELDS (BINFO_TYPE (real_binfo)))
     {
Index: cp/lex.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/lex.c,v
retrieving revision 1.245
diff -u -r1.245 lex.c
--- lex.c	2001/05/20 06:26:45	1.245
+++ lex.c	2001/05/28 10:41:10
@@ -841,11 +841,6 @@
 
 int *token_count;
 
-#if 0
-#define REDUCE_LENGTH (sizeof (yyr2) / sizeof (yyr2[0]))
-#define TOKEN_LENGTH (256 + sizeof (yytname) / sizeof (yytname[0]))
-#endif
-
 #ifdef GATHER_STATISTICS
 #ifdef REDUCE_LENGTH
 void
Index: cp/init.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/init.c,v
retrieving revision 1.244
diff -u -r1.244 init.c
--- init.c	2001/05/22 00:31:36	1.244
+++ init.c	2001/05/28 10:41:11
@@ -1127,17 +1127,7 @@
   if (name == NULL_TREE || basetype)
     {
       if (name == NULL_TREE)
-	{
-#if 0
-	  if (basetype)
-	    name = TYPE_IDENTIFIER (basetype);
-	  else
-	    {
-	      error ("no base class to initialize");
-	      return;
-	    }
-#endif
-	}
+		  ;
       else if (basetype != type
 	       && ! current_template_parms
 	       && ! vec_binfo_member (basetype,
Index: cp/repo.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/repo.c,v
retrieving revision 1.35
diff -u -r1.35 repo.c
--- repo.c	2001/04/12 22:31:56	1.35
+++ repo.c	2001/05/28 10:41:11
@@ -54,42 +54,6 @@
 #define IDENTIFIER_REPO_USED(NODE)   (TREE_LANG_FLAG_3 (NODE))
 #define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE))
 
-#if 0
-/* Record the flags used to compile this translation unit.  */
-
-void
-repo_compile_flags (argc, argv)
-     int argc;
-     char **argv;
-{
-}
-
-/* If this template has not been seen before, add a note to the repository
-   saying where the declaration was.  This may be used to find the
-   definition at link time.  */
-
-void
-repo_template_declared (t)
-     tree t;
-{}
-
-/* Note where the definition of a template lives so that instantiations can
-   be generated later.  */
-
-void
-repo_template_defined (t)
-     tree t;
-{}
-
-/* Note where the definition of a class lives to that template
-   instantiations can use it.  */
-
-void
-repo_class_defined (t)
-     tree t;
-{}
-#endif
-
 static tree
 repo_get_id (t)
      tree t;
@@ -148,50 +112,6 @@
       pending_repo = tree_cons (NULL_TREE, id, pending_repo);
     }
 }
-
-#if 0
-/* Note that the vtable for a class has been used, and offer to emit it.  */
-
-static void
-repo_vtable_used (t)
-     tree t;
-{
-  if (! flag_use_repository)
-    return;
-
-  pending_repo = tree_cons (NULL_TREE, t, pending_repo);
-}
-
-/* Note that an inline with external linkage has been used, and offer to
-   emit it.  */
-
-void
-repo_inline_used (fn)
-     tree fn;
-{
-  if (! flag_use_repository)
-    return;
-
-  /* Member functions of polymorphic classes go with their vtables.  */
-  if (DECL_FUNCTION_MEMBER_P (fn) 
-      && TYPE_POLYMORPHIC_P (DECL_CONTEXT (fn)))
-    {
-      repo_vtable_used (DECL_CONTEXT (fn));
-      return;
-    }
-
-  pending_repo = tree_cons (NULL_TREE, fn, pending_repo);
-}
-
-/* Note that a particular typeinfo node has been used, and offer to
-   emit it.  */
-
-void
-repo_tinfo_used (ti)
-     tree ti;
-{
-}
-#endif
 
 void
 repo_template_instantiated (t, extern_p)
Index: cp/typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.348
diff -u -r1.348 typeck.c
--- typeck.c	2001/05/12 10:41:31	1.348
+++ typeck.c	2001/05/28 10:41:13
@@ -4606,13 +4606,7 @@
 		cp_error ("invalid use of `--' on bool variable `%D'", arg);
 		return error_mark_node;
 	      }
-#if 0
-	    /* This will only work if someone can convince Kenner to accept
-	       my patch to expand_increment. (jason)  */
-	    val = build (code, TREE_TYPE (arg), arg, inc);
-#else
 	    val = boolean_increment (code, arg);
-#endif
 	  }
 	else
 	  val = build (code, TREE_TYPE (arg), arg, inc);
@@ -5022,10 +5016,6 @@
                 && VOID_TYPE_P (TREE_TYPE (TREE_VALUE(list)))))
         warning("left-hand operand of comma expression has no effect");
     }
-#if 0 /* this requires a gcc backend patch to export warn_if_unused_value */
-  else if (warn_unused_value)
-    warn_if_unused_value (TREE_VALUE(list));
-#endif
 
   return build_compound_expr
     (tree_cons (NULL_TREE, TREE_VALUE (list),
Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.270
diff -u -r1.270 call.c
--- call.c	2001/05/22 00:31:35	1.270
+++ call.c	2001/05/28 10:41:14
@@ -2480,16 +2480,6 @@
 
   if (! any_viable (candidates))
     {
-#if 0
-      if (flags & LOOKUP_COMPLAIN)
-	{
-	  if (candidates && ! candidates->next)
-	    /* say why this one won't work or try to be loose */;
-	  else
-	    cp_error ("no viable candidates");
-	}
-#endif
-
       return 0;
     }
 
Index: cp/typeck2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck2.c,v
retrieving revision 1.101
diff -u -r1.101 typeck2.c
--- typeck2.c	2001/05/02 14:38:33	1.101
+++ typeck2.c	2001/05/28 10:41:14
@@ -306,12 +306,6 @@
   if (TREE_CODE (type) == ERROR_MARK)
     return NULL_TREE;
 
-#if 0
-  /* This breaks arrays, and should not have any effect for other decls.  */
-  /* Take care of C++ business up here.  */
-  type = TYPE_MAIN_VARIANT (type);
-#endif
-
   if (IS_AGGR_TYPE (type))
     {
       if (! TYPE_HAS_TRIVIAL_INIT_REF (type)
@@ -323,35 +317,6 @@
 	  cp_error ("constructor syntax used, but no constructor declared for type `%T'", type);
 	  init = build_nt (CONSTRUCTOR, NULL_TREE, nreverse (init));
 	}
-#if 0
-      if (TREE_CODE (init) == CONSTRUCTOR)
-	{
-	  tree field;
-
-	  /* Check that we're really an aggregate as ARM 8.4.1 defines it.  */
-	  if (CLASSTYPE_N_BASECLASSES (type))
-	    cp_error_at ("initializer list construction invalid for derived class object `%D'", decl);
-	  if (CLASSTYPE_VTBL_PTR (type))
-	    cp_error_at ("initializer list construction invalid for polymorphic class object `%D'", decl);
-	  if (TYPE_NEEDS_CONSTRUCTING (type))
-	    {
-	      cp_error_at ("initializer list construction invalid for `%D'", decl);
-	      error ("due to the presence of a constructor");
-	    }
-	  for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
-	    if (TREE_PRIVATE (field) || TREE_PROTECTED (field))
-	      {
-		cp_error_at ("initializer list construction invalid for `%D'", decl);
-		cp_error_at ("due to non-public access of member `%D'", field);
-	      }
-	  for (field = TYPE_METHODS (type); field; field = TREE_CHAIN (field))
-	    if (TREE_PRIVATE (field) || TREE_PROTECTED (field))
-	      {
-		cp_error_at ("initializer list construction invalid for `%D'", decl);
-		cp_error_at ("due to non-public access of member `%D'", field);
-	      }
-	}
-#endif
     }
   else if (TREE_CODE (init) == TREE_LIST
 	   && TREE_TYPE (init) != unknown_type_node)
@@ -404,31 +369,9 @@
   else if (TREE_STATIC (decl)
 	   && (! TREE_CONSTANT (value)
 	       || ! initializer_constant_valid_p (value, TREE_TYPE (value))
-#if 0
-	       /* A STATIC PUBLIC int variable doesn't have to be
-		  run time inited when doing pic.  (mrs) */
-	       /* Since ctors and dtors are the only things that can
-		  reference vtables, and they are always written down
-		  the vtable definition, we can leave the
-		  vtables in initialized data space.
-		  However, other initialized data cannot be initialized
-		  this way.  Instead a global file-level initializer
-		  must do the job.  */
-	       || (flag_pic && !DECL_VIRTUAL_P (decl) && TREE_PUBLIC (decl))
-#endif
 	       ))
 
     return value;
-#if 0 /* No, that's C.  jason 9/19/94 */
-  else
-    {
-      if (pedantic && TREE_CODE (value) == CONSTRUCTOR)
-	{
-	  if (! TREE_CONSTANT (value) || ! TREE_STATIC (value))
-	    pedwarn ("ANSI C++ forbids non-constant aggregate initializer expressions");
-	}
-    }
-#endif
   
   /* Store the VALUE in DECL_INITIAL.  If we're building a
      statement-tree we will actually expand the initialization later
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.788
diff -u -r1.788 decl.c
--- decl.c	2001/05/25 20:00:59	1.788
+++ decl.c	2001/05/28 10:41:17
@@ -579,10 +579,6 @@
     register struct binding_level *level = current_binding_level;
     current_binding_level = current_binding_level->level_chain;
     level->level_chain = free_binding_level;
-#if 0 /* defined(DEBUG_CP_BINDING_LEVELS) */
-    if (level->binding_depth != binding_depth)
-      abort ();
-#endif /* defined(DEBUG_CP_BINDING_LEVELS) */
     free_binding_level = level;
     find_class_binding_level ();
   }
@@ -5390,15 +5386,6 @@
   return NULL_TREE;
 }
 
-#if 0
-void
-set_current_level_tags_transparency (tags_transparent)
-     int tags_transparent;
-{
-  current_binding_level->tag_transparent = tags_transparent;
-}
-#endif
-
 /* Given a type, find the tag that was defined for it and return the tag name.
    Otherwise return 0.  However, the value can never be 0
    in the cases in which this is used.
@@ -7125,11 +7112,6 @@
   extern int used_extern_spec;
   tree attrlist;
 
-#if 0
-  /* See code below that used this.  */
-  int init_written = initialized;
-#endif
-
   /* This should only be done once on the top most decl.  */
   if (have_extern_spec && !used_extern_spec)
     {
@@ -9575,10 +9557,7 @@
   int funcdef_flag = 0;
   enum tree_code innermost_code = ERROR_MARK;
   int bitfield = 0;
-#if 0
-  /* See the code below that used this.  */
-  tree decl_machine_attr = NULL_TREE;
-#endif
+
   /* Set this to error_mark_node for FIELD_DECLs we could not handle properly.
      All FIELD_DECLs we build here have `init' put into their DECL_INITIAL.  */
   tree init = NULL_TREE;
@@ -10041,10 +10020,6 @@
 	  else
 	    {
 	      type = TREE_TYPE (t);
-#if 0
-	      /* See the code below that used this.  */
-	      decl_machine_attr = DECL_MACHINE_ATTRIBUTES (id);
-#endif
 	      typedef_decl = t;
 	    }
 	}
@@ -11370,11 +11345,6 @@
 			       funcdef_flag, template_count, in_namespace);
 	    if (decl == NULL_TREE)
 	      return decl;
-#if 0
-	    /* This clobbers the attrs stored in `decl' from `attrlist'.  */
-	    /* The decl and setting of decl_machine_attr is also turned off.  */
-	    decl = build_decl_attribute_variant (decl, decl_machine_attr);
-#endif
 
 	    /* [class.conv.ctor]
 
@@ -13161,10 +13131,6 @@
       /* Remove no-op casts from the value.  */
       if (value)
 	STRIP_TYPE_NOPS (value);
-#if 0
-      /* To fix MAX_VAL enum consts. (bkoz)  */
-      TREE_TYPE (value) = integer_type_node;
-#endif
     }
 
   /* We always have to copy here; not all INTEGER_CSTs are unshared.
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.467
diff -u -r1.467 decl2.c
--- decl2.c	2001/05/24 12:00:49	1.467
+++ decl2.c	2001/05/28 10:41:18
@@ -1855,12 +1855,7 @@
   if (TREE_CODE (parmtype) == REFERENCE_TYPE)
     parmtype = TREE_TYPE (parmtype);
 
-  if ((TYPE_MAIN_VARIANT (parmtype) == current_class_type)
-#if 0
-      /* Non-standard hack to support old Booch components.  */
-      || (! virtualp && DERIVED_FROM_P (parmtype, current_class_type))
-#endif
-      )
+  if (TYPE_MAIN_VARIANT (parmtype) == current_class_type)
     return 1;
 
   return 0;
@@ -2172,11 +2167,7 @@
   TYPE_ALIGN (type) = TYPE_ALIGN (align_type);
   TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (align_type);
   layout_type (type);
-#if 0 /* not yet, should get fixed properly later */
-  TYPE_NAME (type) = make_type_decl (get_identifier (name), type);
-#else
   TYPE_NAME (type) = build_decl (TYPE_DECL, get_identifier (name), type);
-#endif
   TYPE_STUB_DECL (type) = TYPE_NAME (type);
   layout_decl (TYPE_NAME (type), 0);
 }

PGP signature


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