This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH]: remove SET_DECL_ARTIFICIAL
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH]: remove SET_DECL_ARTIFICIAL
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 29 Jun 2000 15:08:22 +0100
- Organization: Codesourcery LLC
Hi,
I've installed the attached cleanup patch, which removes the obfuscating
SET_DECL_ARTIFICIAL macro.
Approved by Mark, built and tested (a few days ago) on i686-pc-linux-gnu
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2000-06-26 Nathan Sidwell <nathan@codesourcery.com>
* cp-tree.h (SET_DECL_ARTIFICIAL): Remove.
* decl.c (create_implicit_typedef): Adjust.
* decl2.c (build_artificial_parm): Adjust.
* method.c (implicitly_declare_fn): Adjust.
* pt.c (push_inline_template_parms_recursive): Adjust.
(process_template_parm): Adjust.
(overloaded_template_name): Adjust.
* semantics.c (finish_template_template_parm): Adjust.
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/cp-tree.h,v
retrieving revision 1.489
diff -c -3 -p -r1.489 cp-tree.h
*** cp-tree.h 2000/06/26 02:18:14 1.489
--- cp-tree.h 2000/06/26 10:27:42
*************** extern int flag_new_for_scope;
*** 2571,2579 ****
#define DECL_ANTICIPATED(NODE) \
(DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->decl_flags.anticipated_p)
- /* This _DECL represents a compiler-generated entity. */
- #define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)
-
/* Record whether a typedef for type `int' was actually `signed int'. */
#define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
--- 2571,2576 ----
Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.643
diff -c -3 -p -r1.643 decl.c
*** decl.c 2000/06/24 22:17:13 1.643
--- decl.c 2000/06/26 10:27:45
*************** create_implicit_typedef (name, type)
*** 2805,2811 ****
tree decl;
decl = build_decl (TYPE_DECL, name, type);
! SET_DECL_ARTIFICIAL (decl);
/* There are other implicit type declarations, like the one *within*
a class that allows you to write `S::S'. We must distinguish
amongst these. */
--- 2805,2811 ----
tree decl;
decl = build_decl (TYPE_DECL, name, type);
! DECL_ARTIFICIAL (decl) = 1;
/* There are other implicit type declarations, like the one *within*
a class that allows you to write `S::S'. We must distinguish
amongst these. */
Index: cp/decl2.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.370
diff -c -3 -p -r1.370 decl2.c
*** decl2.c 2000/06/23 01:14:39 1.370
--- decl2.c 2000/06/26 10:27:46
*************** build_artificial_parm (name, type)
*** 959,965 ****
tree parm;
parm = build_decl (PARM_DECL, name, type);
! SET_DECL_ARTIFICIAL (parm);
DECL_ARG_TYPE (parm) = type;
return parm;
}
--- 959,965 ----
tree parm;
parm = build_decl (PARM_DECL, name, type);
! DECL_ARTIFICIAL (parm) = 1;
DECL_ARG_TYPE (parm) = type;
return parm;
}
Index: cp/method.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/method.c,v
retrieving revision 1.172
diff -c -3 -p -r1.172 method.c
*** method.c 2000/06/23 06:49:42 1.172
--- method.c 2000/06/26 10:27:47
*************** implicitly_declare_fn (kind, type, const
*** 2644,2651 ****
my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 20000408);
if (kind != sfk_constructor && kind != sfk_destructor)
! SET_DECL_ARTIFICIAL (TREE_CHAIN (DECL_ARGUMENTS (fn)));
! SET_DECL_ARTIFICIAL (fn);
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_THIS_INLINE (fn) = 1;
DECL_INLINE (fn) = 1;
--- 2644,2651 ----
my_friendly_assert (TREE_CODE (fn) == FUNCTION_DECL, 20000408);
if (kind != sfk_constructor && kind != sfk_destructor)
! DECL_ARTIFICIAL (TREE_CHAIN (DECL_ARGUMENTS (fn))) = 1;
! DECL_ARTIFICIAL (fn) = 1;
DECL_NOT_REALLY_EXTERN (fn) = 1;
DECL_THIS_INLINE (fn) = 1;
DECL_INLINE (fn) = 1;
Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/pt.c,v
retrieving revision 1.446
diff -c -3 -p -r1.446 pt.c
*** pt.c 2000/06/23 06:49:44 1.446
--- pt.c 2000/06/26 10:27:49
*************** push_inline_template_parms_recursive (pa
*** 347,353 ****
available. */
tree decl = build_decl (CONST_DECL, DECL_NAME (parm),
TREE_TYPE (parm));
! SET_DECL_ARTIFICIAL (decl);
DECL_INITIAL (decl) = DECL_INITIAL (parm);
SET_DECL_TEMPLATE_PARM_P (decl);
pushdecl (decl);
--- 347,353 ----
available. */
tree decl = build_decl (CONST_DECL, DECL_NAME (parm),
TREE_TYPE (parm));
! DECL_ARTIFICIAL (decl) = 1;
DECL_INITIAL (decl) = DECL_INITIAL (parm);
SET_DECL_TEMPLATE_PARM_P (decl);
pushdecl (decl);
*************** process_template_parm (list, next)
*** 1871,1877 ****
processing_template_decl,
decl, TREE_TYPE (parm));
}
! SET_DECL_ARTIFICIAL (decl);
SET_DECL_TEMPLATE_PARM_P (decl);
pushdecl (decl);
parm = build_tree_list (defval, parm);
--- 1871,1877 ----
processing_template_decl,
decl, TREE_TYPE (parm));
}
! DECL_ARTIFICIAL (decl) = 1;
SET_DECL_TEMPLATE_PARM_P (decl);
pushdecl (decl);
parm = build_tree_list (defval, parm);
*************** overload_template_name (type)
*** 7536,7542 ****
return;
decl = build_decl (TYPE_DECL, id, type);
! SET_DECL_ARTIFICIAL (decl);
pushdecl_class_level (decl);
}
--- 7536,7542 ----
return;
decl = build_decl (TYPE_DECL, id, type);
! DECL_ARTIFICIAL (decl) = 1;
pushdecl_class_level (decl);
}
Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/semantics.c,v
retrieving revision 1.153
diff -c -3 -p -r1.153 semantics.c
*** semantics.c 2000/06/26 02:18:14 1.153
--- semantics.c 2000/06/26 10:27:49
*************** finish_template_template_parm (aggr, ide
*** 2232,2238 ****
tree tmpl = build_lang_decl (TEMPLATE_DECL, identifier, NULL_TREE);
DECL_TEMPLATE_PARMS (tmpl) = current_template_parms;
DECL_TEMPLATE_RESULT (tmpl) = decl;
! SET_DECL_ARTIFICIAL (decl);
end_template_decl ();
return finish_template_type_parm (aggr, tmpl);
--- 2232,2238 ----
tree tmpl = build_lang_decl (TEMPLATE_DECL, identifier, NULL_TREE);
DECL_TEMPLATE_PARMS (tmpl) = current_template_parms;
DECL_TEMPLATE_RESULT (tmpl) = decl;
! DECL_ARTIFICIAL (decl) = 1;
end_template_decl ();
return finish_template_type_parm (aggr, tmpl);