cp-tree.h revision 107590
118334Speter/* Definitions for C++ parsing and type checking.
290075Sobrien   Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
390075Sobrien   2000, 2001, 2002 Free Software Foundation, Inc.
490075Sobrien   Contributed by Michael Tiemann (tiemann@cygnus.com)
518334Speter
618334SpeterThis file is part of GNU CC.
718334Speter
818334SpeterGNU CC is free software; you can redistribute it and/or modify
918334Speterit under the terms of the GNU General Public License as published by
1018334Speterthe Free Software Foundation; either version 2, or (at your option)
1118334Speterany later version.
1218334Speter
1318334SpeterGNU CC is distributed in the hope that it will be useful,
1418334Speterbut WITHOUT ANY WARRANTY; without even the implied warranty of
1518334SpeterMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1618334SpeterGNU General Public License for more details.
1718334Speter
1818334SpeterYou should have received a copy of the GNU General Public License
1918334Speteralong with GNU CC; see the file COPYING.  If not, write to
2018334Speterthe Free Software Foundation, 59 Temple Place - Suite 330,
2118334SpeterBoston, MA 02111-1307, USA.  */
2218334Speter
2390075Sobrien#include "function.h"
2490075Sobrien#include "hashtab.h"
2590075Sobrien#include "splay-tree.h"
2690075Sobrien#include "varray.h"
2718334Speter
2890075Sobrien#ifndef GCC_CP_TREE_H
2990075Sobrien#define GCC_CP_TREE_H
3090075Sobrien
3196263Sobrien#ifndef __GNUC__
3296263Sobrien#error "You should be using 'make bootstrap' -- see installation instructions"
3396263Sobrien#endif
3496263Sobrien
3590075Sobrien#include "c-common.h"
3690075Sobrien
3750397Sobrien/* Usage of TREE_LANG_FLAG_?:
3852284Sobrien   0: BINFO_MARKED (BINFO nodes).
3990075Sobrien      IDENTIFIER_MARKED (IDENTIFIER_NODEs)
4050397Sobrien      NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
4150397Sobrien      DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
4250397Sobrien      LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
4352284Sobrien      TREE_INDIRECT_USING (in NAMESPACE_DECL).
4452284Sobrien      LOCAL_BINDING_P (in CPLUS_BINDING)
4590075Sobrien      ICS_USER_FLAG (in _CONV)
4690075Sobrien      CLEANUP_P (in TRY_BLOCK)
4790075Sobrien      AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
4890075Sobrien      CTOR_BEGIN_P (in CTOR_STMT)
4990075Sobrien      BV_USE_VCALL_INDEX_P (in the BINFO_VIRTUALS TREE_LIST)
5090075Sobrien      PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF)
5190075Sobrien      PARMLIST_ELLIPSIS_P (in PARMLIST)
5252284Sobrien   1: IDENTIFIER_VIRTUAL_P.
5350397Sobrien      TI_PENDING_TEMPLATE_FLAG.
5450397Sobrien      TEMPLATE_PARMS_FOR_INLINE.
5550397Sobrien      DELETE_EXPR_USE_VEC (in DELETE_EXPR).
5650397Sobrien      (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
5790075Sobrien      TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (in _TYPE).
5852284Sobrien      INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
5952284Sobrien      BASELINK_P (in TREE_LIST)
6090075Sobrien      ICS_ELLIPSIS_FLAG (in _CONV)
6190075Sobrien      BINFO_ACCESS (in BINFO)
6250397Sobrien   2: IDENTIFIER_OPNAME_P.
6390075Sobrien      TYPE_POLYMORHPIC_P (in _TYPE)
6490075Sobrien      ICS_THIS_FLAG (in _CONV)
6590075Sobrien      BINDING_HAS_LEVEL_P (in CPLUS_BINDING)
6690075Sobrien      BINFO_LOST_PRIMARY_P (in BINFO)
6790075Sobrien      TREE_PARMLIST (in TREE_LIST)
6850397Sobrien   3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
6950397Sobrien      BINFO_VTABLE_PATH_MARKED.
7052284Sobrien      BINFO_PUSHDECLS_MARKED.
7150397Sobrien      (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
7290075Sobrien      ICS_BAD_FLAG (in _CONV)
7390075Sobrien      FN_TRY_BLOCK_P (in TRY_BLOCK)
7490075Sobrien      IDENTIFIER_CTOR_OR_DTOR_P (in IDENTIFIER_NODE)
7550397Sobrien   4: BINFO_NEW_VTABLE_MARKED.
7650397Sobrien      TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
7750397Sobrien          or FIELD_DECL).
7890075Sobrien      NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
7990075Sobrien      IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE)
8090075Sobrien   5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE)
8190075Sobrien   6: BINFO_ACCESS (in BINFO)
8218334Speter
8350397Sobrien   Usage of TYPE_LANG_FLAG_?:
8450397Sobrien   0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE).
8550397Sobrien   1: TYPE_HAS_CONSTRUCTOR.
8650397Sobrien   2: TYPE_HAS_DESTRUCTOR.
8750397Sobrien   3: TYPE_FOR_JAVA.
8890075Sobrien   4: TYPE_HAS_NONTRIVIAL_DESTRUCTOR
8950397Sobrien   5: IS_AGGR_TYPE.
9050397Sobrien   6: TYPE_BUILT_IN.
9150397Sobrien
9250397Sobrien   Usage of DECL_LANG_FLAG_?:
9350397Sobrien   0: DECL_ERROR_REPORTED (in VAR_DECL).
9490075Sobrien      DECL_TEMPLATE_PARM_P (in PARM_DECL, CONST_DECL, TYPE_DECL, or TEMPLATE_DECL)
9590075Sobrien      DECL_LOCAL_FUNCTION_P (in FUNCTION_DECL)
9690075Sobrien      DECL_MUTABLE_P (in FIELD_DECL)
9750397Sobrien   1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL).
9852284Sobrien      DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL)
9990075Sobrien      DECL_C_BITFIELD (in FIELD_DECL)
10050397Sobrien   2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL).
10190075Sobrien      DECL_IMPLICIT_TYPEDEF_P (in a TYPE_DECL)
10250397Sobrien   3: DECL_IN_AGGR_P.
10390075Sobrien   4: DECL_C_BIT_FIELD
10450397Sobrien   5: DECL_INTERFACE_KNOWN.
10550397Sobrien   6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
10650397Sobrien   7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
10790075Sobrien      DECL_THUNK_P (in a member FUNCTION_DECL)
10852284Sobrien
10952284Sobrien   Usage of language-independent fields in a language-dependent manner:
11090075Sobrien
11190075Sobrien   TREE_USED
11290075Sobrien     This field is BINFO_INDIRECT_PRIMARY_P in a BINFO.
11390075Sobrien
11452284Sobrien   TYPE_ALIAS_SET
11552284Sobrien     This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so
11652284Sobrien     forth as a substitute for the mark bits provided in `lang_type'.
11752284Sobrien     At present, only the six low-order bits are used.
11852284Sobrien
11952284Sobrien   TYPE_BINFO
12052284Sobrien     For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO.
12190075Sobrien     For a FUNCTION_TYPE or METHOD_TYPE, this is TYPE_RAISES_EXCEPTIONS
12252284Sobrien
12390075Sobrien  BINFO_VIRTUALS
12490075Sobrien     For a binfo, this is a TREE_LIST.  The BV_DELTA of each node
12590075Sobrien     gives the amount by which to adjust the `this' pointer when
12690075Sobrien     calling the function.  If the method is an overriden version of a
12790075Sobrien     base class method, then it is assumed that, prior to adjustment,
12890075Sobrien     the this pointer points to an object of the base class.
12950397Sobrien
13090075Sobrien     The BV_VCALL_INDEX of each node, if non-NULL, gives the vtable
13190075Sobrien     index of the vcall offset for this entry.  If
13290075Sobrien     BV_USE_VCALL_INDEX_P then the corresponding vtable entry should
13390075Sobrien     use a virtual thunk, as opposed to an ordinary thunk.
13490075Sobrien
13590075Sobrien     The BV_FN is the declaration for the virtual function itself.
13690075Sobrien
13790075Sobrien   BINFO_VTABLE
13890075Sobrien     This is an expression with POINTER_TYPE that gives the value
13990075Sobrien     to which the vptr should be initialized.  Use get_vtbl_decl_for_binfo
14090075Sobrien     to extract the VAR_DECL for the complete vtable.
14190075Sobrien
14290075Sobrien   DECL_ARGUMENTS
14390075Sobrien     For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
14490075Sobrien
14590075Sobrien   DECL_VINDEX
14690075Sobrien     This field is NULL for a non-virtual function.  For a virtual
14790075Sobrien     function, it is eventually set to an INTEGER_CST indicating the
14890075Sobrien     index in the vtable at which this function can be found.  When
14990075Sobrien     a virtual function is declared, but before it is known what
15090075Sobrien     function is overriden, this field is the error_mark_node.
15190075Sobrien
15290075Sobrien     Temporarily, it may be set to a TREE_LIST whose TREE_VALUE is
15390075Sobrien     the virtual function this one overrides, and whose TREE_CHAIN is
15490075Sobrien     the old DECL_VINDEX.  */
15590075Sobrien
15690075Sobrien/* Language-specific tree checkers. */
15790075Sobrien
15890075Sobrien#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
15990075Sobrien
16090075Sobrien#define VAR_OR_FUNCTION_DECL_CHECK(NODE)			\
16190075Sobrien({  const tree __t = (NODE);					\
16290075Sobrien    enum tree_code const __c = TREE_CODE(__t);			\
16390075Sobrien    if (__c != VAR_DECL && __c != FUNCTION_DECL)		\
16490075Sobrien      tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__,	\
16590075Sobrien			 __FUNCTION__);				\
16690075Sobrien    __t; })
16790075Sobrien
16890075Sobrien#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE)			\
16990075Sobrien({  const tree __t = (NODE);					\
17090075Sobrien    enum tree_code const __c = TREE_CODE(__t);			\
17190075Sobrien    if (__c != VAR_DECL						\
17290075Sobrien	&& __c != FUNCTION_DECL					\
17390075Sobrien        && __c != PARM_DECL)					\
17490075Sobrien      tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__,	\
17590075Sobrien			 __FUNCTION__);				\
17690075Sobrien    __t; })
17790075Sobrien
17890075Sobrien#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE)		\
17990075Sobrien({  const tree __t = (NODE);					\
18090075Sobrien    enum tree_code const __c = TREE_CODE(__t);			\
18190075Sobrien    if (__c != VAR_DECL						\
18290075Sobrien	&& __c != FUNCTION_DECL					\
18390075Sobrien	&& __c != TYPE_DECL					\
18490075Sobrien	&& __c != TEMPLATE_DECL)				\
18590075Sobrien      tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__,	\
18690075Sobrien			 __FUNCTION__);				\
18790075Sobrien    __t; })
18890075Sobrien
18990075Sobrien#define RECORD_OR_UNION_TYPE_CHECK(NODE)			\
19090075Sobrien({  const tree __t = (NODE);					\
19190075Sobrien    enum tree_code const __c = TREE_CODE(__t);			\
19290075Sobrien    if (__c != RECORD_TYPE && __c != UNION_TYPE)		\
19390075Sobrien      tree_check_failed (__t, RECORD_TYPE, __FILE__, __LINE__,	\
19490075Sobrien			 __FUNCTION__);				\
19590075Sobrien    __t; })
19690075Sobrien
19790075Sobrien#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE)		\
19890075Sobrien({  const tree __t = (NODE);					\
19990075Sobrien    enum tree_code const __c = TREE_CODE(__t);			\
20090075Sobrien    if (__c != BOUND_TEMPLATE_TEMPLATE_PARM)			\
20190075Sobrien      tree_check_failed (__t, BOUND_TEMPLATE_TEMPLATE_PARM,	\
20290075Sobrien			 __FILE__, __LINE__, __FUNCTION__);	\
20390075Sobrien    __t; })
20490075Sobrien
20590075Sobrien#else /* not ENABLE_TREE_CHECKING, or not gcc */
20690075Sobrien
20790075Sobrien#define VAR_OR_FUNCTION_DECL_CHECK(NODE)		(NODE)
20890075Sobrien#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE)   	(NODE)
20990075Sobrien#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE)	(NODE)
21090075Sobrien#define RECORD_OR_UNION_TYPE_CHECK(NODE)		(NODE)
21190075Sobrien#define BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK(NODE)	(NODE)
21290075Sobrien
21390075Sobrien#endif
21490075Sobrien
21590075Sobrien
21690075Sobrien/* ABI control.  */
21790075Sobrien
21890075Sobrien/* Nonzero to use __cxa_atexit, rather than atexit, to register
21990075Sobrien   destructors for local statics and global objects.  */
22090075Sobrien
22190075Sobrienextern int flag_use_cxa_atexit;
22290075Sobrien
22390075Sobrien/* Nonzero means generate 'rtti' that give run-time type information.  */
22490075Sobrien
22590075Sobrienextern int flag_rtti;
22690075Sobrien
22790075Sobrien/* Nonzero if we want to support huge (> 2^(sizeof(short)*8-1) bytes)
22890075Sobrien   objects.  */
22990075Sobrien
23090075Sobrienextern int flag_huge_objects;
23190075Sobrien
23290075Sobrien
23318334Speter/* Language-dependent contents of an identifier.  */
23418334Speter
23518334Speterstruct lang_identifier
23618334Speter{
23790075Sobrien  struct c_common_identifier ignore;
23852284Sobrien  tree namespace_bindings;
23952284Sobrien  tree bindings;
24018334Speter  tree class_value;
24118334Speter  tree class_template_info;
24218334Speter  struct lang_id2 *x;
24318334Speter};
24418334Speter
24590075Sobrien/* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
24690075Sobrien   keyword.  C_RID_CODE (node) is then the RID_* value of the keyword,
24790075Sobrien   and C_RID_YYCODE is the token number wanted by Yacc.  */
24890075Sobrien
24990075Sobrien#define C_IS_RESERVED_WORD(ID) TREE_LANG_FLAG_5 (ID)
25090075Sobrien
25190075Sobrienextern const short rid_to_yy[RID_MAX];
25290075Sobrien#define C_RID_YYCODE(ID) rid_to_yy[C_RID_CODE (ID)]
25390075Sobrien
25490075Sobrien#define LANG_IDENTIFIER_CAST(NODE) \
25590075Sobrien	((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
25690075Sobrien
25718334Speterstruct lang_id2
25818334Speter{
25918334Speter  tree label_value, implicit_decl;
26052284Sobrien  tree error_locus;
26118334Speter};
26218334Speter
26390075Sobrientypedef struct
26450397Sobrien{
26550397Sobrien  tree t;
26650397Sobrien  int new_type_flag;
26790075Sobrien  tree lookups;
26850397Sobrien} flagged_type_tree;
26950397Sobrien
27090075Sobrientypedef struct
27150397Sobrien{
27290075Sobrien  struct tree_common common;
27350397Sobrien  HOST_WIDE_INT index;
27450397Sobrien  HOST_WIDE_INT level;
27550397Sobrien  HOST_WIDE_INT orig_level;
27650397Sobrien  tree decl;
27750397Sobrien} template_parm_index;
27850397Sobrien
27952284Sobrientypedef struct ptrmem_cst
28052284Sobrien{
28190075Sobrien  struct tree_common common;
28290075Sobrien  /* This isn't used, but the middle-end expects all constants to have
28390075Sobrien     this field.  */
28490075Sobrien  rtx rtl;
28552284Sobrien  tree member;
28652284Sobrien}* ptrmem_cst_t;
28752284Sobrien
28852284Sobrien/* Nonzero if this binding is for a local scope, as opposed to a class
28952284Sobrien   or namespace scope.  */
29090075Sobrien#define LOCAL_BINDING_P(NODE) TREE_LANG_FLAG_0 (NODE)
29152284Sobrien
29252284Sobrien/* Nonzero if BINDING_VALUE is from a base class of the class which is
29352284Sobrien   currently being defined.  */
29490075Sobrien#define INHERITED_VALUE_BINDING_P(NODE) TREE_LANG_FLAG_1 (NODE)
29552284Sobrien
29652284Sobrien/* For a binding between a name and an entity at a non-local scope,
29752284Sobrien   defines the scope where the binding is declared.  (Either a class
29852284Sobrien   _TYPE node, or a NAMESPACE_DECL.)  This macro should be used only
29952284Sobrien   for namespace-level bindings; on the IDENTIFIER_BINDING list
30052284Sobrien   BINDING_LEVEL is used instead.  */
30190075Sobrien#define BINDING_SCOPE(NODE) \
30290075Sobrien  (((struct tree_binding*)CPLUS_BINDING_CHECK (NODE))->scope.scope)
30352284Sobrien
30490075Sobrien/* Nonzero if NODE has BINDING_LEVEL, rather than BINDING_SCOPE.  */
30590075Sobrien#define BINDING_HAS_LEVEL_P(NODE) TREE_LANG_FLAG_2 (NODE)
30690075Sobrien
30750397Sobrien/* This is the declaration bound to the name. Possible values:
30850397Sobrien   variable, overloaded function, namespace, template, enumerator.  */
30990075Sobrien#define BINDING_VALUE(NODE) \
31090075Sobrien  (((struct tree_binding*)CPLUS_BINDING_CHECK (NODE))->value)
31152284Sobrien
31250397Sobrien/* If name is bound to a type, this is the type (struct, union, enum).  */
31390075Sobrien#define BINDING_TYPE(NODE)     TREE_TYPE (NODE)
31452284Sobrien
31550397Sobrien#define IDENTIFIER_GLOBAL_VALUE(NODE) \
31690075Sobrien  namespace_binding ((NODE), global_namespace)
31750397Sobrien#define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \
31890075Sobrien  set_namespace_binding ((NODE), global_namespace, (VAL))
31950397Sobrien#define IDENTIFIER_NAMESPACE_VALUE(NODE) \
32090075Sobrien  namespace_binding ((NODE), current_namespace)
32150397Sobrien#define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
32290075Sobrien  set_namespace_binding ((NODE), current_namespace, (VAL))
32350397Sobrien
32490075Sobrien#define CLEANUP_P(NODE)         TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
32590075Sobrien
32690075Sobrien/* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual
32790075Sobrien   sense of `same'.  */
32890075Sobrien#define same_type_p(TYPE1, TYPE2) \
32990075Sobrien  comptypes ((TYPE1), (TYPE2), COMPARE_STRICT)
33090075Sobrien
33190075Sobrien/* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring
33290075Sobrien   top-level qualifiers.  */
33390075Sobrien#define same_type_ignoring_top_level_qualifiers_p(TYPE1, TYPE2) \
33490075Sobrien  same_type_p (TYPE_MAIN_VARIANT (TYPE1), TYPE_MAIN_VARIANT (TYPE2))
33590075Sobrien
33690075Sobrien/* Non-zero if we are presently building a statement tree, rather
33790075Sobrien   than expanding each statement as we encounter it.  */
33890075Sobrien#define building_stmt_tree() (last_tree != NULL_TREE)
33990075Sobrien
34090075Sobrien/* Returns non-zero iff NODE is a declaration for the global function
34190075Sobrien   `main'.  */
34290075Sobrien#define DECL_MAIN_P(NODE)				\
34390075Sobrien   (DECL_EXTERN_C_FUNCTION_P (NODE)                     \
34490075Sobrien    && DECL_NAME (NODE) != NULL_TREE			\
34590075Sobrien    && MAIN_NAME_P (DECL_NAME (NODE)))
34690075Sobrien
34790075Sobrien
34850397Sobrienstruct tree_binding
34950397Sobrien{
35090075Sobrien  struct tree_common common;
35152284Sobrien  union {
35252284Sobrien    tree scope;
35352284Sobrien    struct binding_level *level;
35452284Sobrien  } scope;
35550397Sobrien  tree value;
35650397Sobrien};
35750397Sobrien
35850397Sobrien/* The overloaded FUNCTION_DECL. */
35990075Sobrien#define OVL_FUNCTION(NODE) \
36090075Sobrien  (((struct tree_overload*)OVERLOAD_CHECK (NODE))->function)
36190075Sobrien#define OVL_CHAIN(NODE)      TREE_CHAIN (NODE)
36250397Sobrien/* Polymorphic access to FUNCTION and CHAIN. */
36350397Sobrien#define OVL_CURRENT(NODE)     \
36490075Sobrien  ((TREE_CODE (NODE) == OVERLOAD) ? OVL_FUNCTION (NODE) : (NODE))
36550397Sobrien#define OVL_NEXT(NODE)        \
36690075Sobrien  ((TREE_CODE (NODE) == OVERLOAD) ? TREE_CHAIN (NODE) : NULL_TREE)
36750397Sobrien/* If set, this was imported in a using declaration.
36850397Sobrien   This is not to confuse with being used somewhere, which
36950397Sobrien   is not important for this node. */
37090075Sobrien#define OVL_USED(NODE)        TREE_USED (NODE)
37150397Sobrien
37250397Sobrienstruct tree_overload
37350397Sobrien{
37490075Sobrien  struct tree_common common;
37550397Sobrien  tree function;
37650397Sobrien};
37750397Sobrien
37852284Sobrien/* A `baselink' is a TREE_LIST whose TREE_PURPOSE is a BINFO
37952284Sobrien   indicating a particular base class, and whose TREE_VALUE is a
38052284Sobrien   (possibly overloaded) function from that base class.  */
38152284Sobrien#define BASELINK_P(NODE) \
38290075Sobrien  (TREE_CODE (NODE) == TREE_LIST && TREE_LANG_FLAG_1 (NODE))
38352284Sobrien#define SET_BASELINK_P(NODE) \
38490075Sobrien  (TREE_LANG_FLAG_1 (NODE) = 1)
38552284Sobrien
38690075Sobrien#define WRAPPER_PTR(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.ptr)
38790075Sobrien#define WRAPPER_INT(NODE) (((struct tree_wrapper*)WRAPPER_CHECK (NODE))->u.i)
38850397Sobrien
38950397Sobrienstruct tree_wrapper
39050397Sobrien{
39190075Sobrien  struct tree_common common;
39250397Sobrien  union {
39350397Sobrien    void *ptr;
39450397Sobrien    int i;
39550397Sobrien  } u;
39650397Sobrien};
39750397Sobrien
39890075Sobrien#define SRCLOC_FILE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->filename)
39990075Sobrien#define SRCLOC_LINE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->linenum)
40050397Sobrienstruct tree_srcloc
40150397Sobrien{
40290075Sobrien  struct tree_common common;
40390075Sobrien  const char *filename;
40450397Sobrien  int linenum;
40550397Sobrien};
40650397Sobrien
40718334Speter/* Macros for access to language-specific slots in an identifier.  */
40818334Speter
40950397Sobrien#define IDENTIFIER_NAMESPACE_BINDINGS(NODE)	\
41090075Sobrien  (LANG_IDENTIFIER_CAST (NODE)->namespace_bindings)
41118334Speter#define IDENTIFIER_TEMPLATE(NODE)	\
41290075Sobrien  (LANG_IDENTIFIER_CAST (NODE)->class_template_info)
41318334Speter
41452284Sobrien/* The IDENTIFIER_BINDING is the innermost CPLUS_BINDING for the
41552284Sobrien    identifier.  It's TREE_CHAIN is the next outermost binding.  Each
41652284Sobrien    BINDING_VALUE is a DECL for the associated declaration.  Thus,
41752284Sobrien    name lookup consists simply of pulling off the node at the front
41852284Sobrien    of the list (modulo oddities for looking up the names of types,
41952284Sobrien    and such.)  You can use BINDING_SCOPE or BINDING_LEVEL to
42052284Sobrien    determine the scope that bound the name.  */
42152284Sobrien#define IDENTIFIER_BINDING(NODE) \
42290075Sobrien  (LANG_IDENTIFIER_CAST (NODE)->bindings)
42352284Sobrien
42452284Sobrien/* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or
42552284Sobrien   NULL_TREE if there is no binding.  */
42652284Sobrien#define IDENTIFIER_VALUE(NODE)			\
42790075Sobrien  (IDENTIFIER_BINDING (NODE)			\
42852284Sobrien   ? BINDING_VALUE (IDENTIFIER_BINDING (NODE))	\
42952284Sobrien   : NULL_TREE)
43052284Sobrien
43152284Sobrien/* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current
43252284Sobrien   class, and IDENTIFIER_CLASS_VALUE is the value binding.  This is
43352284Sobrien   just a pointer to the BINDING_VALUE of one of the bindings in the
43452284Sobrien   IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is
43552284Sobrien   IDENTIFIER_BINDING.  */
43652284Sobrien#define IDENTIFIER_CLASS_VALUE(NODE) \
43790075Sobrien  (LANG_IDENTIFIER_CAST (NODE)->class_value)
43852284Sobrien
43950397Sobrien/* TREE_TYPE only indicates on local and class scope the current
44050397Sobrien   type. For namespace scope, the presence of a type in any namespace
44150397Sobrien   is indicated with global_type_node, and the real type behind must
44250397Sobrien   be found through lookup. */
44390075Sobrien#define IDENTIFIER_TYPE_VALUE(NODE) identifier_type_value (NODE)
44490075Sobrien#define REAL_IDENTIFIER_TYPE_VALUE(NODE) TREE_TYPE (NODE)
44590075Sobrien#define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = (TYPE))
44650397Sobrien#define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0)
44718334Speter
44890075Sobrien#define LANG_ID_FIELD(NAME, NODE)			\
44990075Sobrien  (LANG_IDENTIFIER_CAST (NODE)->x			\
45090075Sobrien   ? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)
45118334Speter
45290075Sobrien#define SET_LANG_ID(NODE, VALUE, NAME)					  \
45390075Sobrien  (LANG_IDENTIFIER_CAST (NODE)->x == 0				  	  \
45490075Sobrien   ? LANG_IDENTIFIER_CAST (NODE)->x					  \
45590075Sobrien      = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \
45690075Sobrien   LANG_IDENTIFIER_CAST (NODE)->x->NAME = (VALUE))
45718334Speter
45890075Sobrien#define IDENTIFIER_LABEL_VALUE(NODE) \
45990075Sobrien  LANG_ID_FIELD (label_value, NODE)
46090075Sobrien#define SET_IDENTIFIER_LABEL_VALUE(NODE, VALUE)   \
46190075Sobrien  SET_LANG_ID (NODE, VALUE, label_value)
46218334Speter
46390075Sobrien#define IDENTIFIER_IMPLICIT_DECL(NODE) \
46490075Sobrien  LANG_ID_FIELD (implicit_decl, NODE)
46590075Sobrien#define SET_IDENTIFIER_IMPLICIT_DECL(NODE, VALUE) \
46690075Sobrien  SET_LANG_ID (NODE, VALUE, implicit_decl)
46718334Speter
46890075Sobrien#define IDENTIFIER_ERROR_LOCUS(NODE) \
46990075Sobrien  LANG_ID_FIELD (error_locus, NODE)
47090075Sobrien#define SET_IDENTIFIER_ERROR_LOCUS(NODE, VALUE)	\
47190075Sobrien  SET_LANG_ID (NODE, VALUE, error_locus)
47218334Speter
47390075Sobrien/* Nonzero if this identifier is used as a virtual function name somewhere
47490075Sobrien   (optimizes searches).  */
47590075Sobrien#define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1 (NODE)
47618334Speter
47790075Sobrien/* Nonzero if this identifier is the prefix for a mangled C++ operator
47890075Sobrien   name.  */
47990075Sobrien#define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2 (NODE)
48018334Speter
48152284Sobrien/* Nonzero if this identifier is the name of a type-conversion
48252284Sobrien   operator.  */
48390075Sobrien#define IDENTIFIER_TYPENAME_P(NODE) \
48490075Sobrien  TREE_LANG_FLAG_4 (NODE)
48518334Speter
48690075Sobrien/* Nonzero if this identifier is the name of a constructor or
48790075Sobrien   destructor.  */
48890075Sobrien#define IDENTIFIER_CTOR_OR_DTOR_P(NODE) \
48990075Sobrien  TREE_LANG_FLAG_3 (NODE)
49018334Speter
49118334Speter/* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only.  */
49290075Sobrien#define C_TYPE_FIELDS_READONLY(TYPE) TYPE_LANG_FLAG_0 (TYPE)
49318334Speter
49418334Speter/* Store a value in that field.  */
49590075Sobrien#define C_SET_EXP_ORIGINAL_CODE(EXP, CODE) \
49690075Sobrien  (TREE_COMPLEXITY (EXP) = (int)(CODE))
49718334Speter
49818334Speter/* If non-zero, a VAR_DECL whose cleanup will cause a throw to the
49918334Speter   next exception handler.  */
50018334Speterextern tree exception_throw_decl;
50118334Speter
50290075Sobrienenum cp_tree_index
50390075Sobrien{
50490075Sobrien    CPTI_JAVA_BYTE_TYPE,
50590075Sobrien    CPTI_JAVA_SHORT_TYPE,
50690075Sobrien    CPTI_JAVA_INT_TYPE,
50790075Sobrien    CPTI_JAVA_LONG_TYPE,
50890075Sobrien    CPTI_JAVA_FLOAT_TYPE,
50990075Sobrien    CPTI_JAVA_DOUBLE_TYPE,
51090075Sobrien    CPTI_JAVA_CHAR_TYPE,
51190075Sobrien    CPTI_JAVA_BOOLEAN_TYPE,
51218334Speter
51390075Sobrien    CPTI_WCHAR_DECL,
51490075Sobrien    CPTI_VTABLE_ENTRY_TYPE,
51590075Sobrien    CPTI_DELTA_TYPE,
51690075Sobrien    CPTI_VTABLE_INDEX_TYPE,
51790075Sobrien    CPTI_CLEANUP_TYPE,
51890075Sobrien    CPTI_VTT_PARM_TYPE,
51950397Sobrien
52090075Sobrien    CPTI_TI_DESC_TYPE,
52190075Sobrien    CPTI_BLTN_DESC_TYPE,
52290075Sobrien    CPTI_PTR_DESC_TYPE,
52390075Sobrien    CPTI_ARY_DESC_TYPE,
52490075Sobrien    CPTI_FUNC_DESC_TYPE,
52590075Sobrien    CPTI_ENUM_DESC_TYPE,
52690075Sobrien    CPTI_CLASS_DESC_TYPE,
52790075Sobrien    CPTI_SI_CLASS_DESC_TYPE,
52890075Sobrien    CPTI_VMI_CLASS_DESC_TYPE,
52990075Sobrien    CPTI_PTM_DESC_TYPE,
53090075Sobrien    CPTI_BASE_DESC_TYPE,
53150397Sobrien
53290075Sobrien    CPTI_CLASS_TYPE,
53390075Sobrien    CPTI_RECORD_TYPE,
53490075Sobrien    CPTI_UNION_TYPE,
53590075Sobrien    CPTI_ENUM_TYPE,
53690075Sobrien    CPTI_UNKNOWN_TYPE,
53790075Sobrien    CPTI_VTBL_TYPE,
53890075Sobrien    CPTI_VTBL_PTR_TYPE,
53990075Sobrien    CPTI_STD,
54090075Sobrien    CPTI_ABI,
54190075Sobrien    CPTI_TYPE_INFO_TYPE,
542102780Skan    CPTI_TYPE_INFO_PTR_TYPE,
54390075Sobrien    CPTI_ABORT_FNDECL,
54490075Sobrien    CPTI_GLOBAL_DELETE_FNDECL,
54590075Sobrien    CPTI_AGGR_TAG,
54618334Speter
54790075Sobrien    CPTI_ACCESS_DEFAULT,
54890075Sobrien    CPTI_ACCESS_PUBLIC,
54990075Sobrien    CPTI_ACCESS_PROTECTED,
55090075Sobrien    CPTI_ACCESS_PRIVATE,
55190075Sobrien    CPTI_ACCESS_DEFAULT_VIRTUAL,
55290075Sobrien    CPTI_ACCESS_PUBLIC_VIRTUAL,
55390075Sobrien    CPTI_ACCESS_PROTECTED_VIRTUAL,
55490075Sobrien    CPTI_ACCESS_PRIVATE_VIRTUAL,
55550397Sobrien
55690075Sobrien    CPTI_CTOR_IDENTIFIER,
55790075Sobrien    CPTI_COMPLETE_CTOR_IDENTIFIER,
55890075Sobrien    CPTI_BASE_CTOR_IDENTIFIER,
55990075Sobrien    CPTI_DTOR_IDENTIFIER,
56090075Sobrien    CPTI_COMPLETE_DTOR_IDENTIFIER,
56190075Sobrien    CPTI_BASE_DTOR_IDENTIFIER,
56290075Sobrien    CPTI_DELETING_DTOR_IDENTIFIER,
56390075Sobrien    CPTI_DELTA_IDENTIFIER,
56490075Sobrien    CPTI_IN_CHARGE_IDENTIFIER,
56590075Sobrien    CPTI_VTT_PARM_IDENTIFIER,
56690075Sobrien    CPTI_NELTS_IDENTIFIER,
56790075Sobrien    CPTI_THIS_IDENTIFIER,
56890075Sobrien    CPTI_PFN_IDENTIFIER,
56990075Sobrien    CPTI_VPTR_IDENTIFIER,
57090075Sobrien    CPTI_STD_IDENTIFIER,
57118334Speter
57290075Sobrien    CPTI_LANG_NAME_C,
57390075Sobrien    CPTI_LANG_NAME_CPLUSPLUS,
57490075Sobrien    CPTI_LANG_NAME_JAVA,
57590075Sobrien
57690075Sobrien    CPTI_EMPTY_EXCEPT_SPEC,
57790075Sobrien    CPTI_NULL,
57890075Sobrien    CPTI_JCLASS,
57990075Sobrien    CPTI_TERMINATE,
58090075Sobrien    CPTI_CALL_UNEXPECTED,
58190075Sobrien    CPTI_ATEXIT,
58290075Sobrien    CPTI_DSO_HANDLE,
58390075Sobrien    CPTI_DCAST,
58490075Sobrien
58590075Sobrien    CPTI_MAX
58690075Sobrien};
58790075Sobrien
58890075Sobrienextern tree cp_global_trees[CPTI_MAX];
58990075Sobrien
59090075Sobrien#define java_byte_type_node		cp_global_trees[CPTI_JAVA_BYTE_TYPE]
59190075Sobrien#define java_short_type_node		cp_global_trees[CPTI_JAVA_SHORT_TYPE]
59290075Sobrien#define java_int_type_node		cp_global_trees[CPTI_JAVA_INT_TYPE]
59390075Sobrien#define java_long_type_node		cp_global_trees[CPTI_JAVA_LONG_TYPE]
59490075Sobrien#define java_float_type_node		cp_global_trees[CPTI_JAVA_FLOAT_TYPE]
59590075Sobrien#define java_double_type_node		cp_global_trees[CPTI_JAVA_DOUBLE_TYPE]
59690075Sobrien#define java_char_type_node		cp_global_trees[CPTI_JAVA_CHAR_TYPE]
59790075Sobrien#define java_boolean_type_node		cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
59890075Sobrien
59990075Sobrien#define wchar_decl_node			cp_global_trees[CPTI_WCHAR_DECL]
60090075Sobrien#define vtable_entry_type		cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
60190075Sobrien/* The type used to represent an offset by which to adjust the `this'
60290075Sobrien   pointer in pointer-to-member types.  */
60390075Sobrien#define delta_type_node			cp_global_trees[CPTI_DELTA_TYPE]
60490075Sobrien/* The type used to represent an index into the vtable.  */
60590075Sobrien#define vtable_index_type               cp_global_trees[CPTI_VTABLE_INDEX_TYPE]
60690075Sobrien
60790075Sobrien#define ti_desc_type_node		cp_global_trees[CPTI_TI_DESC_TYPE]
60890075Sobrien#define bltn_desc_type_node		cp_global_trees[CPTI_BLTN_DESC_TYPE]
60990075Sobrien#define ptr_desc_type_node		cp_global_trees[CPTI_PTR_DESC_TYPE]
61090075Sobrien#define ary_desc_type_node		cp_global_trees[CPTI_ARY_DESC_TYPE]
61190075Sobrien#define func_desc_type_node		cp_global_trees[CPTI_FUNC_DESC_TYPE]
61290075Sobrien#define enum_desc_type_node		cp_global_trees[CPTI_ENUM_DESC_TYPE]
61390075Sobrien#define class_desc_type_node		cp_global_trees[CPTI_CLASS_DESC_TYPE]
61490075Sobrien#define si_class_desc_type_node		cp_global_trees[CPTI_SI_CLASS_DESC_TYPE]
61590075Sobrien#define vmi_class_desc_type_node	cp_global_trees[CPTI_VMI_CLASS_DESC_TYPE]
61690075Sobrien#define ptm_desc_type_node		cp_global_trees[CPTI_PTM_DESC_TYPE]
61790075Sobrien#define base_desc_type_node		cp_global_trees[CPTI_BASE_DESC_TYPE]
61890075Sobrien
61990075Sobrien#define class_type_node			cp_global_trees[CPTI_CLASS_TYPE]
62090075Sobrien#define record_type_node		cp_global_trees[CPTI_RECORD_TYPE]
62190075Sobrien#define union_type_node			cp_global_trees[CPTI_UNION_TYPE]
62290075Sobrien#define enum_type_node			cp_global_trees[CPTI_ENUM_TYPE]
62390075Sobrien#define unknown_type_node		cp_global_trees[CPTI_UNKNOWN_TYPE]
62490075Sobrien#define vtbl_type_node			cp_global_trees[CPTI_VTBL_TYPE]
62590075Sobrien#define vtbl_ptr_type_node		cp_global_trees[CPTI_VTBL_PTR_TYPE]
62690075Sobrien#define std_node			cp_global_trees[CPTI_STD]
62790075Sobrien#define abi_node                        cp_global_trees[CPTI_ABI]
62890075Sobrien#define type_info_type_node		cp_global_trees[CPTI_TYPE_INFO_TYPE]
629102780Skan#define type_info_ptr_type		cp_global_trees[CPTI_TYPE_INFO_PTR_TYPE]
63090075Sobrien#define abort_fndecl			cp_global_trees[CPTI_ABORT_FNDECL]
63190075Sobrien#define global_delete_fndecl		cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
63290075Sobrien#define current_aggr			cp_global_trees[CPTI_AGGR_TAG]
63390075Sobrien
63490075Sobrien/* Define the sets of attributes that member functions and baseclasses
63590075Sobrien   can have.  These are sensible combinations of {public,private,protected}
63690075Sobrien   cross {virtual,non-virtual}.  */
63790075Sobrien
63890075Sobrien#define access_default_node             cp_global_trees[CPTI_ACCESS_DEFAULT]
63990075Sobrien#define access_public_node              cp_global_trees[CPTI_ACCESS_PUBLIC]
64090075Sobrien#define access_protected_node           cp_global_trees[CPTI_ACCESS_PROTECTED]
64190075Sobrien#define access_private_node             cp_global_trees[CPTI_ACCESS_PRIVATE]
64290075Sobrien#define access_default_virtual_node     cp_global_trees[CPTI_ACCESS_DEFAULT_VIRTUAL]
64390075Sobrien#define access_public_virtual_node      cp_global_trees[CPTI_ACCESS_PUBLIC_VIRTUAL]
64490075Sobrien#define access_protected_virtual_node   cp_global_trees[CPTI_ACCESS_PROTECTED_VIRTUAL]
64590075Sobrien#define access_private_virtual_node     cp_global_trees[CPTI_ACCESS_PRIVATE_VIRTUAL]
64690075Sobrien
64790075Sobrien/* We cache these tree nodes so as to call get_identifier less
64890075Sobrien   frequently.  */
64990075Sobrien
65090075Sobrien/* The name of a constructor that takes an in-charge parameter to
65190075Sobrien   decide whether or not to construct virtual base classes.  */
65290075Sobrien#define ctor_identifier                 cp_global_trees[CPTI_CTOR_IDENTIFIER]
65390075Sobrien/* The name of a constructor that constructs virtual base classes.  */
65490075Sobrien#define complete_ctor_identifier        cp_global_trees[CPTI_COMPLETE_CTOR_IDENTIFIER]
65590075Sobrien/* The name of a constructor that does not construct virtual base classes.  */
65690075Sobrien#define base_ctor_identifier            cp_global_trees[CPTI_BASE_CTOR_IDENTIFIER]
65790075Sobrien/* The name of a destructor that takes an in-charge parameter to
65890075Sobrien   decide whether or not to destroy virtual base classes and whether
65990075Sobrien   or not to delete the object.  */
66090075Sobrien#define dtor_identifier                 cp_global_trees[CPTI_DTOR_IDENTIFIER]
66190075Sobrien/* The name of a destructor that destroys virtual base classes.  */
66290075Sobrien#define complete_dtor_identifier        cp_global_trees[CPTI_COMPLETE_DTOR_IDENTIFIER]
66390075Sobrien/* The name of a destructor that does not destroy virtual base
66490075Sobrien   classes.  */
66590075Sobrien#define base_dtor_identifier            cp_global_trees[CPTI_BASE_DTOR_IDENTIFIER]
66690075Sobrien/* The name of a destructor that destroys virtual base classes, and
66790075Sobrien   then deletes the entire object.  */
66890075Sobrien#define deleting_dtor_identifier        cp_global_trees[CPTI_DELETING_DTOR_IDENTIFIER]
66990075Sobrien#define delta_identifier                cp_global_trees[CPTI_DELTA_IDENTIFIER]
67090075Sobrien#define in_charge_identifier            cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
67190075Sobrien/* The name of the parameter that contains a pointer to the VTT to use
67290075Sobrien   for this subobject constructor or destructor.  */
67390075Sobrien#define vtt_parm_identifier             cp_global_trees[CPTI_VTT_PARM_IDENTIFIER]
67490075Sobrien#define nelts_identifier                cp_global_trees[CPTI_NELTS_IDENTIFIER]
67590075Sobrien#define this_identifier                 cp_global_trees[CPTI_THIS_IDENTIFIER]
67690075Sobrien#define pfn_identifier                  cp_global_trees[CPTI_PFN_IDENTIFIER]
67790075Sobrien#define vptr_identifier                 cp_global_trees[CPTI_VPTR_IDENTIFIER]
67890075Sobrien/* The name of the std namespace.  */
67990075Sobrien#define std_identifier                  cp_global_trees[CPTI_STD_IDENTIFIER]
68090075Sobrien#define lang_name_c                     cp_global_trees[CPTI_LANG_NAME_C]
68190075Sobrien#define lang_name_cplusplus             cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
68290075Sobrien#define lang_name_java                  cp_global_trees[CPTI_LANG_NAME_JAVA]
68390075Sobrien
68490075Sobrien/* Exception specifier used for throw().  */
68590075Sobrien#define empty_except_spec               cp_global_trees[CPTI_EMPTY_EXCEPT_SPEC]
68690075Sobrien
68790075Sobrien/* The node for `__null'.  */
68890075Sobrien#define null_node                       cp_global_trees[CPTI_NULL]
68990075Sobrien
69090075Sobrien/* If non-NULL, a POINTER_TYPE equivalent to (java::lang::Class*). */
69190075Sobrien#define jclass_node                     cp_global_trees[CPTI_JCLASS]
69290075Sobrien
69390075Sobrien/* The declaration for `std::terminate'.  */
69490075Sobrien#define terminate_node                  cp_global_trees[CPTI_TERMINATE]
69590075Sobrien
69690075Sobrien/* The declaration for "__cxa_call_unexpected".  */
69790075Sobrien#define call_unexpected_node            cp_global_trees[CPTI_CALL_UNEXPECTED]
69890075Sobrien
69990075Sobrien/* A pointer to `std::atexit'.  */
70090075Sobrien#define atexit_node                     cp_global_trees[CPTI_ATEXIT]
70190075Sobrien
70290075Sobrien/* A pointer to `__dso_handle'.  */
70390075Sobrien#define dso_handle_node                 cp_global_trees[CPTI_DSO_HANDLE]
70490075Sobrien
70590075Sobrien/* The declaration of the dynamic_cast runtime.  */
70690075Sobrien#define dynamic_cast_node               cp_global_trees[CPTI_DCAST]
70790075Sobrien
70890075Sobrien/* The type of a destructor.  */
70990075Sobrien#define cleanup_type                    cp_global_trees[CPTI_CLEANUP_TYPE]
71090075Sobrien
71190075Sobrien/* The type of the vtt parameter passed to subobject constructors and
71290075Sobrien   destructors.  */
71390075Sobrien#define vtt_parm_type                   cp_global_trees[CPTI_VTT_PARM_TYPE]
71490075Sobrien
71590075Sobrien/* Global state.  */
71690075Sobrien
71790075Sobrienstruct saved_scope
71890075Sobrien{
71990075Sobrien  tree old_bindings;
72090075Sobrien  tree old_namespace;
72190075Sobrien  tree decl_ns_list;
72290075Sobrien  tree class_name;
72390075Sobrien  tree class_type;
72490075Sobrien  tree access_specifier;
72590075Sobrien  tree function_decl;
72690075Sobrien  varray_type lang_base;
72790075Sobrien  tree lang_name;
72890075Sobrien  tree template_parms;
72990075Sobrien  tree x_previous_class_type;
73090075Sobrien  tree x_previous_class_values;
73190075Sobrien  tree x_saved_tree;
73290075Sobrien  tree lookups;
73396263Sobrien  tree last_parms;
73490075Sobrien
73590075Sobrien  HOST_WIDE_INT x_processing_template_decl;
73690075Sobrien  int x_processing_specialization;
73790075Sobrien  int x_processing_explicit_instantiation;
73890075Sobrien  int need_pop_function_context;
73990075Sobrien
74090075Sobrien  struct stmt_tree_s x_stmt_tree;
74190075Sobrien
74290075Sobrien  struct binding_level *class_bindings;
74390075Sobrien  struct binding_level *bindings;
74490075Sobrien
74590075Sobrien  struct saved_scope *prev;
74690075Sobrien};
74790075Sobrien
74890075Sobrien/* The current open namespace.  */
74990075Sobrien
75090075Sobrien#define current_namespace scope_chain->old_namespace
75190075Sobrien
75290075Sobrien/* The stack for namespaces of current declarations. */
75390075Sobrien
75490075Sobrien#define decl_namespace_list scope_chain->decl_ns_list
75590075Sobrien
75690075Sobrien/* IDENTIFIER_NODE: name of current class */
75790075Sobrien
75890075Sobrien#define current_class_name scope_chain->class_name
75990075Sobrien
76090075Sobrien/* _TYPE: the type of the current class */
76190075Sobrien
76290075Sobrien#define current_class_type scope_chain->class_type
76390075Sobrien
76490075Sobrien/* When parsing a class definition, the access specifier most recently
76590075Sobrien   given by the user, or, if no access specifier was given, the
76690075Sobrien   default value appropriate for the kind of class (i.e., struct,
76790075Sobrien   class, or union).  */
76890075Sobrien
76990075Sobrien#define current_access_specifier scope_chain->access_specifier
77090075Sobrien
77190075Sobrien/* Pointer to the top of the language name stack.  */
77290075Sobrien
77390075Sobrien#define current_lang_base scope_chain->lang_base
77490075Sobrien#define current_lang_name scope_chain->lang_name
77590075Sobrien
77690075Sobrien/* Parsing a function declarator leaves a list of parameter names
77790075Sobrien   or a chain or parameter decls here.  */
77890075Sobrien
77990075Sobrien#define current_template_parms scope_chain->template_parms
78090075Sobrien
78190075Sobrien#define processing_template_decl scope_chain->x_processing_template_decl
78290075Sobrien#define processing_specialization scope_chain->x_processing_specialization
78390075Sobrien#define processing_explicit_instantiation scope_chain->x_processing_explicit_instantiation
78490075Sobrien
78590075Sobrien/* _TYPE: the previous type that was a class */
78690075Sobrien
78790075Sobrien#define previous_class_type scope_chain->x_previous_class_type
78890075Sobrien
78990075Sobrien/* This is a copy of the class_shadowed list of the previous class
79090075Sobrien   binding contour when at global scope.  It's used to reset
79190075Sobrien   IDENTIFIER_CLASS_VALUEs when entering another class scope (i.e. a
79290075Sobrien   cache miss).  */
79390075Sobrien
79490075Sobrien#define previous_class_values scope_chain->x_previous_class_values
79590075Sobrien
79690075Sobrien/* A list of private types mentioned, for deferred access checking.  */
79790075Sobrien
79890075Sobrien#define type_lookups scope_chain->lookups
79990075Sobrien
80090075Sobrienextern struct saved_scope *scope_chain;
80190075Sobrien
80290075Sobrienstruct unparsed_text;
80390075Sobrien
80490075Sobrien/* Global state pertinent to the current function.  */
80590075Sobrien
80690075Sobrienstruct cp_language_function
80790075Sobrien{
80890075Sobrien  struct language_function base;
80990075Sobrien
81090075Sobrien  tree x_dtor_label;
81190075Sobrien  tree x_current_class_ptr;
81290075Sobrien  tree x_current_class_ref;
81390075Sobrien  tree x_eh_spec_block;
81490075Sobrien  tree x_in_charge_parm;
81590075Sobrien  tree x_vtt_parm;
81690075Sobrien  tree x_return_value;
81790075Sobrien
81890075Sobrien  tree *x_vcalls_possible_p;
81990075Sobrien
82090075Sobrien  int returns_value;
82190075Sobrien  int returns_null;
82296263Sobrien  int returns_abnormally;
82390075Sobrien  int in_function_try_handler;
82490075Sobrien  int x_expanding_p;
82590075Sobrien
82690075Sobrien  struct named_label_use_list *x_named_label_uses;
82790075Sobrien  struct named_label_list *x_named_labels;
82890075Sobrien  struct binding_level *bindings;
82990075Sobrien  varray_type x_local_names;
83090075Sobrien
83190075Sobrien  const char *cannot_inline;
83290075Sobrien  struct unparsed_text *unparsed_inlines;
83390075Sobrien};
83490075Sobrien
83590075Sobrien/* The current C++-specific per-function global variables.  */
83690075Sobrien
83790075Sobrien#define cp_function_chain \
83890075Sobrien  ((struct cp_language_function *) (cfun->language))
83990075Sobrien
84090075Sobrien/* In a destructor, the point at which all derived class destroying
84190075Sobrien   has been done, just before any base class destroying will be done.  */
84290075Sobrien
84390075Sobrien#define dtor_label cp_function_chain->x_dtor_label
84490075Sobrien
84590075Sobrien/* When we're processing a member function, current_class_ptr is the
84690075Sobrien   PARM_DECL for the `this' pointer.  The current_class_ref is an
84790075Sobrien   expression for `*this'.  */
84890075Sobrien
84990075Sobrien#define current_class_ptr \
85090075Sobrien  (cfun ? cp_function_chain->x_current_class_ptr : NULL_TREE)
85190075Sobrien#define current_class_ref \
85290075Sobrien  (cfun ? cp_function_chain->x_current_class_ref : NULL_TREE)
85390075Sobrien
85490075Sobrien/* The EH_SPEC_BLOCK for the exception-specifiers for the current
85590075Sobrien   function, if any.  */
85690075Sobrien
85790075Sobrien#define current_eh_spec_block cp_function_chain->x_eh_spec_block
85890075Sobrien
85990075Sobrien/* The `__in_chrg' parameter for the current function.  Only used for
86090075Sobrien   constructors and destructors.  */
86190075Sobrien
86290075Sobrien#define current_in_charge_parm cp_function_chain->x_in_charge_parm
86390075Sobrien
86490075Sobrien/* The `__vtt_parm' parameter for the current function.  Only used for
86590075Sobrien   constructors and destructors.  */
86690075Sobrien
86790075Sobrien#define current_vtt_parm cp_function_chain->x_vtt_parm
86890075Sobrien
86990075Sobrien/* In destructors, this is a pointer to a condition in an
87090075Sobrien   if-statement.  If the pointed-to value is boolean_true_node, then
87190075Sobrien   there may be virtual function calls in this destructor.  */
87290075Sobrien
87390075Sobrien#define current_vcalls_possible_p cp_function_chain->x_vcalls_possible_p
87490075Sobrien
87590075Sobrien/* Set to 0 at beginning of a function definition, set to 1 if
87690075Sobrien   a return statement that specifies a return value is seen.  */
87790075Sobrien
87890075Sobrien#define current_function_returns_value cp_function_chain->returns_value
87990075Sobrien
88090075Sobrien/* Set to 0 at beginning of a function definition, set to 1 if
88190075Sobrien   a return statement with no argument is seen.  */
88290075Sobrien
88390075Sobrien#define current_function_returns_null cp_function_chain->returns_null
88490075Sobrien
88596263Sobrien/* Set to 0 at beginning of a function definition, set to 1 if
88696263Sobrien   a call to a noreturn function is seen.  */
88796263Sobrien
88896263Sobrien#define current_function_returns_abnormally \
88996263Sobrien  cp_function_chain->returns_abnormally
89096263Sobrien
89190075Sobrien/* Non-zero if we should generate RTL for functions that we process.
89290075Sobrien   When this is zero, we just accumulate tree structure, without
89390075Sobrien   interacting with the back end.  */
89490075Sobrien
89590075Sobrien#define expanding_p cp_function_chain->x_expanding_p
89690075Sobrien
89790075Sobrien/* Non-zero if we are in the semantic analysis phase for the current
89890075Sobrien   function.  */
89990075Sobrien
90090075Sobrien#define doing_semantic_analysis_p() (!expanding_p)
90190075Sobrien
90290075Sobrien#define in_function_try_handler cp_function_chain->in_function_try_handler
90390075Sobrien
90490075Sobrien/* Expression always returned from function, or error_mark_node
90590075Sobrien   otherwise, for use by the automatic named return value optimization.  */
90690075Sobrien
90790075Sobrien#define current_function_return_value \
90890075Sobrien  (cp_function_chain->x_return_value)
90990075Sobrien
91050397Sobrienextern tree global_namespace;
91150397Sobrien
91290075Sobrien#define ansi_opname(CODE) \
91390075Sobrien  (operator_name_info[(int) (CODE)].identifier)
91490075Sobrien#define ansi_assopname(CODE) \
91590075Sobrien  (assignment_operator_name_info[(int) (CODE)].identifier)
91618334Speter
91718334Speter/* Nonzero means `$' can be in an identifier.  */
91818334Speter
91918334Speterextern int dollars_in_ident;
92018334Speter
92118334Speter/* Nonzero means don't recognize the keyword `asm'.  */
92218334Speter
92318334Speterextern int flag_no_asm;
92418334Speter
92590075Sobrien/* Nonzero means don't recognize any extended keywords.  */
92690075Sobrien
92790075Sobrienextern int flag_no_gnu_keywords;
92890075Sobrien
92990075Sobrien/* Nonzero means recognize the named operators from C++98.  */
93090075Sobrien
93190075Sobrienextern int flag_operator_names;
93290075Sobrien
93318334Speter/* For environments where you can use GNU binutils (as, ld in particular).  */
93418334Speter
93518334Speterextern int flag_gnu_binutils;
93618334Speter
937102780Skan/* Nonzero means warn about things that will change when compiling
938102780Skan   with an ABI-compliant compiler.  */
939102780Skan
940102780Skanextern int warn_abi;
941102780Skan
94218334Speter/* Nonzero means warn about implicit declarations.  */
94318334Speter
94418334Speterextern int warn_implicit;
94518334Speter
94618334Speter/* Nonzero means warn when all ctors or dtors are private, and the class
94718334Speter   has no friends.  */
94818334Speter
94918334Speterextern int warn_ctor_dtor_privacy;
95018334Speter
95152284Sobrien/* Nonzero means warn about deprecated conversion from string constant to
95252284Sobrien   `char *'.  */
95352284Sobrien
95418334Speterextern int warn_write_strings;
95518334Speter
95618334Speter/* Nonzero means warn about multiple (redundant) decls for the same single
95718334Speter   variable or function.  */
95818334Speter
95918334Speterextern int warn_redundant_decls;
96018334Speter
96118334Speter/* Warn if initializer is not completely bracketed.  */
96218334Speter
96318334Speterextern int warn_missing_braces;
96418334Speter
96550397Sobrien/* Warn about comparison of signed and unsigned values.  */
96650397Sobrien
96750397Sobrienextern int warn_sign_compare;
96850397Sobrien
96990075Sobrien/* Warn about testing equality of floating point numbers. */
97090075Sobrien
97190075Sobrienextern int warn_float_equal;
97290075Sobrien
97318334Speter/* Warn about a subscript that has type char.  */
97418334Speter
97518334Speterextern int warn_char_subscripts;
97618334Speter
97718334Speter/* Nonzero means warn about pointer casts that can drop a type qualifier
97818334Speter   from the pointer target type.  */
97918334Speter
98018334Speterextern int warn_cast_qual;
98118334Speter
98218334Speter/* Nonzero means warn about non virtual destructors in classes that have
98350397Sobrien   virtual functions.  */
98418334Speter
98518334Speterextern int warn_nonvdtor;
98618334Speter
98750397Sobrien/* Non-zero means warn when we convert a pointer to member function
98850397Sobrien   into a pointer to (void or function).  */
98950397Sobrien
99050397Sobrienextern int warn_pmf2ptr;
99150397Sobrien
99250397Sobrien/* Nonzero means warn about violation of some Effective C++ style rules.  */
99350397Sobrien
99450397Sobrienextern int warn_ecpp;
99550397Sobrien
99650397Sobrien/* Nonzero means warn where overload resolution chooses a promotion from
99750397Sobrien   unsigned to signed over a conversion to an unsigned of the same size.  */
99850397Sobrien
99950397Sobrienextern int warn_sign_promo;
100050397Sobrien
100150397Sobrien/* Non-zero means warn when an old-style cast is used.  */
100218334Speter
100350397Sobrienextern int warn_old_style_cast;
100418334Speter
100590075Sobrien/* Non-zero means warn when the compiler will reorder code.  */
100618334Speter
100790075Sobrienextern int warn_reorder;
100818334Speter
100990075Sobrien/* Non-zero means warn about deprecated features.  */
101018334Speter
101190075Sobrienextern int warn_deprecated;
101218334Speter
101390075Sobrien/* Nonzero means to treat bitfields as unsigned unless they say `signed'.  */
101418334Speter
101590075Sobrienextern int flag_signed_bitfields;
101690075Sobrien
101718334Speter/* INTERFACE_ONLY nonzero means that we are in an "interface"
101818334Speter   section of the compiler.  INTERFACE_UNKNOWN nonzero means
101918334Speter   we cannot trust the value of INTERFACE_ONLY.  If INTERFACE_UNKNOWN
102018334Speter   is zero and INTERFACE_ONLY is zero, it means that we are responsible
102118334Speter   for exporting definitions that others might need.  */
102218334Speterextern int interface_only, interface_unknown;
102318334Speter
102418334Speter/* Nonzero means we should attempt to elide constructors when possible.  */
102518334Speter
102618334Speterextern int flag_elide_constructors;
102718334Speter
102890075Sobrien/* Nonzero means enable obscure standard features and disable GNU
102990075Sobrien   extensions that might cause standard-compliant code to be
103090075Sobrien   miscompiled.  */
103118334Speter
103218334Speterextern int flag_ansi;
103318334Speter
103418334Speter/* Nonzero means that member functions defined in class scope are
103518334Speter   inline by default.  */
103618334Speter
103718334Speterextern int flag_default_inline;
103818334Speter
103952750Sobrien/* Nonzero means generate separate instantiation control files and juggle
104052750Sobrien   them at link time.  */
104152750Sobrienextern int flag_use_repository;
104252750Sobrien
104350397Sobrien/* Nonzero if we want to issue diagnostics that the standard says are not
104450397Sobrien   required.  */
104550397Sobrienextern int flag_optional_diags;
104652284Sobrien
104752284Sobrien/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc.  */
104852284Sobrienextern int flag_vtable_gc;
104952284Sobrien
105052284Sobrien/* Nonzero means make the default pedwarns warnings instead of errors.
105152284Sobrien   The value of this flag is ignored if -pedantic is specified.  */
105252284Sobrienextern int flag_permissive;
105352284Sobrien
105490075Sobrien/* Nonzero means to implement standard semantics for exception
105590075Sobrien   specifications, calling unexpected if an exception is thrown that
105690075Sobrien   doesn't match the specification.  Zero means to treat them as
105790075Sobrien   assertions and optimize accordingly, but not check them.  */
105890075Sobrienextern int flag_enforce_eh_specs;
105990075Sobrien
106052284Sobrien/* Nonzero if we want to obey access control semantics.  */
106152284Sobrien
106252284Sobrienextern int flag_access_control;
106352284Sobrien
106490075Sobrien/* Nonzero if we want to check the return value of new and avoid calling
106590075Sobrien   constructors if it is a null pointer.  */
106690075Sobrien
106790075Sobrienextern int flag_check_new;
106890075Sobrien
106918334Speter
107018334Speter/* C++ language-specific tree codes.  */
107118334Speter#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
107218334Speterenum cplus_tree_code {
107390075Sobrien  CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE,
107450397Sobrien#include "cp-tree.def"
107518334Speter  LAST_CPLUS_TREE_CODE
107618334Speter};
107718334Speter#undef DEFTREECODE
107818334Speter
107950397Sobrienenum languages { lang_c, lang_cplusplus, lang_java };
108018334Speter
108118334Speter/* Macros to make error reporting functions' lives easier.  */
108218334Speter#define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE)))
108390075Sobrien#define TYPE_LINKAGE_IDENTIFIER(NODE) \
108490075Sobrien  (TYPE_IDENTIFIER (TYPE_MAIN_VARIANT (NODE)))
108518334Speter#define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE)))
108618334Speter#define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE)))
108718334Speter
108890075Sobrien#define TYPE_ASSEMBLER_NAME_STRING(NODE) \
108990075Sobrien  (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME  (NODE))))
109090075Sobrien#define TYPE_ASSEMBLER_NAME_LENGTH(NODE) \
109190075Sobrien  (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE))))
109218334Speter
109390075Sobrien/* Nonzero if NODE has no name for linkage purposes.  */
109490075Sobrien#define TYPE_ANONYMOUS_P(NODE) \
109590075Sobrien  (TAGGED_TYPE_P (NODE) && ANON_AGGRNAME_P (TYPE_LINKAGE_IDENTIFIER (NODE)))
109690075Sobrien
109718334Speter/* The _DECL for this _TYPE.  */
109850397Sobrien#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE)))
109918334Speter
110052284Sobrien/* Nonzero if T is a class (or struct or union) type.  Also nonzero
110190075Sobrien   for template type parameters, typename types, and instantiated
110290075Sobrien   template template parameters.  Despite its name,
110352284Sobrien   this macro has nothing to do with the definition of aggregate given
110452284Sobrien   in the standard.  Think of this macro as MAYBE_CLASS_TYPE_P.  */
110590075Sobrien#define IS_AGGR_TYPE(T)					\
110690075Sobrien  (TREE_CODE (T) == TEMPLATE_TYPE_PARM			\
110790075Sobrien   || TREE_CODE (T) == TYPENAME_TYPE			\
110890075Sobrien   || TREE_CODE (T) == TYPEOF_TYPE			\
110990075Sobrien   || TREE_CODE (T) == BOUND_TEMPLATE_TEMPLATE_PARM	\
111090075Sobrien   || TYPE_LANG_FLAG_5 (T))
111152284Sobrien
111290075Sobrien/* Set IS_AGGR_TYPE for T to VAL.  T must be a class, struct, or
111390075Sobrien   union type.  */
111452284Sobrien#define SET_IS_AGGR_TYPE(T, VAL) \
111552284Sobrien  (TYPE_LANG_FLAG_5 (T) = (VAL))
111652284Sobrien
111752284Sobrien/* Nonzero if T is a class type.  Zero for template type parameters,
111852284Sobrien   typename types, and so forth.  */
111990075Sobrien#define CLASS_TYPE_P(T) \
112090075Sobrien  (IS_AGGR_TYPE_CODE (TREE_CODE (T)) && IS_AGGR_TYPE (T))
112152284Sobrien
112290075Sobrien#define IS_AGGR_TYPE_CODE(T)	((T) == RECORD_TYPE || (T) == UNION_TYPE)
112390075Sobrien#define IS_AGGR_TYPE_2(TYPE1, TYPE2) \
112418334Speter  (TREE_CODE (TYPE1) == TREE_CODE (TYPE2)	\
112590075Sobrien   && IS_AGGR_TYPE (TYPE1) && IS_AGGR_TYPE (TYPE2))
112690075Sobrien#define TAGGED_TYPE_P(T) \
112790075Sobrien  (CLASS_TYPE_P (T) || TREE_CODE (T) == ENUMERAL_TYPE)
112890075Sobrien#define IS_OVERLOAD_TYPE(T) TAGGED_TYPE_P (T)
112918334Speter
113018334Speter/* In a *_TYPE, nonzero means a built-in type.  */
113190075Sobrien#define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6 (NODE)
113218334Speter
113350397Sobrien/* True if this a "Java" type, defined in 'extern "Java"'. */
113490075Sobrien#define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3 (NODE)
113518334Speter
113652284Sobrien/* Nonzero if this type is const-qualified.  */
113752284Sobrien#define CP_TYPE_CONST_P(NODE)				\
113890075Sobrien  ((cp_type_quals (NODE) & TYPE_QUAL_CONST) != 0)
113952284Sobrien
114052284Sobrien/* Nonzero if this type is volatile-qualified.  */
114152284Sobrien#define CP_TYPE_VOLATILE_P(NODE)			\
114290075Sobrien  ((cp_type_quals (NODE) & TYPE_QUAL_VOLATILE) != 0)
114352284Sobrien
114452284Sobrien/* Nonzero if this type is restrict-qualified.  */
114552284Sobrien#define CP_TYPE_RESTRICT_P(NODE)			\
114690075Sobrien  ((cp_type_quals (NODE) & TYPE_QUAL_RESTRICT) != 0)
114752284Sobrien
114852284Sobrien/* Nonzero if this type is const-qualified, but not
114952284Sobrien   volatile-qualified.  Other qualifiers are ignored.  This macro is
115052284Sobrien   used to test whether or not it is OK to bind an rvalue to a
115152284Sobrien   reference.  */
115252284Sobrien#define CP_TYPE_CONST_NON_VOLATILE_P(NODE)				\
115390075Sobrien  ((cp_type_quals (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE))	\
115452284Sobrien   == TYPE_QUAL_CONST)
115552284Sobrien
115690075Sobrien#define FUNCTION_ARG_CHAIN(NODE) \
115790075Sobrien  TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE)))
115850397Sobrien
115990075Sobrien/* Given a FUNCTION_DECL, returns the first TREE_LIST out of TYPE_ARG_TYPES
116090075Sobrien   which refers to a user-written parameter.  */
116190075Sobrien#define FUNCTION_FIRST_USER_PARMTYPE(NODE) \
116290075Sobrien  skip_artificial_parms_for ((NODE), TYPE_ARG_TYPES (TREE_TYPE (NODE)))
116390075Sobrien
116490075Sobrien/* Similarly, but for DECL_ARGUMENTS.  */
116590075Sobrien#define FUNCTION_FIRST_USER_PARM(NODE) \
116690075Sobrien  skip_artificial_parms_for ((NODE), DECL_ARGUMENTS (NODE))
116790075Sobrien
116890075Sobrien#define PROMOTES_TO_AGGR_TYPE(NODE, CODE)	\
116918334Speter  (((CODE) == TREE_CODE (NODE)			\
117090075Sobrien    && IS_AGGR_TYPE (TREE_TYPE (NODE)))		\
117118334Speter   || IS_AGGR_TYPE (NODE))
117218334Speter
117390075Sobrien/* Nonzero iff TYPE is derived from PARENT. Ignores accessibility and
117490075Sobrien   ambiguity issues.  */
117590075Sobrien#define DERIVED_FROM_P(PARENT, TYPE) \
117690075Sobrien  lookup_base ((TYPE), PARENT, ba_any, NULL)
117790075Sobrien/* Nonzero iff TYPE is uniquely derived from PARENT. Ignores
117890075Sobrien   accessibility.  */
117990075Sobrien#define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) \
118090075Sobrien  lookup_base ((TYPE), (PARENT), ba_ignore | ba_quiet, NULL)
118190075Sobrien/* Nonzero iff TYPE is accessible in the current scope and uniquely
118290075Sobrien   derived from PARENT.  */
118390075Sobrien#define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \
118490075Sobrien  lookup_base ((TYPE), (PARENT), ba_check | ba_quiet, NULL)
118590075Sobrien/* Nonzero iff TYPE is publicly & uniquely derived from PARENT.  */
118690075Sobrien#define PUBLICLY_UNIQUELY_DERIVED_P(PARENT, TYPE) \
118790075Sobrien  lookup_base ((TYPE), (PARENT),  ba_not_special | ba_quiet, NULL)
118818334Speter
118952284Sobrien/* This structure provides additional information above and beyond
119052284Sobrien   what is provide in the ordinary tree_type.  In the past, we used it
119152284Sobrien   for the types of class types, template parameters types, typename
119252284Sobrien   types, and so forth.  However, there can be many (tens to hundreds
119352284Sobrien   of thousands) of template parameter types in a compilation, and
119452284Sobrien   there's no need for this additional information in that case.
119552284Sobrien   Therefore, we now use this data structure only for class types.
119652284Sobrien
119752284Sobrien   In the past, it was thought that there would be relatively few
119852284Sobrien   class types.  However, in the presence of heavy use of templates,
119952284Sobrien   many (i.e., thousands) of classes can easily be generated.
120052284Sobrien   Therefore, we should endeavor to keep the size of this structure to
120152284Sobrien   a minimum.  */
120218334Speterstruct lang_type
120318334Speter{
120490075Sobrien  unsigned char align;
120518334Speter
120690075Sobrien  unsigned has_type_conversion : 1;
120790075Sobrien  unsigned has_init_ref : 1;
120890075Sobrien  unsigned has_default_ctor : 1;
120990075Sobrien  unsigned uses_multiple_inheritance : 1;
121090075Sobrien  unsigned const_needs_init : 1;
121190075Sobrien  unsigned ref_needs_init : 1;
121290075Sobrien  unsigned has_const_assign_ref : 1;
121390075Sobrien  unsigned anon_aggr : 1;
121450397Sobrien
121590075Sobrien  unsigned has_mutable : 1;
121690075Sobrien  unsigned com_interface : 1;
121790075Sobrien  unsigned non_pod_class : 1;
121890075Sobrien  unsigned nearly_empty_p : 1;
121990075Sobrien  unsigned user_align : 1;
122090075Sobrien  unsigned has_assign_ref : 1;
122190075Sobrien  unsigned has_new : 1;
122290075Sobrien  unsigned has_array_new : 1;
122350397Sobrien
122490075Sobrien  unsigned gets_delete : 2;
122590075Sobrien  unsigned has_call_overloaded : 1;
122690075Sobrien  unsigned has_array_ref_overloaded : 1;
122790075Sobrien  unsigned has_arrow_overloaded : 1;
122890075Sobrien  unsigned interface_only : 1;
122990075Sobrien  unsigned interface_unknown : 1;
123090075Sobrien  unsigned needs_virtual_reinit : 1;
123152284Sobrien
123290075Sobrien  unsigned marks: 6;
123390075Sobrien  unsigned vec_new_uses_cookie : 1;
123490075Sobrien  unsigned declared_class : 1;
123550397Sobrien
123690075Sobrien  unsigned being_defined : 1;
123790075Sobrien  unsigned redefined : 1;
123890075Sobrien  unsigned debug_requested : 1;
123990075Sobrien  unsigned use_template : 2;
124090075Sobrien  unsigned got_semicolon : 1;
124190075Sobrien  unsigned ptrmemfunc_flag : 1;
124290075Sobrien  unsigned was_anonymous : 1;
124352284Sobrien
124490075Sobrien  unsigned has_real_assign_ref : 1;
124590075Sobrien  unsigned has_const_init_ref : 1;
124690075Sobrien  unsigned has_complex_init_ref : 1;
124790075Sobrien  unsigned has_complex_assign_ref : 1;
124890075Sobrien  unsigned has_abstract_assign_ref : 1;
124990075Sobrien  unsigned non_aggregate : 1;
125090075Sobrien  unsigned is_partial_instantiation : 1;
125190075Sobrien  unsigned java_interface : 1;
125218334Speter
1253102780Skan  unsigned non_zero_init : 1;
1254107590Sobrien  unsigned contains_empty_class_p : 1;
1255102780Skan
125690075Sobrien  /* When adding a flag here, consider whether or not it ought to
125790075Sobrien     apply to a template instance if it applies to the template.  If
125890075Sobrien     so, make sure to copy it in instantiate_class_template!  */
125918334Speter
126090075Sobrien  /* There are some bits left to fill out a 32-bit word.  Keep track
126190075Sobrien     of this by updating the size of this bitfield whenever you add or
126290075Sobrien     remove a flag.  */
1263107590Sobrien  unsigned dummy : 6;
126490075Sobrien
126518334Speter  int vsize;
126618334Speter
126790075Sobrien  tree primary_base;
126890075Sobrien  tree vfields;
126990075Sobrien  tree vbases;
127090075Sobrien  tree tags;
127190075Sobrien  tree size;
127290075Sobrien  tree size_unit;
127390075Sobrien  tree pure_virtuals;
127490075Sobrien  tree friend_classes;
127590075Sobrien  tree rtti;
127690075Sobrien  tree methods;
127790075Sobrien  tree template_info;
127852284Sobrien  tree befriending_classes;
127918334Speter};
128018334Speter
128118334Speter/* Indicates whether or not (and how) a template was expanded for this class.
128218334Speter     0=no information yet/non-template class
128318334Speter     1=implicit template instantiation
128418334Speter     2=explicit template specialization
128518334Speter     3=explicit template instantiation  */
128690075Sobrien#define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC (NODE)->use_template)
128718334Speter
128818334Speter/* Fields used for storing information before the class is defined.
128918334Speter   After the class is defined, these fields hold other information.  */
129018334Speter
129118334Speter/* List of friends which were defined inline in this class definition.  */
129290075Sobrien#define CLASSTYPE_INLINE_FRIENDS(NODE) CLASSTYPE_PURE_VIRTUALS (NODE)
129318334Speter
129490075Sobrien/* Nonzero for _CLASSTYPE means that operator delete is defined.  */
129590075Sobrien#define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC (NODE)->gets_delete)
129618334Speter#define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1)
129718334Speter
129890075Sobrien/* Nonzero if `new NODE[x]' should cause the allocation of extra
129990075Sobrien   storage to indicate how many array elements are in use.  */
130090075Sobrien#define TYPE_VEC_NEW_USES_COOKIE(NODE)			\
130190075Sobrien  (CLASS_TYPE_P (NODE)					\
130290075Sobrien   && TYPE_LANG_SPECIFIC (NODE)->vec_new_uses_cookie)
130318334Speter
130418334Speter/* Nonzero means that this _CLASSTYPE node defines ways of converting
130518334Speter   itself to other types.  */
130690075Sobrien#define TYPE_HAS_CONVERSION(NODE) \
130790075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_type_conversion)
130818334Speter
130918334Speter/* Nonzero means that this _CLASSTYPE node overloads operator=(X&).  */
131090075Sobrien#define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC (NODE)->has_assign_ref)
131190075Sobrien#define TYPE_HAS_CONST_ASSIGN_REF(NODE) \
131290075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_const_assign_ref)
131318334Speter
131418334Speter/* Nonzero means that this _CLASSTYPE node has an X(X&) constructor.  */
131590075Sobrien#define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC (NODE)->has_init_ref)
131690075Sobrien#define TYPE_HAS_CONST_INIT_REF(NODE) \
131790075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_const_init_ref)
131818334Speter
131990075Sobrien/* Nonzero if this class defines an overloaded operator new.  (An
132090075Sobrien   operator new [] doesn't count.)  */
132190075Sobrien#define TYPE_HAS_NEW_OPERATOR(NODE) \
132290075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_new)
132390075Sobrien
132490075Sobrien/* Nonzero if this class defines an overloaded operator new[].  */
132590075Sobrien#define TYPE_HAS_ARRAY_NEW_OPERATOR(NODE) \
132690075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_array_new)
132790075Sobrien
132818334Speter/* Nonzero means that this type is being defined.  I.e., the left brace
132918334Speter   starting the definition of this type has been seen.  */
133090075Sobrien#define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC (NODE)->being_defined)
133118334Speter/* Nonzero means that this type has been redefined.  In this case, if
133218334Speter   convenient, don't reprocess any methods that appear in its redefinition.  */
133390075Sobrien#define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC (NODE)->redefined)
133418334Speter
133552284Sobrien/* The is the basetype that contains NODE's rtti.  */
133690075Sobrien#define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC (NODE)->rtti)
133718334Speter
133818334Speter/* Nonzero means that this _CLASSTYPE node overloads operator().  */
133990075Sobrien#define TYPE_OVERLOADS_CALL_EXPR(NODE) \
134090075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_call_overloaded)
134118334Speter
134218334Speter/* Nonzero means that this _CLASSTYPE node overloads operator[].  */
134390075Sobrien#define TYPE_OVERLOADS_ARRAY_REF(NODE) \
134490075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_array_ref_overloaded)
134518334Speter
134618334Speter/* Nonzero means that this _CLASSTYPE node overloads operator->.  */
134790075Sobrien#define TYPE_OVERLOADS_ARROW(NODE) \
134890075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_arrow_overloaded)
134918334Speter
135018334Speter/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
135118334Speter   multiple inheritance.  If this is 0 for the root of a type
135218334Speter   hierarchy, then we can use more efficient search techniques.  */
135390075Sobrien#define TYPE_USES_MULTIPLE_INHERITANCE(NODE) \
135490075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->uses_multiple_inheritance)
135518334Speter
135618334Speter/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses
135718334Speter   virtual base classes.  If this is 0 for the root of a type
135818334Speter   hierarchy, then we can use more efficient search techniques.  */
135990075Sobrien#define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3 (NODE))
136018334Speter
136152284Sobrien/* Vector member functions defined in this class.  Each element is
136252284Sobrien   either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD.  All
136352284Sobrien   functions with the same name end up in the same slot.  The first
136452284Sobrien   two elements are for constructors, and destructors, respectively.
136590075Sobrien   Any conversion operators are next, followed by ordinary member
136690075Sobrien   functions.  There may be empty entries at the end of the vector.  */
136790075Sobrien#define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC (NODE)->methods)
136818334Speter
136990075Sobrien/* The slot in the CLASSTYPE_METHOD_VEC where constructors go.  */
137090075Sobrien#define CLASSTYPE_CONSTRUCTOR_SLOT 0
137118334Speter
137290075Sobrien/* The slot in the CLASSTYPE_METHOD_VEC where destructors go.  */
137390075Sobrien#define CLASSTYPE_DESTRUCTOR_SLOT 1
137490075Sobrien
137590075Sobrien/* The first slot in the CLASSTYPE_METHOD_VEC where conversion
137690075Sobrien   operators can appear.  */
137790075Sobrien#define CLASSTYPE_FIRST_CONVERSION_SLOT 2
137890075Sobrien
137990075Sobrien/* A FUNCTION_DECL or OVERLOAD for the constructors for NODE.  These
138090075Sobrien   are the constructors that take an in-charge parameter.  */
138190075Sobrien#define CLASSTYPE_CONSTRUCTORS(NODE) \
138290075Sobrien  (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_CONSTRUCTOR_SLOT))
138390075Sobrien
138490075Sobrien/* A FUNCTION_DECL for the destructor for NODE.  These are the
138590075Sobrien   destructors that take an in-charge parameter.  */
138690075Sobrien#define CLASSTYPE_DESTRUCTORS(NODE) \
138790075Sobrien  (TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), CLASSTYPE_DESTRUCTOR_SLOT))
138890075Sobrien
138952284Sobrien/* Mark bits for depth-first and breath-first searches.  */
139018334Speter
139152284Sobrien/* Get the value of the Nth mark bit.  */
139290075Sobrien#define CLASSTYPE_MARKED_N(NODE, N)				\
139390075Sobrien  (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->marks	\
139490075Sobrien     : ((unsigned) TYPE_ALIAS_SET (NODE))) & (1 << (N))) != 0)
139552284Sobrien
139652284Sobrien/* Set the Nth mark bit.  */
139790075Sobrien#define SET_CLASSTYPE_MARKED_N(NODE, N)				\
139890075Sobrien  (CLASS_TYPE_P (NODE)						\
139990075Sobrien   ? (void) (TYPE_LANG_SPECIFIC (NODE)->marks |= (1 << (N)))	\
140090075Sobrien   : (void) (TYPE_ALIAS_SET (NODE) |= (1 << (N))))
140152284Sobrien
140252284Sobrien/* Clear the Nth mark bit.  */
140390075Sobrien#define CLEAR_CLASSTYPE_MARKED_N(NODE, N)			\
140490075Sobrien  (CLASS_TYPE_P (NODE)						\
140590075Sobrien   ? (void) (TYPE_LANG_SPECIFIC (NODE)->marks &= ~(1 << (N)))	\
140690075Sobrien   : (void) (TYPE_ALIAS_SET (NODE) &= ~(1 << (N))))
140752284Sobrien
140852284Sobrien/* Get the value of the mark bits.  */
140990075Sobrien#define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N (NODE, 0)
141090075Sobrien#define CLASSTYPE_MARKED2(NODE) CLASSTYPE_MARKED_N (NODE, 1)
141190075Sobrien#define CLASSTYPE_MARKED3(NODE) CLASSTYPE_MARKED_N (NODE, 2)
141290075Sobrien#define CLASSTYPE_MARKED4(NODE) CLASSTYPE_MARKED_N (NODE, 3)
141390075Sobrien#define CLASSTYPE_MARKED5(NODE) CLASSTYPE_MARKED_N (NODE, 4)
141490075Sobrien#define CLASSTYPE_MARKED6(NODE) CLASSTYPE_MARKED_N (NODE, 5)
141552284Sobrien
141618334Speter/* Macros to modify the above flags */
141790075Sobrien#define SET_CLASSTYPE_MARKED(NODE)    SET_CLASSTYPE_MARKED_N (NODE, 0)
141890075Sobrien#define CLEAR_CLASSTYPE_MARKED(NODE)  CLEAR_CLASSTYPE_MARKED_N (NODE, 0)
141990075Sobrien#define SET_CLASSTYPE_MARKED2(NODE)   SET_CLASSTYPE_MARKED_N (NODE, 1)
142090075Sobrien#define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 1)
142190075Sobrien#define SET_CLASSTYPE_MARKED3(NODE)   SET_CLASSTYPE_MARKED_N (NODE, 2)
142290075Sobrien#define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 2)
142390075Sobrien#define SET_CLASSTYPE_MARKED4(NODE)   SET_CLASSTYPE_MARKED_N (NODE, 3)
142490075Sobrien#define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 3)
142590075Sobrien#define SET_CLASSTYPE_MARKED5(NODE)   SET_CLASSTYPE_MARKED_N (NODE, 4)
142690075Sobrien#define CLEAR_CLASSTYPE_MARKED5(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 4)
142790075Sobrien#define SET_CLASSTYPE_MARKED6(NODE)   SET_CLASSTYPE_MARKED_N (NODE, 5)
142890075Sobrien#define CLEAR_CLASSTYPE_MARKED6(NODE) CLEAR_CLASSTYPE_MARKED_N (NODE, 5)
142918334Speter
143050397Sobrien/* A list of the nested tag-types (class, struct, union, or enum)
143150397Sobrien   found within this class.  The TREE_PURPOSE of each node is the name
143250397Sobrien   of the type; the TREE_VALUE is the type itself.  This list includes
143350397Sobrien   nested member class templates.  */
143490075Sobrien#define CLASSTYPE_TAGS(NODE)		(TYPE_LANG_SPECIFIC (NODE)->tags)
143518334Speter
143690075Sobrien/* Nonzero if NODE has a primary base class, i.e., a base class with
143790075Sobrien   which it shares the virtual function table pointer.  */
143890075Sobrien#define CLASSTYPE_HAS_PRIMARY_BASE_P(NODE) \
143990075Sobrien  (CLASSTYPE_PRIMARY_BINFO (NODE) != NULL_TREE)
144018334Speter
144190075Sobrien/* If non-NULL, this is the binfo for the primary base class, i.e.,
144290075Sobrien   the base class which contains the virtual function table pointer
144390075Sobrien   for this class.  */
144490075Sobrien#define CLASSTYPE_PRIMARY_BINFO(NODE) \
144590075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->primary_base)
144618334Speter
144790075Sobrien/* The number of virtual functions present in this class' virtual
144890075Sobrien   function table.  */
144990075Sobrien#define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC (NODE)->vsize)
145018334Speter
145190075Sobrien/* A chain of BINFOs for the direct and indirect virtual base classes
145290075Sobrien   that this type uses in a post-order depth-first left-to-right
145390075Sobrien   order.  (In other words, these bases appear in the order that they
145490075Sobrien   should be initialized.)  If a virtual base is primary, then the
145590075Sobrien   primary copy will appear on this list.  Thus, the BINFOs on this
145690075Sobrien   list are all "real"; they are the same BINFOs that will be
145790075Sobrien   encountered when using dfs_unmarked_real_bases_queue_p and related
145890075Sobrien   functions.  */
145990075Sobrien#define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC (NODE)->vbases)
146090075Sobrien
146190075Sobrien/* For a non-virtual BINFO, the BINFO itself; for a virtual BINFO, the
146290075Sobrien   binfo_for_vbase.  C is the most derived class for the hierarchy
146390075Sobrien   containing BINFO.  */
146490075Sobrien#define CANONICAL_BINFO(BINFO, C)		\
146590075Sobrien  (TREE_VIA_VIRTUAL (BINFO)			\
146690075Sobrien   ? binfo_for_vbase (BINFO_TYPE (BINFO), C)	\
146790075Sobrien   : (BINFO))
146890075Sobrien
146990075Sobrien/* Number of direct baseclasses of NODE.  */
147018334Speter#define CLASSTYPE_N_BASECLASSES(NODE) \
147190075Sobrien  (BINFO_N_BASETYPES (TYPE_BINFO (NODE)))
147218334Speter
147390075Sobrien/* These are the size and alignment of the type without its virtual
147490075Sobrien   base classes, for when we use this type as a base itself.  */
147590075Sobrien#define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC (NODE)->size)
147690075Sobrien#define CLASSTYPE_SIZE_UNIT(NODE) (TYPE_LANG_SPECIFIC (NODE)->size_unit)
147790075Sobrien#define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC (NODE)->align)
147890075Sobrien#define CLASSTYPE_USER_ALIGN(NODE) (TYPE_LANG_SPECIFIC (NODE)->user_align)
147918334Speter
148090075Sobrien/* The alignment of NODE, without its virtual bases, in bytes.  */
148190075Sobrien#define CLASSTYPE_ALIGN_UNIT(NODE) \
148290075Sobrien  (CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT)
148318334Speter
148490075Sobrien/* True if this a Java interface type, declared with
148590075Sobrien   '__attribute__ ((java_interface))'. */
148690075Sobrien#define TYPE_JAVA_INTERFACE(NODE) (TYPE_LANG_SPECIFIC (NODE)->java_interface)
148790075Sobrien
148818334Speter/* A cons list of virtual functions which cannot be inherited by
148918334Speter   derived classes.  When deriving from this type, the derived
149018334Speter   class must provide its own definition for each of these functions.  */
149190075Sobrien#define CLASSTYPE_PURE_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC (NODE)->pure_virtuals)
149218334Speter
149318334Speter/* Nonzero means that this aggr type has been `closed' by a semicolon.  */
149490075Sobrien#define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->got_semicolon)
149518334Speter
149618334Speter/* Nonzero means that the main virtual function table pointer needs to be
149718334Speter   set because base constructors have placed the wrong value there.
149818334Speter   If this is zero, it means that they placed the right value there,
149918334Speter   and there is no need to change it.  */
150090075Sobrien#define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) \
150190075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->needs_virtual_reinit)
150218334Speter
150318334Speter/* Nonzero means that this type has an X() constructor.  */
150490075Sobrien#define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) \
150590075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->has_default_ctor)
150618334Speter
150752284Sobrien/* Nonzero means that this type contains a mutable member */
150890075Sobrien#define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC (NODE)->has_mutable)
150952284Sobrien#define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
151018334Speter
1511102780Skan/* Nonzero means that this class type is a non-POD class.  */
151290075Sobrien#define CLASSTYPE_NON_POD_P(NODE) (TYPE_LANG_SPECIFIC (NODE)->non_pod_class)
151352284Sobrien
1514102780Skan/* Nonzero means that this class contains pod types whose default
1515102780Skan   initialization is not a zero initialization (namely, pointers to
1516102780Skan   data members).  */
1517102780Skan#define CLASSTYPE_NON_ZERO_INIT_P(NODE) (TYPE_LANG_SPECIFIC (NODE)->non_zero_init)
1518102780Skan
151990075Sobrien/* Nonzero if this class is "nearly empty", i.e., contains only a
152090075Sobrien   virtual function table pointer.  */
152190075Sobrien#define CLASSTYPE_NEARLY_EMPTY_P(NODE) \
152290075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->nearly_empty_p)
152390075Sobrien
1524107590Sobrien/* Nonzero if this class contains an empty subobject.  */
1525107590Sobrien#define CLASSTYPE_CONTAINS_EMPTY_CLASS_P(NODE) \
1526107590Sobrien  (TYPE_LANG_SPECIFIC (NODE)->contains_empty_class_p)
1527107590Sobrien
152852284Sobrien/* A list of class types of which this type is a friend.  The
152950397Sobrien   TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the
153050397Sobrien   case of a template friend.  */
153190075Sobrien#define CLASSTYPE_FRIEND_CLASSES(NODE) \
153290075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->friend_classes)
153318334Speter
153452284Sobrien/* A list of the classes which grant friendship to this class.  */
153552284Sobrien#define CLASSTYPE_BEFRIENDING_CLASSES(NODE) \
153652284Sobrien  (TYPE_LANG_SPECIFIC (NODE)->befriending_classes)
153718334Speter
153818334Speter/* Say whether this node was declared as a "class" or a "struct".  */
153990075Sobrien#define CLASSTYPE_DECLARED_CLASS(NODE) \
154090075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->declared_class)
154118334Speter
1542107590Sobrien/* Nonzero if this class has const members
1543107590Sobrien   which have no specified initialization.  */
1544107590Sobrien#define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE)	\
1545107590Sobrien  (TYPE_LANG_SPECIFIC (NODE)				\
1546107590Sobrien   ? TYPE_LANG_SPECIFIC (NODE)->const_needs_init : 0)
1547107590Sobrien#define SET_CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE, VALUE) \
1548107590Sobrien  (TYPE_LANG_SPECIFIC (NODE)->const_needs_init = (VALUE))
154918334Speter
1550107590Sobrien/* Nonzero if this class has ref members
1551107590Sobrien   which have no specified initialization.  */
1552107590Sobrien#define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE)		\
1553107590Sobrien  (TYPE_LANG_SPECIFIC (NODE)				\
1554107590Sobrien   ? TYPE_LANG_SPECIFIC (NODE)->ref_needs_init : 0)
1555107590Sobrien#define SET_CLASSTYPE_REF_FIELDS_NEED_INIT(NODE, VALUE) \
1556107590Sobrien  (TYPE_LANG_SPECIFIC (NODE)->ref_needs_init = (VALUE))
155718334Speter
155818334Speter/* Nonzero if this class is included from a header file which employs
155918334Speter   `#pragma interface', and it is not included in its implementation file.  */
156090075Sobrien#define CLASSTYPE_INTERFACE_ONLY(NODE) \
156190075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->interface_only)
156218334Speter
156390075Sobrien/* True if we have already determined whether or not vtables, VTTs,
156490075Sobrien   typeinfo, and other similar per-class data should be emitted in
156590075Sobrien   this translation unit.  This flag does not indicate whether or not
156690075Sobrien   these items should be emitted; it only indicates that we know one
156790075Sobrien   way or the other.  */
156890075Sobrien#define CLASSTYPE_INTERFACE_KNOWN(NODE) \
156990075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->interface_unknown == 0)
157090075Sobrien/* The opposite of CLASSTYPE_INTERFANCE_KNOWN.  */
157190075Sobrien#define CLASSTYPE_INTERFACE_UNKNOWN(NODE) \
157290075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->interface_unknown)
157318334Speter
157490075Sobrien#define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) \
157590075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->interface_unknown = !!(X))
157690075Sobrien#define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) \
157790075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->interface_unknown = 1)
157890075Sobrien#define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) \
157990075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->interface_unknown = 0)
158090075Sobrien
158118334Speter/* Nonzero if a _DECL node requires us to output debug info for this class.  */
158290075Sobrien#define CLASSTYPE_DEBUG_REQUESTED(NODE) \
158390075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->debug_requested)
158418334Speter
158518334Speter/* Additional macros for inheritance information.  */
158618334Speter
158752284Sobrien/* The BINFO_INHERITANCE_CHAIN is used opposite to the description in
158852284Sobrien   gcc/tree.h.  In particular if D is derived from B then the BINFO
158952284Sobrien   for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to
159052284Sobrien   D.  In tree.h, this pointer is described as pointing in other
159152284Sobrien   direction.  There is a different BINFO for each path to a virtual
159290075Sobrien   base; BINFOs for virtual bases are not shared.
159318334Speter
159452284Sobrien   We use TREE_VIA_PROTECTED and TREE_VIA_PUBLIC, but private
159552284Sobrien   inheritance is indicated by the absence of the other two flags, not
159690075Sobrien   by TREE_VIA_PRIVATE, which is unused.  */
159718334Speter
159890075Sobrien/* Mark the binfo, whether shared or not. Each instance of a virtual
159990075Sobrien   base can be separately marked.  */
160090075Sobrien#define BINFO_UNSHARED_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
160152284Sobrien
160290075Sobrien/* Nonzero means marked by DFS or BFS search.  */
160390075Sobrien#define BINFO_MARKED(NODE)			\
160490075Sobrien  (TREE_VIA_VIRTUAL (NODE)			\
160590075Sobrien   ? CLASSTYPE_MARKED (BINFO_TYPE (NODE))	\
160690075Sobrien   : TREE_LANG_FLAG_0 (NODE))
160718334Speter/* Macros needed because of C compilers that don't allow conditional
160818334Speter   expressions to be lvalues.  Grr!  */
160990075Sobrien#define SET_BINFO_MARKED(NODE)			\
161090075Sobrien  (TREE_VIA_VIRTUAL(NODE)			\
161190075Sobrien   ? SET_CLASSTYPE_MARKED (BINFO_TYPE (NODE))	\
161296263Sobrien   : (void)(TREE_LANG_FLAG_0 (NODE) = 1))
161390075Sobrien#define CLEAR_BINFO_MARKED(NODE)		\
161490075Sobrien  (TREE_VIA_VIRTUAL (NODE)			\
161590075Sobrien   ? CLEAR_CLASSTYPE_MARKED (BINFO_TYPE (NODE))	\
161696263Sobrien   : (void)(TREE_LANG_FLAG_0 (NODE) = 0))
161718334Speter
161890075Sobrien/* Nonzero means that this class is on a path leading to a new vtable.  */
161990075Sobrien#define BINFO_VTABLE_PATH_MARKED(NODE)		\
162090075Sobrien  (TREE_VIA_VIRTUAL (NODE)			\
162190075Sobrien   ? CLASSTYPE_MARKED3 (BINFO_TYPE (NODE))	\
162290075Sobrien   : TREE_LANG_FLAG_3 (NODE))
162390075Sobrien#define SET_BINFO_VTABLE_PATH_MARKED(NODE)	\
162490075Sobrien  (TREE_VIA_VIRTUAL(NODE)			\
162590075Sobrien   ? SET_CLASSTYPE_MARKED3 (BINFO_TYPE (NODE))	\
162690075Sobrien   : (TREE_LANG_FLAG_3 (NODE) = 1))
162790075Sobrien#define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE)	\
162890075Sobrien  (TREE_VIA_VIRTUAL (NODE)			\
162990075Sobrien   ? CLEAR_CLASSTYPE_MARKED3 (BINFO_TYPE (NODE))\
163090075Sobrien   : (TREE_LANG_FLAG_3 (NODE) = 0))
163118334Speter
163290075Sobrien/* Nonzero means B (a BINFO) has its own vtable.  Under the old ABI,
163390075Sobrien   secondary vtables are sometimes shared.  Any copies will not have
163490075Sobrien   this flag set.
163518334Speter
163690075Sobrien   B is part of the hierarchy dominated by C.  */
163790075Sobrien#define BINFO_NEW_VTABLE_MARKED(B, C) \
163890075Sobrien  (TREE_LANG_FLAG_4 (CANONICAL_BINFO (B, C)))
163918334Speter
164090075Sobrien/* Any subobject that needs a new vtable must have a vptr and must not
164190075Sobrien   be a non-virtual primary base (since it would then use the vtable from a
164290075Sobrien   derived class and never become non-primary.)  */
164390075Sobrien#define SET_BINFO_NEW_VTABLE_MARKED(B, C)				 \
164490075Sobrien  (BINFO_NEW_VTABLE_MARKED (B, C) = 1,					 \
164590075Sobrien   my_friendly_assert (!BINFO_PRIMARY_P (B)				 \
164690075Sobrien		       || TREE_VIA_VIRTUAL (B), 20000517),		 \
164790075Sobrien   my_friendly_assert (CLASSTYPE_VFIELDS (BINFO_TYPE (B)) != NULL_TREE,  \
164890075Sobrien		       20000517))
164918334Speter
165052284Sobrien/* Nonzero means this class has done dfs_pushdecls.  */
165152284Sobrien#define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
165252284Sobrien#define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE)
165352284Sobrien#define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE)
165452284Sobrien
165596263Sobrien/* Nonzero if this BINFO is a primary base class.  Note, this can be
165696263Sobrien   set for non-canononical virtual bases. For a virtual primary base
165796263Sobrien   you might also need to check whether it is canonical.  */
165890075Sobrien
165990075Sobrien#define BINFO_PRIMARY_P(NODE) \
166090075Sobrien  (BINFO_PRIMARY_BASE_OF (NODE) != NULL_TREE)
166190075Sobrien
166290075Sobrien/* The index in the VTT where this subobject's sub-VTT can be found.
166390075Sobrien   NULL_TREE if there is no sub-VTT.  */
166490075Sobrien#define BINFO_SUBVTT_INDEX(NODE) TREE_VEC_ELT (NODE, 8)
166590075Sobrien
166690075Sobrien/* The index in the VTT where the vptr for this subobject can be
166790075Sobrien   found.  NULL_TREE if there is no secondary vptr in the VTT.  */
166890075Sobrien#define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT (NODE, 9)
166990075Sobrien
167090075Sobrien/* The binfo of which NODE is a primary base.  (This is different from
167190075Sobrien   BINFO_INHERITANCE_CHAIN for virtual base because a virtual base is
167290075Sobrien   sometimes a primary base for a class for which it is not an
167390075Sobrien   immediate base.)  */
167490075Sobrien#define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT (NODE, 10)
167590075Sobrien
167690075Sobrien/* Nonzero if this binfo has lost its primary base binfo (because that
167790075Sobrien   is a nearly-empty virtual base that has been taken by some other
167890075Sobrien   base in the complete hierarchy.  */
167990075Sobrien#define BINFO_LOST_PRIMARY_P(NODE) TREE_LANG_FLAG_2 (NODE)
168090075Sobrien
168190075Sobrien/* Nonzero if this binfo is an indirect primary base, i.e. a virtual
168290075Sobrien   base that is a primary base of some of other class in the
168390075Sobrien   hierarchy.  */
168490075Sobrien#define BINFO_INDIRECT_PRIMARY_P(NODE) TREE_USED (NODE)
168590075Sobrien
168652284Sobrien/* Used by various search routines.  */
168752284Sobrien#define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
168818334Speter
168918334Speter/* Accessor macros for the vfield slots in structures.  */
169018334Speter
169190075Sobrien/* The virtual function pointer fields that this type contains.  For a
169290075Sobrien   vfield defined just for this class, or from a primary base, the
169390075Sobrien   TREE_PURPOSE is NULL.  Otherwise, the TREE_PURPOSE is the BINFO for
169490075Sobrien   the class containing the vfield.  The TREE_VALUE is the class where
169590075Sobrien   the vfield was first defined.  */
169690075Sobrien#define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC (NODE)->vfields)
169790075Sobrien
169818334Speter/* Get the assoc info that caused this vfield to exist.  */
169918334Speter#define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE)
170018334Speter
170118334Speter/* Get that same information as a _TYPE.  */
170218334Speter#define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE)
170318334Speter
170418334Speter/* Get the value of the top-most type dominating the non-`normal' vfields.  */
170590075Sobrien#define VF_DERIVED_VALUE(NODE) \
170690075Sobrien  (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE)
170718334Speter
170890075Sobrien/* The number of bytes by which to adjust the `this' pointer when
170990075Sobrien   calling this virtual function.  */
171090075Sobrien#define BV_DELTA(NODE) (TREE_PURPOSE (NODE))
171190075Sobrien
171290075Sobrien/* If non-NULL, the vtable index at which to find the vcall offset
171390075Sobrien   when calling this virtual function.  */
171490075Sobrien#define BV_VCALL_INDEX(NODE) (TREE_TYPE (NODE))
171590075Sobrien
171690075Sobrien/* The function to call.  */
171790075Sobrien#define BV_FN(NODE) (TREE_VALUE (NODE))
171890075Sobrien
171990075Sobrien/* Nonzero if we should use a virtual thunk for this entry.  */
172090075Sobrien#define BV_USE_VCALL_INDEX_P(NODE) \
172190075Sobrien   (TREE_LANG_FLAG_0 (NODE))
172218334Speter
172318334Speter/* Nonzero for TREE_LIST node means that this list of things
172418334Speter   is a list of parameters, as opposed to a list of expressions.  */
172590075Sobrien#define TREE_PARMLIST(NODE) (TREE_LANG_FLAG_2 (NODE))
172618334Speter
172790075Sobrien/* Nonzero for a parmlist means that this parmlist ended in ...  */
172890075Sobrien#define PARMLIST_ELLIPSIS_P(NODE) TREE_LANG_FLAG_0 (NODE)
172990075Sobrien
173018334Speter/* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that
173152284Sobrien   this type can raise.  Each TREE_VALUE is a _TYPE.  The TREE_VALUE
173290075Sobrien   will be NULL_TREE to indicate a throw specification of `()', or
173390075Sobrien   no exceptions allowed.  */
173490075Sobrien#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_BINFO (NODE)
173518334Speter
173652284Sobrien/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'.  */
173752284Sobrien#define TYPE_NOTHROW_P(NODE) \
173852284Sobrien  (TYPE_RAISES_EXCEPTIONS (NODE) \
173952284Sobrien   && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE)
174052284Sobrien
174150397Sobrien/* The binding level associated with the namespace.  */
174290075Sobrien#define NAMESPACE_LEVEL(NODE) \
174390075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.u.level)
174418334Speter
174552284Sobrien
174652284Sobrien/* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or
174790075Sobrien   a lang_decl (which has lang_decl_flags as its initial prefix).
174890075Sobrien   This macro is nonzero for tree nodes whose DECL_LANG_SPECIFIC is
174990075Sobrien   the full lang_decl, and not just lang_decl_flags.  */
175090075Sobrien#define CAN_HAVE_FULL_LANG_DECL_P(NODE)		\
175190075Sobrien  (!(TREE_CODE (NODE) == VAR_DECL		\
175290075Sobrien     || TREE_CODE (NODE) == CONST_DECL		\
175390075Sobrien     || TREE_CODE (NODE) == FIELD_DECL		\
175490075Sobrien     || TREE_CODE (NODE) == USING_DECL))
175552284Sobrien
175618334Speterstruct lang_decl_flags
175718334Speter{
175890075Sobrien  struct c_lang_decl base;
175918334Speter
176090075Sobrien  ENUM_BITFIELD(languages) language : 8;
176190075Sobrien
176218334Speter  unsigned operator_attr : 1;
176318334Speter  unsigned constructor_attr : 1;
176490075Sobrien  unsigned destructor_attr : 1;
176518334Speter  unsigned friend_attr : 1;
176618334Speter  unsigned static_function : 1;
176790075Sobrien  unsigned pure_virtual : 1;
176890075Sobrien  unsigned has_in_charge_parm_p : 1;
176990075Sobrien  unsigned has_vtt_parm_p : 1;
177060967Sobrien
177190075Sobrien  unsigned deferred : 1;
177218334Speter  unsigned use_template : 2;
177318334Speter  unsigned nonconverting : 1;
177418334Speter  unsigned not_really_extern : 1;
177550397Sobrien  unsigned needs_final_overrider : 1;
177690075Sobrien  unsigned initialized_in_class : 1;
177790075Sobrien  unsigned pending_inline_p : 1;
177818334Speter
177990075Sobrien  unsigned global_ctor_p : 1;
178090075Sobrien  unsigned global_dtor_p : 1;
178190075Sobrien  unsigned assignment_operator_p : 1;
178290075Sobrien  unsigned anticipated_p : 1;
178390075Sobrien  /* Four unused bits.  */
178490075Sobrien
178590075Sobrien  union {
178690075Sobrien    /* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this
178790075Sobrien       is DECL_TEMPLATE_INFO.  */
178890075Sobrien    tree template_info;
178990075Sobrien
179090075Sobrien    /* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL.  */
179190075Sobrien    struct binding_level *level;
179290075Sobrien  } u;
179390075Sobrien
179490075Sobrien  union {
179590075Sobrien    /* This is DECL_ACCESS.  */
179690075Sobrien    tree access;
179790075Sobrien
179890075Sobrien    /* For VAR_DECL in function, this is DECL_DISCRIMINATOR.  */
179990075Sobrien    int discriminator;
180090075Sobrien
180190075Sobrien    /* In a namespace-scope FUNCTION_DECL, this is
180290075Sobrien       GLOBAL_INIT_PRIORITY.  */
180390075Sobrien    int init_priority;
180490075Sobrien
180590075Sobrien    /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
180690075Sobrien       THUNK_VCALL_OFFSET.  */
180790075Sobrien    tree vcall_offset;
180890075Sobrien  } u2;
180918334Speter};
181018334Speter
181118334Speterstruct lang_decl
181218334Speter{
181318334Speter  struct lang_decl_flags decl_flags;
181418334Speter
181552284Sobrien  tree befriending_classes;
181690075Sobrien
181790075Sobrien  /* For a virtual FUNCTION_DECL, this is DECL_VIRTUAL_CONTEXT.  For a
181890075Sobrien     non-virtual FUNCTION_DECL, this is DECL_FRIEND_CONTEXT.  */
181990075Sobrien  tree context;
182090075Sobrien
182190075Sobrien  /* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION.  */
182290075Sobrien  tree cloned_function;
182390075Sobrien
182490075Sobrien  union
182590075Sobrien  {
182690075Sobrien    tree sorted_fields;
182790075Sobrien    struct unparsed_text *pending_inline_info;
182890075Sobrien    struct cp_language_function *saved_language_function;
182990075Sobrien  } u;
183090075Sobrien
183190075Sobrien  union {
183290075Sobrien    /* In an overloaded operator, this is the value of
183390075Sobrien       DECL_OVERLOADED_OPERATOR_P.  */
183490075Sobrien    enum tree_code operator_code;
183590075Sobrien  } u2;
183618334Speter};
183718334Speter
183890075Sobrien#define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK (NODE)->identifier.id.str)
183918334Speter
184090075Sobrien/* DECL_NEEDED_P holds of a declaration when we need to emit its
184190075Sobrien   definition.  This is true when the back-end tells us that
184290075Sobrien   the symbol has been referenced in the generated code.  If, however,
184390075Sobrien   we are not generating code, then it is also true when a symbol has
184490075Sobrien   just been used somewhere, even if it's not really needed.  We need
184590075Sobrien   anything that isn't comdat, but we don't know for sure whether or
184690075Sobrien   not something is comdat until end-of-file.  */
184790075Sobrien#define DECL_NEEDED_P(DECL)					\
184890075Sobrien  ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL))	\
184990075Sobrien   || (DECL_ASSEMBLER_NAME_SET_P (DECL)				\
185090075Sobrien       && TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (DECL)))	\
185190075Sobrien   || (flag_syntax_only && TREE_USED (DECL)))
185290075Sobrien
185350397Sobrien/* Non-zero iff DECL is memory-based.  The DECL_RTL of
185450397Sobrien   certain const variables might be a CONST_INT, or a REG
185550397Sobrien   in some cases.  We cannot use `memory_operand' as a test
185650397Sobrien   here because on most RISC machines, a variable's address
185750397Sobrien   is not, by itself, a legitimate address.  */
185850397Sobrien#define DECL_IN_MEMORY_P(NODE) \
185990075Sobrien  (DECL_RTL_SET_P (NODE) && GET_CODE (DECL_RTL (NODE)) == MEM)
186050397Sobrien
186190075Sobrien/* For a FUNCTION_DECL or a VAR_DECL, the language linkage for the
186290075Sobrien   declaration.  Some entities (like a member function in a local
186390075Sobrien   class, or a local variable) do not have linkage at all, and this
186490075Sobrien   macro should not be used in those cases.
186590075Sobrien
186690075Sobrien   Implementation note: A FUNCTION_DECL without DECL_LANG_SPECIFIC was
186790075Sobrien   created by language-independent code, and has C linkage.  Most
186890075Sobrien   VAR_DECLs have C++ linkage, and do not have DECL_LANG_SPECIFIC, but
186990075Sobrien   we do create DECL_LANG_SPECIFIC for variables with non-C++ linkage.  */
187090075Sobrien#define DECL_LANGUAGE(NODE) 				\
187190075Sobrien  (DECL_LANG_SPECIFIC (NODE) 				\
187290075Sobrien   ? DECL_LANG_SPECIFIC (NODE)->decl_flags.language	\
187390075Sobrien   : (TREE_CODE (NODE) == FUNCTION_DECL			\
187490075Sobrien      ? lang_c : lang_cplusplus))
187518334Speter
187690075Sobrien/* Set the language linkage for NODE to LANGUAGE.  */
187790075Sobrien#define SET_DECL_LANGUAGE(NODE, LANGUAGE) \
187890075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.language = (LANGUAGE))
187990075Sobrien
188018334Speter/* For FUNCTION_DECLs: nonzero means that this function is a constructor.  */
188190075Sobrien#define DECL_CONSTRUCTOR_P(NODE) \
188290075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.constructor_attr)
188350397Sobrien
188490075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a complete
188590075Sobrien   object.  */
188690075Sobrien#define DECL_COMPLETE_CONSTRUCTOR_P(NODE)		\
188790075Sobrien  (DECL_CONSTRUCTOR_P (NODE)				\
188890075Sobrien   && DECL_NAME (NODE) == complete_ctor_identifier)
188990075Sobrien
189090075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a base
189190075Sobrien   object.  */
189290075Sobrien#define DECL_BASE_CONSTRUCTOR_P(NODE)		\
189390075Sobrien  (DECL_CONSTRUCTOR_P (NODE)			\
189490075Sobrien   && DECL_NAME (NODE) == base_ctor_identifier)
189590075Sobrien
189690075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a constructor, but not either the
189790075Sobrien   specialized in-charge constructor or the specialized not-in-charge
189890075Sobrien   constructor.  */
189990075Sobrien#define DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P(NODE)		\
190090075Sobrien  (DECL_CONSTRUCTOR_P (NODE) && !DECL_CLONED_FUNCTION_P (NODE))
190190075Sobrien
190290075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a copy constructor.  */
190390075Sobrien#define DECL_COPY_CONSTRUCTOR_P(NODE) \
190490075Sobrien  (DECL_CONSTRUCTOR_P (NODE) && copy_fn_p (NODE) > 0)
190590075Sobrien
190690075Sobrien/* Nonzero if NODE is a destructor.  */
190752284Sobrien#define DECL_DESTRUCTOR_P(NODE)				\
190890075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.destructor_attr)
190952284Sobrien
191090075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a destructor, but not the
191190075Sobrien   specialized in-charge constructor, in-charge deleting constructor,
191290075Sobrien   or the the base destructor.  */
191390075Sobrien#define DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P(NODE)			\
191490075Sobrien  (DECL_DESTRUCTOR_P (NODE) && !DECL_CLONED_FUNCTION_P (NODE))
191552284Sobrien
191690075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete
191790075Sobrien   object.  */
191890075Sobrien#define DECL_COMPLETE_DESTRUCTOR_P(NODE)		\
191990075Sobrien  (DECL_DESTRUCTOR_P (NODE)				\
192090075Sobrien   && DECL_NAME (NODE) == complete_dtor_identifier)
192160967Sobrien
192290075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a base
192390075Sobrien   object.  */
192490075Sobrien#define DECL_BASE_DESTRUCTOR_P(NODE)		\
192590075Sobrien  (DECL_DESTRUCTOR_P (NODE)			\
192690075Sobrien   && DECL_NAME (NODE) == base_dtor_identifier)
192718334Speter
192890075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete
192990075Sobrien   object that deletes the object after it has been destroyed.  */
193090075Sobrien#define DECL_DELETING_DESTRUCTOR_P(NODE)		\
193190075Sobrien  (DECL_DESTRUCTOR_P (NODE)				\
193290075Sobrien   && DECL_NAME (NODE) == deleting_dtor_identifier)
193360967Sobrien
193490075Sobrien/* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or
193590075Sobrien   destructor.  */
193690075Sobrien#define DECL_CLONED_FUNCTION_P(NODE)		\
193790075Sobrien  ((TREE_CODE (NODE) == FUNCTION_DECL 		\
193890075Sobrien    || TREE_CODE (NODE) == TEMPLATE_DECL)	\
193990075Sobrien   && DECL_LANG_SPECIFIC (NODE)			\
194090075Sobrien   && DECL_CLONED_FUNCTION (NODE) != NULL_TREE)
194160967Sobrien
194290075Sobrien/* If DECL_CLONED_FUNCTION_P holds, this is the function that was
194390075Sobrien   cloned.  */
194490075Sobrien#define DECL_CLONED_FUNCTION(NODE) \
194590075Sobrien  (DECL_LANG_SPECIFIC (NODE)->cloned_function)
194660967Sobrien
194790075Sobrien/* Nonzero if NODE has DECL_DISCRIMINATOR and not DECL_ACCESS.  */
194890075Sobrien#define DECL_DISCRIMINATOR_P(NODE)	\
194990075Sobrien  (TREE_CODE (NODE) == VAR_DECL		\
195090075Sobrien   && DECL_FUNCTION_SCOPE_P (NODE))
195160967Sobrien
195290075Sobrien/* Discriminator for name mangling.  */
195390075Sobrien#define DECL_DISCRIMINATOR(NODE) \
195490075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.u2.discriminator)
195560967Sobrien
195690075Sobrien/* Non-zero if the VTT parm has been added to NODE.  */
195790075Sobrien#define DECL_HAS_VTT_PARM_P(NODE) \
195890075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_vtt_parm_p)
195952284Sobrien
196090075Sobrien/* Non-zero if NODE is a FUNCTION_DECL for which a VTT parameter is
196190075Sobrien   required.  */
196290075Sobrien#define DECL_NEEDS_VTT_PARM_P(NODE)			\
196390075Sobrien  (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (NODE))	\
196490075Sobrien   && (DECL_BASE_CONSTRUCTOR_P (NODE)			\
196590075Sobrien       || DECL_BASE_DESTRUCTOR_P (NODE)))
196652284Sobrien
196790075Sobrien/* Non-zero if NODE is a user-defined conversion operator.  */
196890075Sobrien#define DECL_CONV_FN_P(NODE) \
196990075Sobrien  (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)))
197018334Speter
197190075Sobrien/* Set the overloaded operator code for NODE to CODE.  */
197290075Sobrien#define SET_OVERLOADED_OPERATOR_CODE(NODE, CODE) \
197390075Sobrien  (DECL_LANG_SPECIFIC (NODE)->u2.operator_code = (CODE))
197490075Sobrien
197590075Sobrien/* If NODE is an overloaded operator, then this returns the TREE_CODE
197690075Sobrien   associcated with the overloaded operator.
197790075Sobrien   DECL_ASSIGNMENT_OPERATOR_P must also be checked to determine
197890075Sobrien   whether or not NODE is an assignment operator.  If NODE is not an
197990075Sobrien   overloaded operator, ERROR_MARK is returned.  Since the numerical
198090075Sobrien   value of ERROR_MARK is zero, this macro can be used as a predicate
198190075Sobrien   to test whether or not NODE is an overloaded operator.  */
198290075Sobrien#define DECL_OVERLOADED_OPERATOR_P(NODE)		\
198390075Sobrien  (IDENTIFIER_OPNAME_P (DECL_NAME (NODE))		\
198490075Sobrien   ? DECL_LANG_SPECIFIC (NODE)->u2.operator_code : ERROR_MARK)
198590075Sobrien
198690075Sobrien/* Non-zero if NODE is an assignment operator.  */
198790075Sobrien#define DECL_ASSIGNMENT_OPERATOR_P(NODE) \
198890075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.assignment_operator_p)
198990075Sobrien
199090075Sobrien/* For FUNCTION_DECLs: nonzero means that this function is a
199190075Sobrien   constructor or a destructor with an extra in-charge parameter to
199290075Sobrien   control whether or not virtual bases are constructed.  */
199390075Sobrien#define DECL_HAS_IN_CHARGE_PARM_P(NODE) \
199490075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.has_in_charge_parm_p)
199590075Sobrien
199690075Sobrien/* Nonzero if NODE is an overloaded `operator delete[]' function.  */
199790075Sobrien#define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \
199890075Sobrien  (DECL_OVERLOADED_OPERATOR_P (NODE) == VEC_DELETE_EXPR)
199990075Sobrien
200018334Speter/* Nonzero for _DECL means that this decl appears in (or will appear
200118334Speter   in) as a member in a RECORD_TYPE or UNION_TYPE node.  It is also for
200218334Speter   detecting circularity in case members are multiply defined.  In the
200318334Speter   case of a VAR_DECL, it is also used to determine how program storage
200418334Speter   should be allocated.  */
200590075Sobrien#define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3 (NODE))
200618334Speter
200790075Sobrien/* Nonzero if the DECL was initialized in the class definition itself,
200852284Sobrien   rather than outside the class.  */
200990075Sobrien#define DECL_INITIALIZED_IN_CLASS_P(DECL) \
201090075Sobrien (DECL_LANG_SPECIFIC (DECL)->decl_flags.initialized_in_class)
201152284Sobrien
201218334Speter/* Nonzero for FUNCTION_DECL means that this decl is just a
201318334Speter   friend declaration, and should not be added to the list of
201418334Speter   member functions for this class.  */
201590075Sobrien#define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.friend_attr)
201618334Speter
201752284Sobrien/* A TREE_LIST of the types which have befriended this FUNCTION_DECL.  */
201852284Sobrien#define DECL_BEFRIENDING_CLASSES(NODE) \
201990075Sobrien  (DECL_LANG_SPECIFIC (NODE)->befriending_classes)
202052284Sobrien
202118334Speter/* Nonzero for FUNCTION_DECL means that this decl is a static
202218334Speter   member function.  */
202390075Sobrien#define DECL_STATIC_FUNCTION_P(NODE) \
202490075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.static_function)
202518334Speter
202650397Sobrien/* Nonzero for FUNCTION_DECL means that this decl is a non-static
202750397Sobrien   member function.  */
202850397Sobrien#define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
202950397Sobrien  (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)
203050397Sobrien
203118334Speter/* Nonzero for FUNCTION_DECL means that this decl is a member function
203218334Speter   (static or non-static).  */
203318334Speter#define DECL_FUNCTION_MEMBER_P(NODE) \
203450397Sobrien (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE))
203518334Speter
203618334Speter/* Nonzero for FUNCTION_DECL means that this member function
203718334Speter   has `this' as const X *const.  */
203890075Sobrien#define DECL_CONST_MEMFUNC_P(NODE)					 \
203990075Sobrien  (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)				 \
204090075Sobrien   && CP_TYPE_CONST_P (TREE_TYPE (TREE_VALUE				 \
204190075Sobrien				  (TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
204218334Speter
204318334Speter/* Nonzero for FUNCTION_DECL means that this member function
204418334Speter   has `this' as volatile X *const.  */
204590075Sobrien#define DECL_VOLATILE_MEMFUNC_P(NODE)					 \
204690075Sobrien  (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)				 \
204790075Sobrien   && CP_TYPE_VOLATILE_P (TREE_TYPE (TREE_VALUE				 \
204890075Sobrien				  (TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
204918334Speter
205052284Sobrien/* Nonzero for a DECL means that this member is a non-static member.  */
205190075Sobrien#define DECL_NONSTATIC_MEMBER_P(NODE)		\
205290075Sobrien  ((TREE_CODE (NODE) == FUNCTION_DECL		\
205352284Sobrien    && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE))	\
205452284Sobrien   || TREE_CODE (NODE) == FIELD_DECL)
205552284Sobrien
205618334Speter/* Nonzero for _DECL means that this member object type
205718334Speter   is mutable.  */
205890075Sobrien#define DECL_MUTABLE_P(NODE) (DECL_LANG_FLAG_0 (NODE))
205918334Speter
206018334Speter/* Nonzero for _DECL means that this constructor is a non-converting
206118334Speter   constructor.  */
206290075Sobrien#define DECL_NONCONVERTING_P(NODE) \
206390075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.nonconverting)
206418334Speter
206590075Sobrien/* Nonzero for FUNCTION_DECL means that this member function is a pure
206690075Sobrien   virtual function.  */
206790075Sobrien#define DECL_PURE_VIRTUAL_P(NODE) \
206890075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.pure_virtual)
206918334Speter
207050397Sobrien/* Nonzero for FUNCTION_DECL means that this member function
207150397Sobrien   must be overridden by derived classes.  */
207290075Sobrien#define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) \
207390075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.needs_final_overrider)
207450397Sobrien
207590075Sobrien/* Nonzero if NODE is a thunk, rather than an ordinary function.  */
207690075Sobrien#define DECL_THUNK_P(NODE)			\
207790075Sobrien  (TREE_CODE (NODE) == FUNCTION_DECL		\
207890075Sobrien   && DECL_LANG_FLAG_7 (NODE))
207918334Speter
208090075Sobrien/* Nonzero if NODE is a FUNCTION_DECL, but not a thunk.  */
208190075Sobrien#define DECL_NON_THUNK_FUNCTION_P(NODE)				\
208290075Sobrien  (TREE_CODE (NODE) == FUNCTION_DECL && !DECL_THUNK_P (NODE))
208390075Sobrien
208490075Sobrien/* Nonzero if NODE is `extern "C"'.  */
208590075Sobrien#define DECL_EXTERN_C_P(NODE) \
208690075Sobrien  (DECL_LANGUAGE (NODE) == lang_c)
208790075Sobrien
208890075Sobrien/* Nonzero if NODE is an `extern "C"' function.  */
208990075Sobrien#define DECL_EXTERN_C_FUNCTION_P(NODE) \
209090075Sobrien  (DECL_NON_THUNK_FUNCTION_P (NODE) && DECL_EXTERN_C_P (NODE))
209190075Sobrien
209290075Sobrien/* Set DECL_THUNK_P for node.  */
209390075Sobrien#define SET_DECL_THUNK_P(NODE) \
209490075Sobrien  (DECL_LANG_FLAG_7 (NODE) = 1)
209590075Sobrien
209690075Sobrien/* Nonzero if this DECL is the __PRETTY_FUNCTION__ variable in a
209790075Sobrien   template function.  */
209890075Sobrien#define DECL_PRETTY_FUNCTION_P(NODE) \
209990075Sobrien  (TREE_LANG_FLAG_0 (NODE))
210090075Sobrien
210118334Speter/* The _TYPE context in which this _DECL appears.  This field holds the
210290075Sobrien   class where a virtual function instance is actually defined. */
210390075Sobrien#define DECL_CLASS_CONTEXT(NODE) \
210490075Sobrien  (DECL_CLASS_SCOPE_P (NODE) ? DECL_CONTEXT (NODE) : NULL_TREE)
210518334Speter
210690075Sobrien/* For a non-member friend function, the class (if any) in which this
210790075Sobrien   friend was defined.  For example, given:
210890075Sobrien
210990075Sobrien     struct S { friend void f (); };
211090075Sobrien
211190075Sobrien   the DECL_FRIEND_CONTEXT for `f' will be `S'.  */
211290075Sobrien#define DECL_FRIEND_CONTEXT(NODE)				\
211390075Sobrien  ((DECL_FRIEND_P (NODE) && !DECL_FUNCTION_MEMBER_P (NODE))	\
211490075Sobrien   ? DECL_LANG_SPECIFIC (NODE)->context                         \
211590075Sobrien   : NULL_TREE)
211690075Sobrien
211790075Sobrien/* Set the DECL_FRIEND_CONTEXT for NODE to CONTEXT.  */
211890075Sobrien#define SET_DECL_FRIEND_CONTEXT(NODE, CONTEXT) \
211990075Sobrien  (DECL_LANG_SPECIFIC (NODE)->context = (CONTEXT))
212090075Sobrien
212150397Sobrien/* NULL_TREE in DECL_CONTEXT represents the global namespace. */
212250397Sobrien#define CP_DECL_CONTEXT(NODE) \
212350397Sobrien  (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace)
212450397Sobrien#define FROB_CONTEXT(NODE)   ((NODE) == global_namespace ? NULL_TREE : (NODE))
212518334Speter
212652284Sobrien/* For a virtual function, the base where we find its vtable entry.
212752284Sobrien   For a non-virtual function, the base where it is defined.  */
212890075Sobrien#define DECL_VIRTUAL_CONTEXT(NODE) \
212990075Sobrien  (DECL_LANG_SPECIFIC (NODE)->context)
213052284Sobrien
213150397Sobrien/* 1 iff NODE has namespace scope, including the global namespace.  */
213290075Sobrien#define DECL_NAMESPACE_SCOPE_P(NODE)				\
213390075Sobrien  (!DECL_TEMPLATE_PARM_P (NODE)					\
213490075Sobrien   && TREE_CODE (CP_DECL_CONTEXT (NODE)) == NAMESPACE_DECL)
213518334Speter
213650397Sobrien/* 1 iff NODE is a class member.  */
213750397Sobrien#define DECL_CLASS_SCOPE_P(NODE) \
213890075Sobrien  (DECL_CONTEXT (NODE) && TYPE_P (DECL_CONTEXT (NODE)))
213950397Sobrien
214052284Sobrien/* 1 iff NODE is function-local.  */
214152284Sobrien#define DECL_FUNCTION_SCOPE_P(NODE) \
214252284Sobrien  (DECL_CONTEXT (NODE) \
214352284Sobrien   && TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
214490075Sobrien
214590075Sobrien/* 1 iff NODE is function-local, but for types.  */
214690075Sobrien#define LOCAL_CLASS_P(NODE)				\
214790075Sobrien  (decl_function_context (TYPE_MAIN_DECL (NODE)) != NULL_TREE)
214890075Sobrien
214950397Sobrien/* For a NAMESPACE_DECL: the list of using namespace directives
215050397Sobrien   The PURPOSE is the used namespace, the value is the namespace
215150397Sobrien   that is the common ancestor. */
215290075Sobrien#define DECL_NAMESPACE_USING(NODE) DECL_VINDEX (NAMESPACE_DECL_CHECK (NODE))
215350397Sobrien
215450397Sobrien/* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users
215550397Sobrien   of a namespace, to record the transitive closure of using namespace. */
215690075Sobrien#define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NAMESPACE_DECL_CHECK (NODE))
215750397Sobrien
215850397Sobrien/* In a NAMESPACE_DECL, points to the original namespace if this is
215950397Sobrien   a namespace alias.  */
216090075Sobrien#define DECL_NAMESPACE_ALIAS(NODE) \
216190075Sobrien	DECL_ABSTRACT_ORIGIN (NAMESPACE_DECL_CHECK (NODE))
216250397Sobrien#define ORIGINAL_NAMESPACE(NODE)  \
216350397Sobrien  (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
216450397Sobrien
216590075Sobrien/* Non-zero if NODE is the std namespace.  */
216690075Sobrien#define DECL_NAMESPACE_STD_P(NODE)			\
216790075Sobrien  (TREE_CODE (NODE) == NAMESPACE_DECL			\
216890075Sobrien   && CP_DECL_CONTEXT (NODE) == global_namespace	\
216990075Sobrien   && DECL_NAME (NODE) == std_identifier)
217090075Sobrien
217152284Sobrien/* In a non-local VAR_DECL with static storage duration, this is the
217252284Sobrien   initialization priority.  If this value is zero, the NODE will be
217352284Sobrien   initialized at the DEFAULT_INIT_PRIORITY.  */
217490075Sobrien#define DECL_INIT_PRIORITY(NODE) (VAR_DECL_CHECK (NODE)->decl.u2.i)
217552284Sobrien
217690075Sobrien/* In a TREE_LIST concatenating using directives, indicate indirect
217750397Sobrien   directives  */
217890075Sobrien#define TREE_INDIRECT_USING(NODE) (TREE_LIST_CHECK (NODE)->common.lang_flag_0)
217950397Sobrien
218018334Speter/* In a VAR_DECL for a variable declared in a for statement,
218150397Sobrien   this is the shadowed (local) variable.  */
218290075Sobrien#define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT_FLD(VAR_DECL_CHECK (NODE))
218318334Speter
218490075Sobrien/* In a FUNCTION_DECL, this is nonzero if this function was defined in
218590075Sobrien   the class definition.  We have saved away the text of the function,
218690075Sobrien   but have not yet processed it.  */
218790075Sobrien#define DECL_PENDING_INLINE_P(NODE) \
218890075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.pending_inline_p)
218918334Speter
219090075Sobrien/* If DECL_PENDING_INLINE_P holds, this is the saved text of the
219190075Sobrien   function.  */
219290075Sobrien#define DECL_PENDING_INLINE_INFO(NODE) \
219390075Sobrien  (DECL_LANG_SPECIFIC (NODE)->u.pending_inline_info)
219418334Speter
219590075Sobrien/* For a TYPE_DECL: if this function has many fields, we'll sort them
219690075Sobrien   and put them into a TREE_VEC. */
219790075Sobrien#define DECL_SORTED_FIELDS(NODE) \
219890075Sobrien  (DECL_LANG_SPECIFIC (TYPE_DECL_CHECK (NODE))->u.sorted_fields)
219918334Speter
220090075Sobrien/* True if on the deferred_fns (see decl2.c) list.  */
220190075Sobrien#define DECL_DEFERRED_FN(DECL) \
220290075Sobrien  (DECL_LANG_SPECIFIC (DECL)->decl_flags.deferred)
220318334Speter
220490075Sobrien/* For a VAR_DECL, FUNCTION_DECL, TYPE_DECL or TEMPLATE_DECL:
220590075Sobrien   template-specific information.  */
220690075Sobrien#define DECL_TEMPLATE_INFO(NODE) \
220790075Sobrien  (DECL_LANG_SPECIFIC (VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK (NODE)) \
220890075Sobrien   ->decl_flags.u.template_info)
220918334Speter
221052284Sobrien/* Template information for a RECORD_TYPE or UNION_TYPE.  */
221190075Sobrien#define CLASSTYPE_TEMPLATE_INFO(NODE) \
221290075Sobrien  (TYPE_LANG_SPECIFIC (RECORD_OR_UNION_TYPE_CHECK (NODE))->template_info)
221352284Sobrien
221452284Sobrien/* Template information for an ENUMERAL_TYPE.  Although an enumeration may
221552284Sobrien   not be a primary template, it may be declared within the scope of a
221652284Sobrien   primary template and the enumeration constants may depend on
221752284Sobrien   non-type template parameters.  */
221890075Sobrien#define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (ENUMERAL_TYPE_CHECK (NODE)))
221952284Sobrien
222052284Sobrien/* Template information for a template template parameter.  */
222190075Sobrien#define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) \
222290075Sobrien  (TYPE_LANG_SPECIFIC (BOUND_TEMPLATE_TEMPLATE_PARM_TYPE_CHECK (NODE)) \
222390075Sobrien   ->template_info)
222452284Sobrien
222552284Sobrien/* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE.  */
222652284Sobrien#define TYPE_TEMPLATE_INFO(NODE)			\
222752284Sobrien  (TREE_CODE (NODE) == ENUMERAL_TYPE			\
222890075Sobrien   ? ENUM_TEMPLATE_INFO (NODE) :			\
222990075Sobrien   (TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM	\
223090075Sobrien    ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) :	\
223190075Sobrien    (TYPE_LANG_SPECIFIC (NODE)				\
223290075Sobrien     ? CLASSTYPE_TEMPLATE_INFO (NODE)			\
223390075Sobrien     : NULL_TREE)))
223452284Sobrien
223552284Sobrien/* Set the template information for an ENUMERAL_, RECORD_, or
223652284Sobrien   UNION_TYPE to VAL.  */
223790075Sobrien#define SET_TYPE_TEMPLATE_INFO(NODE, VAL)	\
223890075Sobrien  (TREE_CODE (NODE) == ENUMERAL_TYPE		\
223990075Sobrien   ? (ENUM_TEMPLATE_INFO (NODE) = (VAL))	\
224090075Sobrien   : (CLASSTYPE_TEMPLATE_INFO (NODE) = (VAL)))
224152284Sobrien
224250397Sobrien#define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
224350397Sobrien#define TI_ARGS(NODE) (TREE_VALUE (NODE))
224450397Sobrien#define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE)
224552284Sobrien
224690075Sobrien/* We use TREE_VECs to hold template arguments.  If there is only one
224790075Sobrien   level of template arguments, then the TREE_VEC contains the
224890075Sobrien   arguments directly.  If there is more than one level of template
224990075Sobrien   arguments, then each entry in the TREE_VEC is itself a TREE_VEC,
225090075Sobrien   containing the template arguments for a single level.  The first
225190075Sobrien   entry in the outer TREE_VEC is the outermost level of template
225290075Sobrien   parameters; the last is the innermost.
225390075Sobrien
225490075Sobrien   It is incorrect to ever form a template argument vector containing
225590075Sobrien   only one level of arguments, but which is a TREE_VEC containing as
225690075Sobrien   its only entry the TREE_VEC for that level.  */
225790075Sobrien
225890075Sobrien/* Non-zero if the template arguments is actually a vector of vectors,
225990075Sobrien   rather than just a vector.  */
226090075Sobrien#define TMPL_ARGS_HAVE_MULTIPLE_LEVELS(NODE) \
226190075Sobrien  ((NODE) != NULL_TREE						\
226290075Sobrien   && TREE_CODE (NODE) == TREE_VEC				\
226390075Sobrien   && TREE_VEC_LENGTH (NODE) > 0				\
226490075Sobrien   && TREE_VEC_ELT (NODE, 0) != NULL_TREE			\
226590075Sobrien   && TREE_CODE (TREE_VEC_ELT (NODE, 0)) == TREE_VEC)
226690075Sobrien
226790075Sobrien/* The depth of a template argument vector.  When called directly by
226890075Sobrien   the parser, we use a TREE_LIST rather than a TREE_VEC to represent
226990075Sobrien   template arguments.  In fact, we may even see NULL_TREE if there
227090075Sobrien   are no template arguments.  In both of those cases, there is only
227190075Sobrien   one level of template arguments.  */
227290075Sobrien#define TMPL_ARGS_DEPTH(NODE)					\
227390075Sobrien  (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (NODE) ? TREE_VEC_LENGTH (NODE) : 1)
227490075Sobrien
227590075Sobrien/* The LEVELth level of the template ARGS.  The outermost level of of
227690075Sobrien   args is level 1, not level 0.  */
227790075Sobrien#define TMPL_ARGS_LEVEL(ARGS, LEVEL)		\
227890075Sobrien  (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (ARGS)	\
227990075Sobrien   ? TREE_VEC_ELT (ARGS, (LEVEL) - 1) : (ARGS))
228090075Sobrien
228190075Sobrien/* Set the LEVELth level of the template ARGS to VAL.  This macro does
228290075Sobrien   not work with single-level argument vectors.  */
228390075Sobrien#define SET_TMPL_ARGS_LEVEL(ARGS, LEVEL, VAL)	\
228490075Sobrien  (TREE_VEC_ELT (ARGS, (LEVEL) - 1) = (VAL))
228590075Sobrien
228690075Sobrien/* Accesses the IDXth parameter in the LEVELth level of the ARGS.  */
228790075Sobrien#define TMPL_ARG(ARGS, LEVEL, IDX)				\
228890075Sobrien  (TREE_VEC_ELT (TMPL_ARGS_LEVEL (ARGS, LEVEL), IDX))
228990075Sobrien
229090075Sobrien/* Set the IDXth element in the LEVELth level of ARGS to VAL.  This
229190075Sobrien   macro does not work with single-level argument vectors.  */
229290075Sobrien#define SET_TMPL_ARG(ARGS, LEVEL, IDX, VAL)			\
229390075Sobrien  (TREE_VEC_ELT (TREE_VEC_ELT ((ARGS), (LEVEL) - 1), (IDX)) = (VAL))
229490075Sobrien
229590075Sobrien/* Given a single level of template arguments in NODE, return the
229690075Sobrien   number of arguments.  */
229790075Sobrien#define NUM_TMPL_ARGS(NODE)				\
229890075Sobrien  ((NODE) == NULL_TREE ? 0				\
229990075Sobrien   : (TREE_CODE (NODE) == TREE_VEC			\
230090075Sobrien      ? TREE_VEC_LENGTH (NODE) : list_length (NODE)))
230190075Sobrien
230290075Sobrien/* Returns the innermost level of template arguments in ARGS.  */
230390075Sobrien#define INNERMOST_TEMPLATE_ARGS(NODE) \
230490075Sobrien  (get_innermost_template_args ((NODE), 1))
230590075Sobrien
230690075Sobrien/* The number of levels of template parameters given by NODE.  */
230790075Sobrien#define TMPL_PARMS_DEPTH(NODE) \
230890075Sobrien  ((HOST_WIDE_INT) TREE_INT_CST_LOW (TREE_PURPOSE (NODE)))
230990075Sobrien
231052284Sobrien/* The TEMPLATE_DECL instantiated or specialized by NODE.  This
231152284Sobrien   TEMPLATE_DECL will be the immediate parent, not the most general
231252284Sobrien   template.  For example, in:
231352284Sobrien
231452284Sobrien      template <class T> struct S { template <class U> void f(U); }
231552284Sobrien
231652284Sobrien   the FUNCTION_DECL for S<int>::f<double> will have, as its
231790075Sobrien   DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
231852284Sobrien
231952284Sobrien   As a special case, for a member friend template of a template
232052284Sobrien   class, this value will not be a TEMPLATE_DECL, but rather a
232190075Sobrien   LOOKUP_EXPR, IDENTIFIER_NODE or OVERLOAD indicating the name of
232290075Sobrien   the template and any explicit template arguments provided.  For
232390075Sobrien   example, in:
232452284Sobrien
232552284Sobrien     template <class T> struct S { friend void f<int>(int, double); }
232652284Sobrien
232752284Sobrien   the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
232890075Sobrien   DECL_TI_ARGS will be {int}.  */
232950397Sobrien#define DECL_TI_TEMPLATE(NODE)      TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
233052284Sobrien
233152284Sobrien/* The template arguments used to obtain this decl from the most
233252284Sobrien   general form of DECL_TI_TEMPLATE.  For the example given for
233352284Sobrien   DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}.  These
233452284Sobrien   are always the full set of arguments required to instantiate this
233552284Sobrien   declaration from the most general template specialized here.  */
233650397Sobrien#define DECL_TI_ARGS(NODE)          TI_ARGS (DECL_TEMPLATE_INFO (NODE))
233750397Sobrien#define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
233850397Sobrien#define CLASSTYPE_TI_ARGS(NODE)     TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
233990075Sobrien#define ENUM_TI_TEMPLATE(NODE)			\
234052284Sobrien  TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE))
234152284Sobrien#define ENUM_TI_ARGS(NODE)			\
234252284Sobrien  TI_ARGS (ENUM_TEMPLATE_INFO (NODE))
234352284Sobrien
234452284Sobrien/* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE.  */
234552284Sobrien#define TYPE_TI_TEMPLATE(NODE)			\
234652284Sobrien  (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE)))
234752284Sobrien
234890075Sobrien/* Like DECL_TI_ARGS, but for an ENUMERAL_, RECORD_, or UNION_TYPE.  */
234952284Sobrien#define TYPE_TI_ARGS(NODE)			\
235052284Sobrien  (TI_ARGS (TYPE_TEMPLATE_INFO (NODE)))
235152284Sobrien
235290075Sobrien#define INNERMOST_TEMPLATE_PARMS(NODE)  TREE_VALUE (NODE)
235318334Speter
235452284Sobrien/* Nonzero if the NODE corresponds to the template parameters for a
235552284Sobrien   member template, whose inline definition is being processed after
235652284Sobrien   the class definition is complete.  */
235750397Sobrien#define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
235850397Sobrien
235990075Sobrien/* In a FUNCTION_DECL, the saved language-specific per-function data.  */
236090075Sobrien#define DECL_SAVED_FUNCTION_DATA(NODE) \
236190075Sobrien  (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->u.saved_language_function)
236290075Sobrien
236350397Sobrien#define NEW_EXPR_USE_GLOBAL(NODE)	TREE_LANG_FLAG_0 (NODE)
236450397Sobrien#define DELETE_EXPR_USE_GLOBAL(NODE)	TREE_LANG_FLAG_0 (NODE)
236550397Sobrien#define DELETE_EXPR_USE_VEC(NODE)	TREE_LANG_FLAG_1 (NODE)
236650397Sobrien#define LOOKUP_EXPR_GLOBAL(NODE)	TREE_LANG_FLAG_0 (NODE)
236750397Sobrien
236890075Sobrien/* Nonzero if this AGGR_INIT_EXPR provides for initialization via a
236990075Sobrien   constructor call, rather than an ordinary function call.  */
237090075Sobrien#define AGGR_INIT_VIA_CTOR_P(NODE) \
237190075Sobrien  TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE))
237290075Sobrien
237350397Sobrien/* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
237450397Sobrien   TEMPLATE_DECL.  This macro determines whether or not a given class
237550397Sobrien   type is really a template type, as opposed to an instantiation or
237650397Sobrien   specialization of one.  */
237750397Sobrien#define CLASSTYPE_IS_TEMPLATE(NODE)  \
237850397Sobrien  (CLASSTYPE_TEMPLATE_INFO (NODE)    \
237950397Sobrien   && !CLASSTYPE_USE_TEMPLATE (NODE) \
238050397Sobrien   && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE)))
238150397Sobrien
238252284Sobrien/* The name used by the user to name the typename type.  Typically,
238352284Sobrien   this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the
238452284Sobrien   corresponding TYPE_DECL.  However, this may also be a
238552284Sobrien   TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'.  */
238690075Sobrien#define TYPENAME_TYPE_FULLNAME(NODE) (TYPE_FIELDS (NODE))
238750397Sobrien
238852284Sobrien/* Nonzero if NODE is an implicit typename.  */
238952284Sobrien#define IMPLICIT_TYPENAME_P(NODE) \
239052284Sobrien  (TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE))
239152284Sobrien
239290075Sobrien/* Nonzero if NODE is a TYPE_DECL that should not be visible because
239390075Sobrien   it is from a dependent base class.  */
239490075Sobrien#define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE)	\
239590075Sobrien  (TREE_CODE (NODE) == TYPE_DECL		\
239690075Sobrien   && DECL_ARTIFICIAL (NODE)			\
239790075Sobrien   && IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
239890075Sobrien
239950397Sobrien/* Nonzero in INTEGER_CST means that this int is negative by dint of
240018334Speter   using a twos-complement negated operand.  */
240190075Sobrien#define TREE_NEGATED_INT(NODE) TREE_LANG_FLAG_0 (INTEGER_CST_CHECK (NODE))
240218334Speter
240390075Sobrien/* Nonzero in any kind of _TYPE where conversions to base-classes may
240490075Sobrien   involve pointer arithmetic.  If this is zero, then converting to
240590075Sobrien   a base-class never requires changing the value of the pointer.  */
240690075Sobrien#define TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P(NODE) (TREE_LANG_FLAG_1 (NODE))
240718334Speter
240890075Sobrien/* [class.virtual]
240918334Speter
241090075Sobrien   A class that declares or inherits a virtual function is called a
241190075Sobrien   polymorphic class.  */
241290075Sobrien#define TYPE_POLYMORPHIC_P(NODE) (TREE_LANG_FLAG_2 (NODE))
241318334Speter
241490075Sobrien/* Nonzero if this class has a virtual function table pointer.  */
241590075Sobrien#define TYPE_CONTAINS_VPTR_P(NODE)		\
241690075Sobrien  (TYPE_POLYMORPHIC_P (NODE)			\
241790075Sobrien   || TYPE_USES_VIRTUAL_BASECLASSES (NODE))
241818334Speter
241918334Speterextern int flag_new_for_scope;
242018334Speter
242118334Speter/* This flag is true of a local VAR_DECL if it was declared in a for
242250397Sobrien   statement, but we are no longer in the scope of the for.  */
242390075Sobrien#define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (VAR_DECL_CHECK (NODE))
242418334Speter
242518334Speter/* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL
242618334Speter   if we already emitted a warning about using it.  */
242790075Sobrien#define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (VAR_DECL_CHECK (NODE))
242818334Speter
242990075Sobrien/* Nonzero if NODE is a FUNCTION_DECL (for a function with global
243090075Sobrien   scope) declared in a local scope.  */
243190075Sobrien#define DECL_LOCAL_FUNCTION_P(NODE) \
243290075Sobrien  DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE))
243318334Speter
243490075Sobrien/* Nonzero if NODE is a FUNCTION_DECL for a built-in function, and we have
243590075Sobrien   not yet seen a prototype for that function.  */
243690075Sobrien#define DECL_ANTICIPATED(NODE) \
243790075Sobrien  (DECL_LANG_SPECIFIC (DECL_CHECK (NODE))->decl_flags.anticipated_p)
243890075Sobrien
243918334Speter/* Record whether a typedef for type `int' was actually `signed int'.  */
244090075Sobrien#define C_TYPEDEF_EXPLICITLY_SIGNED(EXP) DECL_LANG_FLAG_1 (EXP)
244118334Speter
244290075Sobrien/* Returns non-zero if DECL has external linkage, as specified by the
244390075Sobrien   language standard.  (This predicate may hold even when the
244490075Sobrien   corresponding entity is not actually given external linkage in the
244590075Sobrien   object file; see decl_linkage for details.)  */
244690075Sobrien#define DECL_EXTERNAL_LINKAGE_P(DECL) \
244790075Sobrien  (decl_linkage (DECL) == lk_external)
244852284Sobrien
244918334Speter#define INTEGRAL_CODE_P(CODE) \
245090075Sobrien  ((CODE) == INTEGER_TYPE || (CODE) == ENUMERAL_TYPE || (CODE) == BOOLEAN_TYPE)
245118334Speter
245290075Sobrien/* [basic.fundamental]
245318334Speter
245490075Sobrien   Types  bool, char, wchar_t, and the signed and unsigned integer types
245590075Sobrien   are collectively called integral types.
245690075Sobrien
245790075Sobrien   Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
245890075Sobrien   types as well, which is incorrect in C++.  */
245990075Sobrien#define CP_INTEGRAL_TYPE_P(TYPE)		\
246090075Sobrien  (TREE_CODE (TYPE) == BOOLEAN_TYPE		\
246190075Sobrien   || TREE_CODE (TYPE) == INTEGER_TYPE)
246290075Sobrien
246390075Sobrien/* [basic.fundamental]
246490075Sobrien
246590075Sobrien   Integral and floating types are collectively called arithmetic
246690075Sobrien   types.  */
246790075Sobrien#define ARITHMETIC_TYPE_P(TYPE) \
246890075Sobrien  (CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
246990075Sobrien
247018334Speter/* Nonzero for _TYPE means that the _TYPE defines
247118334Speter   at least one constructor.  */
247290075Sobrien#define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1 (NODE))
247318334Speter
247418334Speter/* When appearing in an INDIRECT_REF, it means that the tree structure
247518334Speter   underneath is actually a call to a constructor.  This is needed
247618334Speter   when the constructor must initialize local storage (which can
247718334Speter   be automatically destroyed), rather than allowing it to allocate
247818334Speter   space from the heap.
247918334Speter
248018334Speter   When appearing in a SAVE_EXPR, it means that underneath
248118334Speter   is a call to a constructor.
248218334Speter
248318334Speter   When appearing in a CONSTRUCTOR, it means that it was
248418334Speter   a GNU C constructor expression.
248518334Speter
248618334Speter   When appearing in a FIELD_DECL, it means that this field
248718334Speter   has been duly initialized in its constructor.  */
248890075Sobrien#define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4 (NODE))
248918334Speter
249052284Sobrien#define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR	   \
249152284Sobrien				   && CONSTRUCTOR_ELTS (NODE) == NULL_TREE \
249252284Sobrien				   && ! TREE_HAS_CONSTRUCTOR (NODE))
249318334Speter
249418334Speter/* Nonzero for _TYPE means that the _TYPE defines a destructor.  */
249590075Sobrien#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2 (NODE))
249618334Speter
249718334Speter/* Nonzero means that an object of this type can not be initialized using
249818334Speter   an initializer list.  */
249918334Speter#define CLASSTYPE_NON_AGGREGATE(NODE) \
250090075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->non_aggregate)
250118334Speter#define TYPE_NON_AGGREGATE_CLASS(NODE) \
250218334Speter  (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE))
250318334Speter
250418334Speter/* Nonzero if there is a user-defined X::op=(x&) for this class.  */
250590075Sobrien#define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC (NODE)->has_real_assign_ref)
250690075Sobrien#define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC (NODE)->has_complex_assign_ref)
250790075Sobrien#define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC (NODE)->has_abstract_assign_ref)
250890075Sobrien#define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC (NODE)->has_complex_init_ref)
250918334Speter
251090075Sobrien/* Nonzero if TYPE has a trivial destructor.  From [class.dtor]:
251118334Speter
251290075Sobrien     A destructor is trivial if it is an implicitly declared
251390075Sobrien     destructor and if:
251490075Sobrien
251590075Sobrien       - all of the direct base classes of its class have trivial
251690075Sobrien         destructors,
251790075Sobrien
251890075Sobrien       - for all of the non-static data members of its class that are
251990075Sobrien         of class type (or array thereof), each such class has a
252090075Sobrien	 trivial destructor.  */
252190075Sobrien#define TYPE_HAS_TRIVIAL_DESTRUCTOR(NODE) \
252290075Sobrien  (!TYPE_HAS_NONTRIVIAL_DESTRUCTOR (NODE))
252390075Sobrien
252490075Sobrien/* Nonzero for _TYPE node means that this type does not have a trivial
252590075Sobrien   destructor.  Therefore, destroying an object of this type will
252690075Sobrien   involve a call to a destructor.  This can apply to objects of
252790075Sobrien   ARRAY_TYPE is the type of the elements needs a destructor.  */
252890075Sobrien#define TYPE_HAS_NONTRIVIAL_DESTRUCTOR(NODE) \
252990075Sobrien  (TYPE_LANG_FLAG_4 (NODE))
253090075Sobrien
253190075Sobrien/* Nonzero for class type means that copy initialization of this type can use
253218334Speter   a bitwise copy.  */
253318334Speter#define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \
253418334Speter  (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE))
253518334Speter
253618334Speter/* Nonzero for class type means that assignment of this type can use
253718334Speter   a bitwise copy.  */
253818334Speter#define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \
253918334Speter  (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE))
254018334Speter
254150397Sobrien#define TYPE_PTRMEM_P(NODE)					\
254250397Sobrien  (TREE_CODE (NODE) == POINTER_TYPE				\
254350397Sobrien   && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE)
254450397Sobrien#define TYPE_PTR_P(NODE)				\
254550397Sobrien  (TREE_CODE (NODE) == POINTER_TYPE			\
254650397Sobrien   && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE)
254750397Sobrien#define TYPE_PTROB_P(NODE)						\
254850397Sobrien  (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE	\
254950397Sobrien   && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE)
255050397Sobrien#define TYPE_PTROBV_P(NODE)						\
255150397Sobrien  (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE)
255250397Sobrien#define TYPE_PTRFN_P(NODE)				\
255350397Sobrien  (TREE_CODE (NODE) == POINTER_TYPE			\
255450397Sobrien   && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
255590075Sobrien#define TYPE_REFFN_P(NODE)				\
255690075Sobrien  (TREE_CODE (NODE) == REFERENCE_TYPE			\
255790075Sobrien   && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE)
255850397Sobrien
255918334Speter/* Nonzero for _TYPE node means that this type is a pointer to member
256050397Sobrien   function type.  */
256190075Sobrien#define TYPE_PTRMEMFUNC_P(NODE)		\
256290075Sobrien  (TREE_CODE (NODE) == RECORD_TYPE	\
256390075Sobrien   && TYPE_LANG_SPECIFIC (NODE)		\
256490075Sobrien   && TYPE_PTRMEMFUNC_FLAG (NODE))
256590075Sobrien
256652284Sobrien#define TYPE_PTRMEMFUNC_FLAG(NODE) \
256790075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->ptrmemfunc_flag)
256852284Sobrien
256990075Sobrien/* Indicates when overload resolution may resolve to a pointer to
257090075Sobrien   member function. [expr.unary.op]/3 */
257190075Sobrien#define PTRMEM_OK_P(NODE) TREE_LANG_FLAG_0 (NODE)
257290075Sobrien
257318334Speter/* Get the POINTER_TYPE to the METHOD_TYPE associated with this
257418334Speter   pointer to member function.  TYPE_PTRMEMFUNC_P _must_ be true,
257550397Sobrien   before using this macro.  */
257690075Sobrien#define TYPE_PTRMEMFUNC_FN_TYPE(NODE) \
257790075Sobrien  (TREE_TYPE (TYPE_FIELDS (NODE)))
257850397Sobrien
257950397Sobrien/* Returns `A' for a type like `int (A::*)(double)' */
258050397Sobrien#define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \
258150397Sobrien  TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
258250397Sobrien
258350397Sobrien/* These are use to manipulate the canonical RECORD_TYPE from the
258450397Sobrien   hashed POINTER_TYPE, and can only be used on the POINTER_TYPE.  */
258590075Sobrien#define TYPE_GET_PTRMEMFUNC_TYPE(NODE) \
258690075Sobrien  ((tree)TYPE_LANG_SPECIFIC (NODE))
258790075Sobrien#define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) \
258890075Sobrien  (TYPE_LANG_SPECIFIC (NODE) = ((struct lang_type *)(void*)(VALUE)))
258990075Sobrien/* Returns the pfn field from a TYPE_PTRMEMFUNC_P.  */
259052284Sobrien#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE))
259118334Speter
259290075Sobrien/* For a pointer-to-member type of the form `T X::*', this is `X'.
259390075Sobrien   For a type like `void (X::*)() const', this type is `X', not `const
259490075Sobrien   X'.  To get at the `const X' you have to look at the
259590075Sobrien   TYPE_PTRMEM_POINTED_TO_TYPE; there, the first parameter will have
259690075Sobrien   type `const X*'.  */
259790075Sobrien#define TYPE_PTRMEM_CLASS_TYPE(NODE)			\
259890075Sobrien  (TYPE_PTRMEM_P (NODE)					\
259990075Sobrien   ? TYPE_OFFSET_BASETYPE (TREE_TYPE (NODE))		\
260090075Sobrien   : TYPE_PTRMEMFUNC_OBJECT_TYPE (NODE))
260190075Sobrien
260290075Sobrien/* For a pointer-to-member type of the form `T X::*', this is `T'.  */
260390075Sobrien#define TYPE_PTRMEM_POINTED_TO_TYPE(NODE)		\
260490075Sobrien   (TYPE_PTRMEM_P (NODE)				\
260590075Sobrien    ? TREE_TYPE (TREE_TYPE (NODE))			\
260690075Sobrien    : TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE)))
260790075Sobrien
260852284Sobrien/* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for
260952284Sobrien   `X'.  */
261090075Sobrien#define PTRMEM_CST_CLASS(NODE) \
261190075Sobrien  TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (PTRMEM_CST_CHECK (NODE)))
261252284Sobrien
261390075Sobrien/* For a pointer-to-member constant `X::Y' this is the _DECL for
261452284Sobrien   `Y'.  */
261590075Sobrien#define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member)
261652284Sobrien
261718334Speter/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was
261890075Sobrien   specified in its declaration.  This can also be set for an
261990075Sobrien   erroneously declared PARM_DECL.  */
262090075Sobrien#define DECL_THIS_EXTERN(NODE) \
262190075Sobrien  DECL_LANG_FLAG_2 (VAR_FUNCTION_OR_PARM_DECL_CHECK (NODE))
262218334Speter
262318334Speter/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was
262490075Sobrien   specified in its declaration.  This can also be set for an
262590075Sobrien   erroneously declared PARM_DECL.  */
262690075Sobrien#define DECL_THIS_STATIC(NODE) \
262790075Sobrien  DECL_LANG_FLAG_6 (VAR_FUNCTION_OR_PARM_DECL_CHECK (NODE))
262818334Speter
262990075Sobrien/* Nonzero if TYPE is an anonymous union or struct type.  We have to use a
263090075Sobrien   flag for this because "A union for which objects or pointers are
263190075Sobrien   declared is not an anonymous union" [class.union].  */
263290075Sobrien#define ANON_AGGR_TYPE_P(NODE)				\
263390075Sobrien  (CLASS_TYPE_P (NODE) && TYPE_LANG_SPECIFIC (NODE)->anon_aggr)
263490075Sobrien#define SET_ANON_AGGR_TYPE_P(NODE)			\
263590075Sobrien  (TYPE_LANG_SPECIFIC (NODE)->anon_aggr = 1)
263618334Speter
263790075Sobrien/* Nonzero if TYPE is an anonymous union type.  */
263890075Sobrien#define ANON_UNION_TYPE_P(NODE) \
263990075Sobrien  (TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE))
264018334Speter
264118334Speter#define UNKNOWN_TYPE LANG_TYPE
264218334Speter
264318334Speter/* Define fields and accessors for nodes representing declared names.  */
264418334Speter
264590075Sobrien#define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->was_anonymous)
264618334Speter
264718334Speter/* C++: all of these are overloaded!  These apply only to TYPE_DECLs.  */
264850397Sobrien
264950397Sobrien/* The format of each node in the DECL_FRIENDLIST is as follows:
265050397Sobrien
265150397Sobrien   The TREE_PURPOSE will be the name of a function, i.e., an
265250397Sobrien   IDENTIFIER_NODE.  The TREE_VALUE will be itself a TREE_LIST, the
265350397Sobrien   list of functions with that name which are friends.  The
265450397Sobrien   TREE_PURPOSE of each node in this sublist will be error_mark_node,
265550397Sobrien   if the function was declared a friend individually, in which case
265650397Sobrien   the TREE_VALUE will be the function_decl.  If, however, all
265750397Sobrien   functions with a given name in a class were declared to be friends,
265850397Sobrien   the TREE_PUROSE will be the class type, and the TREE_VALUE will be
265950397Sobrien   NULL_TREE.  */
266018334Speter#define DECL_FRIENDLIST(NODE)		(DECL_INITIAL (NODE))
266152284Sobrien#define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST))
266252284Sobrien#define FRIEND_DECLS(LIST) (TREE_VALUE (LIST))
266318334Speter
266452284Sobrien/* The DECL_ACCESS, if non-NULL, is a TREE_LIST.  The TREE_PURPOSE of
266552284Sobrien   each node is a type; the TREE_VALUE is the access granted for this
266652284Sobrien   DECL in that type.  The DECL_ACCESS is set by access declarations.
266752284Sobrien   For example, if a member that would normally be public in a
266852284Sobrien   derived class is made protected, then the derived class and the
266952284Sobrien   protected_access_node will appear in the DECL_ACCESS for the node.  */
267090075Sobrien#define DECL_ACCESS(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.u2.access)
267118334Speter
267290075Sobrien/* Nonzero if the FUNCTION_DECL is a global constructor.  */
267390075Sobrien#define DECL_GLOBAL_CTOR_P(NODE) \
267490075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.global_ctor_p)
267518334Speter
267690075Sobrien/* Nonzero if the FUNCTION_DECL is a global destructor.  */
267790075Sobrien#define DECL_GLOBAL_DTOR_P(NODE) \
267890075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.global_dtor_p)
267990075Sobrien
268090075Sobrien/* If DECL_GLOBAL_CTOR_P or DECL_GLOBAL_DTOR_P holds, this macro
268190075Sobrien   returns the initialization priority for the function.  Constructors
268290075Sobrien   with lower numbers should be run first.  Destructors should be run
268390075Sobrien   in the reverse order of constructors.  */
268490075Sobrien#define GLOBAL_INIT_PRIORITY(NODE) \
268590075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.u2.init_priority)
268690075Sobrien
268750397Sobrien/* Accessor macros for C++ template decl nodes.  */
268818334Speter
268950397Sobrien/* The DECL_TEMPLATE_PARMS are a list.  The TREE_PURPOSE of each node
269090075Sobrien   is a INT_CST whose TREE_INT_CST_LOW indicates the level of the
269152284Sobrien   template parameters, with 1 being the outermost set of template
269252284Sobrien   parameters.  The TREE_VALUE is a vector, whose elements are the
269352284Sobrien   template parameters at each level.  Each element in the vector is a
269452284Sobrien   TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a
269552284Sobrien   non-type parameter), or a TYPE_DECL (if the parameter is a type
269652284Sobrien   parameter).  The TREE_PURPOSE is the default value, if any.  The
269752284Sobrien   TEMPLATE_PARM_INDEX for the parameter is avilable as the
269852284Sobrien   DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a
269952284Sobrien   TYPE_DECL).  */
270090075Sobrien#define DECL_TEMPLATE_PARMS(NODE)       DECL_ARGUMENTS (NODE)
270150397Sobrien#define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \
270250397Sobrien   INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE))
270350397Sobrien#define DECL_NTPARMS(NODE) \
270450397Sobrien   TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE))
270518334Speter/* For function, method, class-data templates.  */
270690075Sobrien#define DECL_TEMPLATE_RESULT(NODE)      DECL_RESULT_FLD (NODE)
270752284Sobrien/* For a static member variable template, the
270852284Sobrien   DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and
270952284Sobrien   implicitly generated instantiations of the variable.  There are no
271052284Sobrien   partial instantiations of static member variables, so all of these
271152284Sobrien   will be full instantiations.
271252284Sobrien
271352284Sobrien   For a class template the DECL_TEMPLATE_INSTANTIATIONS lists holds
271452284Sobrien   all instantiations and specializations of the class type, including
271552284Sobrien   partial instantiations and partial specializations.
271652284Sobrien
271752284Sobrien   In both cases, the TREE_PURPOSE of each node contains the arguments
271852284Sobrien   used; the TREE_VALUE contains the generated variable.  The template
271952284Sobrien   arguments are always complete.  For example, given:
272052284Sobrien
272152284Sobrien      template <class T> struct S1 {
272252284Sobrien        template <class U> struct S2 {};
272352284Sobrien	template <class U> struct S2<U*> {};
272452284Sobrien      };
272552284Sobrien
272652284Sobrien   the record for the partial specialization will contain, as its
272752284Sobrien   argument list, { {T}, {U*} }, and will be on the
272852284Sobrien   DECL_TEMPLATE_INSTANTIATIONS list for `template <class T> template
272952284Sobrien   <class U> struct S1<T>::S2'.
273052284Sobrien
273152284Sobrien   This list is not used for function templates.  */
273290075Sobrien#define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX (NODE)
273352284Sobrien/* For a function template, the DECL_TEMPLATE_SPECIALIZATIONS lists
273452284Sobrien   contains all instantiations and specializations of the function,
273552284Sobrien   including partial instantiations.  For a partial instantiation
273652284Sobrien   which is a specialization, this list holds only full
273752284Sobrien   specializations of the template that are instantiations of the
273852284Sobrien   partial instantiation.  For example, given:
273952284Sobrien
274052284Sobrien      template <class T> struct S {
274152284Sobrien        template <class U> void f(U);
274290075Sobrien	template <> void f(T);
274352284Sobrien      };
274452284Sobrien
274552284Sobrien   the `S<int>::f<int>(int)' function will appear on the
274652284Sobrien   DECL_TEMPLATE_SPECIALIZATIONS list for both `template <class T>
274752284Sobrien   template <class U> void S<T>::f(U)' and `template <class T> void
274852284Sobrien   S<int>::f(T)'.  In the latter case, however, it will have only the
274952284Sobrien   innermost set of arguments (T, in this case).  The DECL_TI_TEMPLATE
275052284Sobrien   for the function declaration will point at the specialization, not
275152284Sobrien   the fully general template.
275252284Sobrien
275352284Sobrien   For a class template, this list contains the partial
275452284Sobrien   specializations of this template.  (Full specializations are not
275552284Sobrien   recorded on this list.)  The TREE_PURPOSE holds the innermost
275652284Sobrien   arguments used in the partial specialization (e.g., for `template
275752284Sobrien   <class T> struct S<T*, int>' this will be `T*'.)  The TREE_VALUE
275852284Sobrien   holds the innermost template parameters for the specialization
275952284Sobrien   (e.g., `T' in the example above.)  The TREE_TYPE is the _TYPE node
276052284Sobrien   for the partial specialization.
276152284Sobrien
276252284Sobrien   This list is not used for static variable templates.  */
276390075Sobrien#define DECL_TEMPLATE_SPECIALIZATIONS(NODE)     DECL_SIZE (NODE)
276418334Speter
276552284Sobrien/* Nonzero for a DECL which is actually a template parameter.  */
276690075Sobrien#define DECL_TEMPLATE_PARM_P(NODE)		\
276790075Sobrien  (DECL_LANG_FLAG_0 (NODE)			\
276890075Sobrien   && (TREE_CODE (NODE) == CONST_DECL		\
276990075Sobrien       || TREE_CODE (NODE) == PARM_DECL		\
277090075Sobrien       || TREE_CODE (NODE) == TYPE_DECL		\
277190075Sobrien       || TREE_CODE (NODE) == TEMPLATE_DECL))
277252284Sobrien
277390075Sobrien/* Mark NODE as a template parameter.  */
277490075Sobrien#define SET_DECL_TEMPLATE_PARM_P(NODE) \
277590075Sobrien  (DECL_LANG_FLAG_0 (NODE) = 1)
277690075Sobrien
277790075Sobrien/* Nonzero if NODE is a template template parameter.  */
277850397Sobrien#define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \
277952284Sobrien  (TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE))
278050397Sobrien
278150397Sobrien#define DECL_FUNCTION_TEMPLATE_P(NODE)  \
278250397Sobrien  (TREE_CODE (NODE) == TEMPLATE_DECL \
278350397Sobrien   && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL)
278450397Sobrien
278550397Sobrien/* Nonzero for a DECL that represents a template class.  */
278650397Sobrien#define DECL_CLASS_TEMPLATE_P(NODE) \
278750397Sobrien  (TREE_CODE (NODE) == TEMPLATE_DECL \
278850397Sobrien   && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \
278950397Sobrien   && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE))
279050397Sobrien
279150397Sobrien/* Nonzero if NODE which declares a type.  */
279250397Sobrien#define DECL_DECLARES_TYPE_P(NODE) \
279350397Sobrien  (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE))
279450397Sobrien
279590075Sobrien/* Nonzero if NODE is the typedef implicitly generated for a type when
279690075Sobrien   the type is declared.  (In C++, `struct S {};' is roughly equivalent
279790075Sobrien   to `struct S {}; typedef struct S S;' in C.  This macro will hold
279890075Sobrien   for the typedef indicated in this example.  Note that in C++, there
279990075Sobrien   is a second implicit typedef for each class, in the scope of `S'
280090075Sobrien   itself, so that you can say `S::S'.  This macro does *not* hold for
280190075Sobrien   those typedefs.  */
280290075Sobrien#define DECL_IMPLICIT_TYPEDEF_P(NODE) \
280390075Sobrien  (TREE_CODE (NODE) == TYPE_DECL && DECL_LANG_FLAG_2 (NODE))
280490075Sobrien#define SET_DECL_IMPLICIT_TYPEDEF_P(NODE) \
280590075Sobrien  (DECL_LANG_FLAG_2 (NODE) = 1)
280690075Sobrien
280750397Sobrien/* A `primary' template is one that has its own template header.  A
280850397Sobrien   member function of a class template is a template, but not primary.
280950397Sobrien   A member template is primary.  Friend templates are primary, too.  */
281050397Sobrien
281150397Sobrien/* Returns the primary template corresponding to these parameters.  */
281250397Sobrien#define DECL_PRIMARY_TEMPLATE(NODE) \
281350397Sobrien  (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE)))
281450397Sobrien
281550397Sobrien/* Returns non-zero if NODE is a primary template.  */
281690075Sobrien#define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == (NODE))
281750397Sobrien
281850397Sobrien#define CLASSTYPE_TEMPLATE_LEVEL(NODE) \
281990075Sobrien  (TREE_INT_CST_LOW (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE))))
282050397Sobrien
282118334Speter/* Indicates whether or not (and how) a template was expanded for this
282218334Speter   FUNCTION_DECL or VAR_DECL.
282318334Speter     0=normal declaration, e.g. int min (int, int);
282418334Speter     1=implicit template instantiation
282518334Speter     2=explicit template specialization, e.g. int min<int> (int, int);
282650397Sobrien     3=explicit template instantiation, e.g. template int min<int> (int, int);  */
282790075Sobrien#define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC (NODE)->decl_flags.use_template)
282818334Speter
282918334Speter#define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1)
283018334Speter#define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \
283118334Speter  (CLASSTYPE_USE_TEMPLATE (NODE) & 1)
283218334Speter
283318334Speter#define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2)
283418334Speter#define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2)
283518334Speter#define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
283618334Speter  (CLASSTYPE_USE_TEMPLATE (NODE) == 2)
283718334Speter#define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \
283818334Speter  (CLASSTYPE_USE_TEMPLATE (NODE) = 2)
283918334Speter
284018334Speter#define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1)
284118334Speter#define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1)
284218334Speter#define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
284390075Sobrien  (CLASSTYPE_USE_TEMPLATE (NODE) == 1)
284418334Speter#define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \
284590075Sobrien  (CLASSTYPE_USE_TEMPLATE (NODE) = 1)
284618334Speter
284718334Speter#define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3)
284818334Speter#define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3)
284918334Speter#define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
285090075Sobrien  (CLASSTYPE_USE_TEMPLATE (NODE) == 3)
285118334Speter#define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \
285290075Sobrien  (CLASSTYPE_USE_TEMPLATE (NODE) = 3)
285318334Speter
285452284Sobrien/* Non-zero if DECL is a friend function which is an instantiation
285552284Sobrien   from the point of view of the compiler, but not from the point of
285652284Sobrien   view of the language.  For example given:
285752284Sobrien      template <class T> struct S { friend void f(T) {}; };
285852284Sobrien   the declaration of `void f(int)' generated when S<int> is
285952284Sobrien   instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be
286052284Sobrien   a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION.  */
286152284Sobrien#define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \
286252284Sobrien  (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL))
286352284Sobrien
286452284Sobrien/* Non-zero if TYPE is a partial instantiation of a template class,
286552284Sobrien   i.e., an instantiation whose instantiation arguments involve
286652284Sobrien   template types.  */
286752284Sobrien#define PARTIAL_INSTANTIATION_P(TYPE) \
286890075Sobrien  (TYPE_LANG_SPECIFIC (TYPE)->is_partial_instantiation)
286952284Sobrien
287052284Sobrien/* Non-zero iff we are currently processing a declaration for an
287152284Sobrien   entity with its own template parameter list, and which is not a
287252284Sobrien   full specialization.  */
287352284Sobrien#define PROCESSING_REAL_TEMPLATE_DECL_P() \
287452284Sobrien  (processing_template_decl > template_class_depth (current_class_type))
287552284Sobrien
287650397Sobrien/* This function may be a guiding decl for a template.  */
287750397Sobrien#define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE)
287852284Sobrien
287952284Sobrien/* Nonzero if this VAR_DECL or FUNCTION_DECL has already been
288052284Sobrien   instantiated, i.e. its definition has been generated from the
288152284Sobrien   pattern given in the the template.  */
288290075Sobrien#define DECL_TEMPLATE_INSTANTIATED(NODE) \
288390075Sobrien  DECL_LANG_FLAG_1 (VAR_OR_FUNCTION_DECL_CHECK (NODE))
288452284Sobrien
288518334Speter/* We know what we're doing with this decl now.  */
288618334Speter#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE)
288718334Speter
288818334Speter/* This function was declared inline.  This flag controls the linkage
288918334Speter   semantics of 'inline'; whether or not the function is inlined is
289018334Speter   controlled by DECL_INLINE.  */
289190075Sobrien#define DECL_DECLARED_INLINE_P(NODE) \
289290075Sobrien  (DECL_LANG_SPECIFIC (NODE)->decl_flags.base.declared_inline)
289318334Speter
289418334Speter/* DECL_EXTERNAL must be set on a decl until the decl is actually emitted,
289518334Speter   so that assemble_external will work properly.  So we have this flag to
289618334Speter   tell us whether the decl is really not external.  */
289718334Speter#define DECL_NOT_REALLY_EXTERN(NODE) \
289818334Speter  (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern)
289918334Speter
290050397Sobrien#define DECL_REALLY_EXTERN(NODE) \
290150397Sobrien  (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE))
290218334Speter
290390075Sobrien/* A thunk is a stub function.
290418334Speter
290590075Sobrien   A thunk is an alternate entry point for an ordinary FUNCTION_DECL.
290690075Sobrien   The address of the ordinary FUNCTION_DECL is given by the
290790075Sobrien   DECL_INITIAL, which is always an ADDR_EXPR whose operand is a
290890075Sobrien   FUNCTION_DECL.  The job of the thunk is to adjust the `this'
290990075Sobrien   pointer before transferring control to the FUNCTION_DECL.
291018334Speter
291190075Sobrien   A thunk may perform either, or both, of the following operations:
291250397Sobrien
291390075Sobrien   o Adjust the `this' pointer by a constant offset.
291490075Sobrien   o Adjust the `this' pointer by looking up a vcall-offset
291590075Sobrien     in the vtable.
291650397Sobrien
291790075Sobrien   If both operations are performed, then the constant adjument to
291890075Sobrien   `this' is performed first.
291990075Sobrien
292090075Sobrien   The constant adjustment is given by THUNK_DELTA.  If the
292190075Sobrien   vcall-offset is required, the index into the vtable is given by
292290075Sobrien   THUNK_VCALL_OFFSET.  */
292390075Sobrien
292490075Sobrien/* An integer indicating how many bytes should be subtracted from the
292590075Sobrien   `this' pointer when this function is called.  */
292690075Sobrien#define THUNK_DELTA(DECL) (DECL_CHECK (DECL)->decl.u1.i)
292790075Sobrien
292890075Sobrien/* A tree indicating how many bytes should be subtracted from the
292990075Sobrien   vtable for the `this' pointer to find the vcall offset.  (The vptr
293090075Sobrien   is always located at offset zero from the f `this' pointer.)  If
293190075Sobrien   NULL, then there is no vcall offset.  */
293290075Sobrien#define THUNK_VCALL_OFFSET(DECL) \
293390075Sobrien  (DECL_LANG_SPECIFIC (DECL)->decl_flags.u2.vcall_offset)
293490075Sobrien
293550397Sobrien/* These macros provide convenient access to the various _STMT nodes
293650397Sobrien   created when parsing template declarations.  */
293790075Sobrien#define TRY_STMTS(NODE)         TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0)
293890075Sobrien#define TRY_HANDLERS(NODE)      TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1)
293950397Sobrien
294090075Sobrien#define EH_SPEC_STMTS(NODE)     TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 0)
294190075Sobrien#define EH_SPEC_RAISES(NODE)    TREE_OPERAND (EH_SPEC_BLOCK_CHECK (NODE), 1)
294290075Sobrien
294390075Sobrien#define USING_STMT_NAMESPACE(NODE) TREE_OPERAND (USING_STMT_CHECK (NODE), 0)
294490075Sobrien
294590075Sobrien/* Nonzero if this try block is a function try block.  */
294690075Sobrien#define FN_TRY_BLOCK_P(NODE)    TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE))
294790075Sobrien#define HANDLER_PARMS(NODE)     TREE_OPERAND (HANDLER_CHECK (NODE), 0)
294890075Sobrien#define HANDLER_BODY(NODE)      TREE_OPERAND (HANDLER_CHECK (NODE), 1)
294990075Sobrien#define HANDLER_TYPE(NODE)	TREE_TYPE (HANDLER_CHECK (NODE))
295090075Sobrien#define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (SUBOBJECT_CHECK (NODE), 0)
295190075Sobrien
295290075Sobrien/* Nonzero if this CTOR_STMT is for the beginning of a constructor.  */
295390075Sobrien#define CTOR_BEGIN_P(NODE) \
295490075Sobrien  (TREE_LANG_FLAG_0 (CTOR_STMT_CHECK (NODE)))
295590075Sobrien
295690075Sobrien/* Nonzero if this CTOR_STMT is for the end of a constructor.  */
295790075Sobrien#define CTOR_END_P(NODE) \
295890075Sobrien  (!CTOR_BEGIN_P (NODE))
295990075Sobrien
296090075Sobrien/* The parameters for a call-declarator.  */
296190075Sobrien#define CALL_DECLARATOR_PARMS(NODE) \
296290075Sobrien  (TREE_PURPOSE (TREE_OPERAND (NODE, 1)))
296390075Sobrien
296490075Sobrien/* The cv-qualifiers for a call-declarator.  */
296590075Sobrien#define CALL_DECLARATOR_QUALS(NODE) \
296690075Sobrien  (TREE_VALUE (TREE_OPERAND (NODE, 1)))
296790075Sobrien
296890075Sobrien/* The exception-specification for a call-declarator.  */
296990075Sobrien#define CALL_DECLARATOR_EXCEPTION_SPEC(NODE) \
297090075Sobrien  (TREE_TYPE (NODE))
297190075Sobrien
297218334Speter/* An enumeration of the kind of tags that C++ accepts.  */
297390075Sobrienenum tag_types { record_type, class_type, union_type, enum_type };
297418334Speter
297590075Sobrien/* The various kinds of lvalues we distinguish.  */
297690075Sobrientypedef enum cp_lvalue_kind {
297790075Sobrien  clk_none = 0,     /* Things that are not an lvalue.  */
297890075Sobrien  clk_ordinary = 1, /* An ordinary lvalue.  */
297990075Sobrien  clk_class = 2,    /* An rvalue of class-type.  */
298090075Sobrien  clk_bitfield = 4, /* An lvalue for a bit-field.  */
298190075Sobrien} cp_lvalue_kind;
298218334Speter
298390075Sobrien/* The kinds of scopes we recognize.  */
298490075Sobrientypedef enum scope_kind {
298590075Sobrien  sk_template_parms, /* A scope for template parameters.  */
298690075Sobrien  sk_template_spec   /* A scope corresponding to a template
298790075Sobrien			specialization.  There is never anything in
298890075Sobrien			this scope.  */
298990075Sobrien} scope_kind;
299018334Speter
299190075Sobrien/* Various kinds of template specialization, instantiation, etc.  */
299290075Sobrientypedef enum tmpl_spec_kind {
299390075Sobrien  tsk_none,                /* Not a template at all.  */
299490075Sobrien  tsk_invalid_member_spec, /* An explicit member template
299590075Sobrien			      specialization, but the enclosing
299690075Sobrien			      classes have not all been explicitly
299790075Sobrien			      specialized.  */
299890075Sobrien  tsk_invalid_expl_inst,   /* An explicit instantiation containing
299990075Sobrien			      template parameter lists.  */
300090075Sobrien  tsk_excessive_parms,     /* A template declaration with too many
300190075Sobrien			      template parameter lists.  */
300290075Sobrien  tsk_insufficient_parms,  /* A template declaration with too few
300390075Sobrien			      parameter lists.  */
300490075Sobrien  tsk_template,            /* A template declaration.  */
300590075Sobrien  tsk_expl_spec,           /* An explicit specialization.  */
300690075Sobrien  tsk_expl_inst            /* An explicit instantiation.  */
300790075Sobrien} tmpl_spec_kind;
300818334Speter
300990075Sobrien/* The various kinds of access.  BINFO_ACCESS depends on these being
301090075Sobrien   two bit quantities.  The numerical values are important; they are
301190075Sobrien   used to initialize RTTI data structures, so changing them changes
301290075Sobrien   the ABI.  */
301390075Sobrientypedef enum access_kind {
301490075Sobrien  ak_none = 0,             /* Inaccessible.  */
301590075Sobrien  ak_public = 1,           /* Accessible, as a `public' thing.  */
301690075Sobrien  ak_protected = 2,        /* Accessible, as a `protected' thing.  */
301790075Sobrien  ak_private = 3           /* Accessible, as a `private' thing.  */
301890075Sobrien} access_kind;
301990075Sobrien
302090075Sobrien/* The various kinds of special functions.  If you add to this list,
302190075Sobrien   you should update special_function_p as well.  */
302290075Sobrientypedef enum special_function_kind {
302390075Sobrien  sfk_none = 0,            /* Not a special function.  This enumeral
302490075Sobrien			      must have value zero; see
302590075Sobrien			      special_function_p.  */
302690075Sobrien  sfk_constructor,         /* A constructor.  */
302790075Sobrien  sfk_copy_constructor,    /* A copy constructor.  */
302890075Sobrien  sfk_assignment_operator, /* An assignment operator.  */
302990075Sobrien  sfk_destructor,          /* A destructor.  */
303090075Sobrien  sfk_complete_destructor, /* A destructor for complete objects.  */
303190075Sobrien  sfk_base_destructor,     /* A destructor for base subobjects.  */
303290075Sobrien  sfk_deleting_destructor, /* A destructor for complete objects that
303390075Sobrien			      deletes the object after it has been
303490075Sobrien			      destroyed.  */
303590075Sobrien  sfk_conversion           /* A conversion operator.  */
303690075Sobrien} special_function_kind;
303790075Sobrien
303890075Sobrien/* The various kinds of linkage.  From [basic.link],
303990075Sobrien
304090075Sobrien      A name is said to have linkage when it might denote the same
304190075Sobrien      object, reference, function, type, template, namespace or value
304290075Sobrien      as a name introduced in another scope:
304390075Sobrien
304490075Sobrien      -- When a name has external linkage, the entity it denotes can
304590075Sobrien         be referred to from scopes of other translation units or from
304690075Sobrien	 other scopes of the same translation unit.
304790075Sobrien
304890075Sobrien      -- When a name has internal linkage, the entity it denotes can
304990075Sobrien         be referred to by names from other scopes in the same
305090075Sobrien	 translation unit.
305190075Sobrien
305290075Sobrien      -- When a name has no linkage, the entity it denotes cannot be
305390075Sobrien         referred to by names from other scopes.  */
305490075Sobrien
305590075Sobrientypedef enum linkage_kind {
305690075Sobrien  lk_none,                 /* No linkage.  */
305790075Sobrien  lk_internal,             /* Internal linkage.  */
305890075Sobrien  lk_external              /* External linkage.  */
305990075Sobrien} linkage_kind;
306090075Sobrien
306196263Sobrien/* Bitmask flags to control type substitution.  */
306296263Sobrientypedef enum tsubst_flags_t {
306396263Sobrien  tf_none = 0,               /* nothing special */
306496263Sobrien  tf_error = 1 << 0,         /* give error messages  */
306596263Sobrien  tf_warning = 1 << 1,       /* give warnings too  */
306696263Sobrien  tf_no_attributes = 1 << 2, /* ignore attributes on comparisons
306796263Sobrien				(instantiate_type use) */
306896263Sobrien  tf_ignore_bad_quals = 1 << 3, /* ignore bad cvr qualifiers */
306996263Sobrien  tf_keep_type_decl = 1 << 4,	/* retain typedef type decls
307096263Sobrien				   (make_typename_type use) */
307196263Sobrien  tf_ptrmem_ok = 1 << 5      /* pointers to member ok (internal
307296263Sobrien				instantiate_type use) */
307396263Sobrien} tsubst_flags_t;
307490075Sobrien
307590075Sobrien/* The kind of checking we can do looking in a class hierarchy. */
307690075Sobrientypedef enum base_access {
307790075Sobrien  ba_any = 0,      /* Do not check access, allow an ambiguous base,
307890075Sobrien		      prefer a non-virtual base */
307990075Sobrien  ba_ignore = 1,   /* Do not check access */
308090075Sobrien  ba_check = 2,    /* Check access */
308190075Sobrien  ba_not_special = 3, /* Do not consider special privilege
308290075Sobrien		         current_class_type might give. */
308390075Sobrien  ba_quiet = 4,    /* Do not issue error messages (bit mask).  */
308490075Sobrien} base_access;
308590075Sobrien
308690075Sobrien/* The kind of base we can find, looking in a class hierarchy.
308790075Sobrien   Values <0 indicate we failed. */
308890075Sobrientypedef enum base_kind {
308990075Sobrien  bk_inaccessible = -3,   /* The base is inaccessible */
309090075Sobrien  bk_ambig = -2,          /* The base is ambiguous */
309190075Sobrien  bk_not_base = -1,       /* It is not a base */
309290075Sobrien  bk_same_type = 0,       /* It is the same type */
309390075Sobrien  bk_proper_base = 1,     /* It is a proper base */
309490075Sobrien  bk_via_virtual = 2      /* It is a proper base, but via a virtual
309590075Sobrien			     path. This might not be the canonical
309690075Sobrien			     binfo. */
309790075Sobrien} base_kind;
309890075Sobrien
309990075Sobrien/* Nonzero means allow Microsoft extensions without a pedwarn.  */
310090075Sobrienextern int flag_ms_extensions;
310190075Sobrien
310218334Speter/* Non-zero means warn in function declared in derived class has the
310318334Speter   same name as a virtual in the base class, but fails to match the
310418334Speter   type signature of any virtual function in the base class.  */
310518334Speterextern int warn_overloaded_virtual;
310618334Speter
310750397Sobrien/* Nonzero means warn about use of multicharacter literals.  */
310850397Sobrienextern int warn_multichar;
310950397Sobrien
311090075Sobrien/* Set by add_implicitly_declared_members() to keep those members from
311190075Sobrien   being flagged as deprecated or reported as using deprecated
311290075Sobrien   types.  */
311390075Sobrienextern int adding_implicit_members;
311490075Sobrien
311552284Sobrien/* Non-zero means warn if a non-templatized friend function is
311652284Sobrien   declared in a templatized class. This behavior is warned about with
311752284Sobrien   flag_guiding_decls in do_friend. */
311852284Sobrienextern int warn_nontemplate_friend;
311952284Sobrien
312018334Speter/* in decl{2}.c */
312118334Speter/* A node that is a list (length 1) of error_mark_nodes.  */
312218334Speterextern tree error_mark_list;
312318334Speter
312418334Speter/* Node for "pointer to (virtual) function".
312550397Sobrien   This may be distinct from ptr_type_node so gdb can distinguish them.  */
312690075Sobrien#define vfunc_ptr_type_node  vtable_entry_type
312718334Speter
312818334Speter
312918334Speter/* For building calls to `delete'.  */
313018334Speterextern tree integer_two_node, integer_three_node;
313118334Speter
313252284Sobrienextern tree anonymous_namespace_name;
313352284Sobrien
313490075Sobrien/* The number of function bodies which we are currently processing.
313590075Sobrien   (Zero if we are at namespace scope, one inside the body of a
313690075Sobrien   function, two inside the body of a function in a local class, etc.)  */
313790075Sobrienextern int function_depth;
313852284Sobrien
313918334Speter/* in pt.c  */
314018334Speter
314190075Sobrien/* These values are used for the `STRICT' parameter to type_unification and
314250397Sobrien   fn_type_unification.  Their meanings are described with the
314350397Sobrien   documentation for fn_type_unification.  */
314418334Speter
314550397Sobrientypedef enum unification_kind_t {
314650397Sobrien  DEDUCE_CALL,
314750397Sobrien  DEDUCE_CONV,
314890075Sobrien  DEDUCE_EXACT,
314990075Sobrien  DEDUCE_ORDER
315050397Sobrien} unification_kind_t;
315118334Speter
315290075Sobrien/* Macros for operating on a template instantiation level node, represented
315390075Sobrien   by an EXPR_WITH_FILE_LOCATION.  */
315450397Sobrien
315590075Sobrien#define TINST_DECL(NODE) EXPR_WFL_NODE (NODE)
315690075Sobrien#define TINST_LINE(NODE) EXPR_WFL_LINENO (NODE)
315790075Sobrien#define TINST_FILE(NODE) EXPR_WFL_FILENAME (NODE)
315818334Speter
315918334Speter/* in class.c */
316052284Sobrien
316150397Sobrienextern int current_class_depth;
316218334Speter
316318334Speter/* Points to the name of that function. May not be the DECL_NAME
316418334Speter   of CURRENT_FUNCTION_DECL due to overloading */
316518334Speterextern tree original_function_name;
316618334Speter
316790075Sobrien/* An array of all local classes present in this translation unit, in
316890075Sobrien   declaration order.  */
316990075Sobrienextern varray_type local_classes;
317018334Speter
317118334Speter/* Here's where we control how name mangling takes place.  */
317218334Speter
317318334Speter/* Cannot use '$' up front, because this confuses gdb
317418334Speter   (names beginning with '$' are gdb-local identifiers).
317518334Speter
317618334Speter   Note that all forms in which the '$' is significant are long enough
317718334Speter   for direct indexing (meaning that if we know there is a '$'
317818334Speter   at a particular location, we can index into the string at
317918334Speter   any other location that provides distinguishing characters).  */
318018334Speter
318118334Speter/* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler
318218334Speter   doesn't allow '$' in symbol names.  */
318318334Speter#ifndef NO_DOLLAR_IN_LABEL
318418334Speter
318518334Speter#define JOINER '$'
318618334Speter
318718334Speter#define VPTR_NAME "$v"
318818334Speter#define THROW_NAME "$eh_throw"
318918334Speter#define AUTO_VTABLE_NAME "__vtbl$me__"
319018334Speter#define AUTO_TEMP_NAME "_$tmp_"
319118334Speter#define AUTO_TEMP_FORMAT "_$tmp_%d"
319218334Speter#define VTABLE_BASE "$vb"
319390075Sobrien#define VTABLE_NAME_PREFIX "__vt_"
319418334Speter#define VFIELD_BASE "$vf"
319518334Speter#define VFIELD_NAME "_vptr$"
319618334Speter#define VFIELD_NAME_FORMAT "_vptr$%s"
319718334Speter#define STATIC_NAME_FORMAT "_%s$%s"
319818334Speter#define ANON_AGGRNAME_FORMAT "$_%d"
319918334Speter
320018334Speter#else /* NO_DOLLAR_IN_LABEL */
320118334Speter
320218334Speter#ifndef NO_DOT_IN_LABEL
320318334Speter
320418334Speter#define JOINER '.'
320518334Speter
320618334Speter#define VPTR_NAME ".v"
320718334Speter#define THROW_NAME ".eh_throw"
320818334Speter#define AUTO_VTABLE_NAME "__vtbl.me__"
320918334Speter#define AUTO_TEMP_NAME "_.tmp_"
321018334Speter#define AUTO_TEMP_FORMAT "_.tmp_%d"
321118334Speter#define VTABLE_BASE ".vb"
321290075Sobrien#define VTABLE_NAME_PREFIX "__vt_"
321318334Speter#define VFIELD_BASE ".vf"
321418334Speter#define VFIELD_NAME "_vptr."
321518334Speter#define VFIELD_NAME_FORMAT "_vptr.%s"
321618334Speter#define STATIC_NAME_FORMAT "_%s.%s"
321718334Speter
321818334Speter#define ANON_AGGRNAME_FORMAT "._%d"
321918334Speter
322018334Speter#else /* NO_DOT_IN_LABEL */
322118334Speter
322218334Speter#define VPTR_NAME "__vptr"
322318334Speter#define VPTR_NAME_P(ID_NODE) \
322418334Speter  (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1))
322518334Speter#define THROW_NAME "__eh_throw"
322618334Speter#define IN_CHARGE_NAME "__in_chrg"
322718334Speter#define AUTO_VTABLE_NAME "__vtbl_me__"
322818334Speter#define AUTO_TEMP_NAME "__tmp_"
322918334Speter#define TEMP_NAME_P(ID_NODE) \
323018334Speter  (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \
323118334Speter	     sizeof (AUTO_TEMP_NAME) - 1))
323218334Speter#define AUTO_TEMP_FORMAT "__tmp_%d"
323318334Speter#define VTABLE_BASE "__vtb"
323418334Speter#define VTABLE_NAME "__vt_"
323590075Sobrien#define VTABLE_NAME_PREFIX "__vt_"
323618334Speter#define VTABLE_NAME_P(ID_NODE) \
323718334Speter  (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \
323818334Speter	     sizeof (VTABLE_NAME) - 1))
323918334Speter#define VFIELD_BASE "__vfb"
324018334Speter#define VFIELD_NAME "__vptr_"
324118334Speter#define VFIELD_NAME_P(ID_NODE) \
324218334Speter  (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \
324318334Speter	    sizeof (VFIELD_NAME) - 1))
324490075Sobrien#define VFIELD_NAME_FORMAT "__vptr_%s"
324518334Speter#define STATIC_NAME_FORMAT "__static_%s_%s"
324618334Speter
324718334Speter#define ANON_AGGRNAME_PREFIX "__anon_"
324818334Speter#define ANON_AGGRNAME_P(ID_NODE) \
324918334Speter  (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \
325018334Speter	     sizeof (ANON_AGGRNAME_PREFIX) - 1))
325118334Speter#define ANON_AGGRNAME_FORMAT "__anon_%d"
325218334Speter
325318334Speter#endif	/* NO_DOT_IN_LABEL */
325418334Speter#endif	/* NO_DOLLAR_IN_LABEL */
325518334Speter
325618334Speter#define THIS_NAME "this"
325718334Speter#define FILE_FUNCTION_PREFIX_LEN 9
325850397Sobrien#define CTOR_NAME "__ct"
325950397Sobrien#define DTOR_NAME "__dt"
326018334Speter
326118334Speter#define IN_CHARGE_NAME "__in_chrg"
326218334Speter
326318334Speter#define VTBL_PTR_TYPE		"__vtbl_ptr_type"
326418334Speter#define VTABLE_DELTA_NAME	"__delta"
326518334Speter#define VTABLE_PFN_NAME		"__pfn"
326618334Speter
326790075Sobrien#define EXCEPTION_CLEANUP_NAME	"exception cleanup"
326818334Speter
326918334Speter#if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL)
327018334Speter
327118334Speter#define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
327218334Speter			      && IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
327318334Speter
327418334Speter#define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
327518334Speter  && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
327618334Speter  && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER)
327718334Speter
327890075Sobrien#define TEMP_NAME_P(ID_NODE) \
327990075Sobrien  (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1))
328090075Sobrien#define VFIELD_NAME_P(ID_NODE) \
328190075Sobrien  (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1))
328218334Speter
328318334Speter/* For anonymous aggregate types, we need some sort of name to
328418334Speter   hold on to.  In practice, this should not appear, but it should
328518334Speter   not be harmful if it does.  */
328618334Speter#define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
328718334Speter				  && IDENTIFIER_POINTER (ID_NODE)[1] == '_')
328818334Speter#endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
328950397Sobrien
329050397Sobrien/* Returns non-zero iff NODE is a declaration for the global function
329150397Sobrien   `main'.  */
329250397Sobrien#define DECL_MAIN_P(NODE)				\
329390075Sobrien   (DECL_EXTERN_C_FUNCTION_P (NODE)                     \
329450397Sobrien    && DECL_NAME (NODE) != NULL_TREE			\
329550397Sobrien    && MAIN_NAME_P (DECL_NAME (NODE)))
329650397Sobrien
329718334Speter
329818334Speter/* Things for handling inline functions.  */
329918334Speter
330018334Speter/* Nonzero means do emit exported implementations of functions even if
330118334Speter   they can be inlined.  */
330218334Speter
330318334Speterextern int flag_implement_inlines;
330418334Speter
330518334Speter/* Nonzero means templates obey #pragma interface and implementation.  */
330618334Speter
330718334Speterextern int flag_external_templates;
330818334Speter
330918334Speter/* Nonzero means templates are emitted where they are instantiated.  */
331018334Speter
331118334Speterextern int flag_alt_external_templates;
331218334Speter
331318334Speter/* Nonzero means implicit template instantiations are emitted.  */
331418334Speter
331518334Speterextern int flag_implicit_templates;
331618334Speter
331750397Sobrien/* Nonzero if we want to emit defined symbols with common-like linkage as
331850397Sobrien   weak symbols where possible, in order to conform to C++ semantics.
331950397Sobrien   Otherwise, emit them as local symbols.  */
332018334Speter
332150397Sobrienextern int flag_weak;
332218334Speter
332390075Sobrien/* Nonzero if we're done parsing and into end-of-file activities.  */
332418334Speter
332590075Sobrienextern int at_eof;
332618334Speter
332790075Sobrien/* Functions called along with real static constructors and destructors.  */
332850397Sobrien
332990075Sobrienextern tree static_ctors;
333090075Sobrienextern tree static_dtors;
333150397Sobrien
333218334Speterenum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
333318334Speter
333418334Speter/* Some macros for char-based bitfields.  */
333590075Sobrien#define B_SET(A,X) ((A)[(X)>>3] |=  (1 << ((X)&7)))
333690075Sobrien#define B_CLR(A,X) ((A)[(X)>>3] &= ~(1 << ((X)&7)))
333790075Sobrien#define B_TST(A,X) ((A)[(X)>>3] &   (1 << ((X)&7)))
333818334Speter
333918334Speter/* These are uses as bits in flags passed to build_method_call
334018334Speter   to control its error reporting behavior.
334118334Speter
334218334Speter   LOOKUP_PROTECT means flag access violations.
334318334Speter   LOOKUP_COMPLAIN mean complain if no suitable member function
334418334Speter     matching the arguments is found.
334518334Speter   LOOKUP_NORMAL is just a combination of these two.
334618334Speter   LOOKUP_NONVIRTUAL means make a direct call to the member function found
334718334Speter   LOOKUP_GLOBAL means search through the space of overloaded functions,
334818334Speter     as well as the space of member functions.
334918334Speter   LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried.
335050397Sobrien   DIRECT_BIND means that if a temporary is created, it should be created so
335150397Sobrien     that it lives as long as the current variable bindings; otherwise it
335290075Sobrien     only lives until the end of the complete-expression.  It also forces
335390075Sobrien     direct-initialization in cases where other parts of the compiler have
335490075Sobrien     already generated a temporary, such as reference initialization and the
335590075Sobrien     catch parameter.
335618334Speter   LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are
335718334Speter     after.  Note, LOOKUP_COMPLAIN is checked and error messages printed
335818334Speter     before LOOKUP_SPECULATIVELY is checked.
335918334Speter   LOOKUP_NO_CONVERSION means that user-defined conversions are not
336018334Speter     permitted.  Built-in conversions are permitted.
336150397Sobrien   LOOKUP_DESTRUCTOR means explicit call to destructor.
336250397Sobrien   LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references.
336318334Speter
336450397Sobrien   These are used in global lookup to support elaborated types and
336550397Sobrien   qualifiers.
336690075Sobrien
336750397Sobrien   LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces.
336850397Sobrien   LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
336950397Sobrien   LOOKUP_PREFER_BOTH means class-or-namespace-name.
337050397Sobrien   LOOKUP_TEMPLATES_EXPECTED means that class templates also count
337150397Sobrien     as types.  */
337250397Sobrien
337318334Speter#define LOOKUP_PROTECT (1)
337418334Speter#define LOOKUP_COMPLAIN (2)
337518334Speter#define LOOKUP_NORMAL (3)
337618334Speter#define LOOKUP_NONVIRTUAL (8)
337718334Speter#define LOOKUP_GLOBAL (16)
337818334Speter#define LOOKUP_SPECULATIVELY (64)
337918334Speter#define LOOKUP_ONLYCONVERTING (128)
338050397Sobrien#define DIRECT_BIND (256)
338118334Speter#define LOOKUP_NO_CONVERSION (512)
338218334Speter#define LOOKUP_DESTRUCTOR (512)
338350397Sobrien#define LOOKUP_NO_TEMP_BIND (1024)
338450397Sobrien#define LOOKUP_PREFER_TYPES (2048)
338550397Sobrien#define LOOKUP_PREFER_NAMESPACES (4096)
338650397Sobrien#define LOOKUP_PREFER_BOTH (6144)
338750397Sobrien#define LOOKUP_TEMPLATES_EXPECTED (8192)
338818334Speter
338990075Sobrien#define LOOKUP_NAMESPACES_ONLY(F)  \
339090075Sobrien  (((F) & LOOKUP_PREFER_NAMESPACES) && !((F) & LOOKUP_PREFER_TYPES))
339190075Sobrien#define LOOKUP_TYPES_ONLY(F)  \
339290075Sobrien  (!((F) & LOOKUP_PREFER_NAMESPACES) && ((F) & LOOKUP_PREFER_TYPES))
339390075Sobrien#define LOOKUP_QUALIFIERS_ONLY(F)     ((F) & LOOKUP_PREFER_BOTH)
339450397Sobrien
339590075Sobrien
339618334Speter/* These flags are used by the conversion code.
339718334Speter   CONV_IMPLICIT   :  Perform implicit conversions (standard and user-defined).
339818334Speter   CONV_STATIC     :  Perform the explicit conversions for static_cast.
339918334Speter   CONV_CONST      :  Perform the explicit conversions for const_cast.
340018334Speter   CONV_REINTERPRET:  Perform the explicit conversions for reinterpret_cast.
340118334Speter   CONV_PRIVATE    :  Perform upcasts to private bases.
340218334Speter   CONV_FORCE_TEMP :  Require a new temporary when converting to the same
340390075Sobrien		      aggregate type.  */
340418334Speter
340518334Speter#define CONV_IMPLICIT    1
340618334Speter#define CONV_STATIC      2
340718334Speter#define CONV_CONST       4
340818334Speter#define CONV_REINTERPRET 8
340918334Speter#define CONV_PRIVATE	 16
341050397Sobrien/* #define CONV_NONCONVERTING 32 */
341118334Speter#define CONV_FORCE_TEMP  64
341218334Speter#define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP)
341318334Speter#define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
341418334Speter			  | CONV_REINTERPRET)
341518334Speter#define CONV_C_CAST      (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \
341618334Speter			  | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP)
341718334Speter
341818334Speter/* Used by build_expr_type_conversion to indicate which types are
341918334Speter   acceptable as arguments to the expression under consideration.  */
342018334Speter
342118334Speter#define WANT_INT	1 /* integer types, including bool */
342218334Speter#define WANT_FLOAT	2 /* floating point types */
342318334Speter#define WANT_ENUM	4 /* enumerated types */
342418334Speter#define WANT_POINTER	8 /* pointer types */
342518334Speter#define WANT_NULL      16 /* null pointer constant */
342618334Speter#define WANT_ARITH	(WANT_INT | WANT_FLOAT)
342718334Speter
342852284Sobrien/* Used with comptypes, and related functions, to guide type
342952284Sobrien   comparison.  */
343018334Speter
343152284Sobrien#define COMPARE_STRICT        0 /* Just check if the types are the
343252284Sobrien				   same.  */
343352284Sobrien#define COMPARE_BASE          1 /* Check to see if the second type is
343452284Sobrien				   derived from the first, or if both
343552284Sobrien				   are pointers (or references) and
343652284Sobrien				   the types pointed to by the second
343752284Sobrien				   type is derived from the pointed to
343852284Sobrien				   by the first.  */
343952284Sobrien#define COMPARE_RELAXED       2 /* Like COMPARE_DERIVED, but in
344052284Sobrien				   reverse.  Also treat enmeration
344152284Sobrien				   types as the same as integer types
344252284Sobrien				   of the same width.  */
344352284Sobrien#define COMPARE_REDECLARATION 4 /* The comparsion is being done when
344452284Sobrien				   another declaration of an existing
344552284Sobrien				   entity is seen.  */
344652284Sobrien#define COMPARE_NO_ATTRIBUTES 8 /* The comparison should ignore
344752284Sobrien				   extra-linguistic type attributes.  */
344852284Sobrien
344952284Sobrien/* Used with push_overloaded_decl.  */
345052284Sobrien#define PUSH_GLOBAL          0  /* Push the DECL into namespace scope,
345152284Sobrien				   regardless of the current scope.  */
345252284Sobrien#define PUSH_LOCAL           1  /* Push the DECL into the current
345352284Sobrien				   scope.  */
345452284Sobrien#define PUSH_USING           2  /* We are pushing this DECL as the
345552284Sobrien				   result of a using declaration.  */
345652284Sobrien
345790075Sobrien/* Used with start function.  */
345890075Sobrien#define SF_DEFAULT           0  /* No flags.  */
345990075Sobrien#define SF_PRE_PARSED        1  /* The function declaration has
346090075Sobrien				   already been parsed.  */
346190075Sobrien#define SF_INCLASS_INLINE    2  /* The function is an inline, defined
346290075Sobrien				   in the class body.  */
346352284Sobrien
346452284Sobrien/* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2
346552284Sobrien   is derived from TYPE1, or if TYPE2 is a pointer (reference) to a
346652284Sobrien   class derived from the type pointed to (referred to) by TYPE1.  */
346790075Sobrien#define same_or_base_type_p(TYPE1, TYPE2) \
346890075Sobrien  comptypes ((TYPE1), (TYPE2), COMPARE_BASE)
346952284Sobrien
347050397Sobrien/* These macros are used to access a TEMPLATE_PARM_INDEX.  */
347190075Sobrien#define TEMPLATE_PARM_INDEX_CAST(NODE) \
347290075Sobrien	((template_parm_index*)TEMPLATE_PARM_INDEX_CHECK (NODE))
347390075Sobrien#define TEMPLATE_PARM_IDX(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->index)
347490075Sobrien#define TEMPLATE_PARM_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->level)
347550397Sobrien#define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE))
347690075Sobrien#define TEMPLATE_PARM_ORIG_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->orig_level)
347790075Sobrien#define TEMPLATE_PARM_DECL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->decl)
347818334Speter
347990075Sobrien/* These macros are for accessing the fields of TEMPLATE_TYPE_PARM,
348090075Sobrien   TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM nodes.  */
348150397Sobrien#define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE))
348250397Sobrien#define TEMPLATE_TYPE_IDX(NODE) \
348350397Sobrien  (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
348450397Sobrien#define TEMPLATE_TYPE_LEVEL(NODE) \
348550397Sobrien  (TEMPLATE_PARM_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
348650397Sobrien#define TEMPLATE_TYPE_ORIG_LEVEL(NODE) \
348750397Sobrien  (TEMPLATE_PARM_ORIG_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
348850397Sobrien#define TEMPLATE_TYPE_DECL(NODE) \
348950397Sobrien  (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE)))
349050397Sobrien
349190075Sobrien/* These constants can used as bit flags in the process of tree formatting.
349290075Sobrien
349390075Sobrien   TFF_PLAIN_IDENTIFIER: unqualified part of a name.
349490075Sobrien   TFF_SCOPE: include the class and namespace scope of the name.
349590075Sobrien   TFF_CHASE_TYPEDEF: print the original type-id instead of the typedef-name.
349690075Sobrien   TFF_DECL_SPECIFIERS: print decl-specifiers.
349790075Sobrien   TFF_CLASS_KEY_OR_ENUM: precede a class-type name (resp. enum name) with
349890075Sobrien       a class-key (resp. `enum').
349990075Sobrien   TFF_RETURN_TYPE: include function return type.
350090075Sobrien   TFF_FUNCTION_DEFAULT_ARGUMENTS: include function default parameter values.
350190075Sobrien   TFF_EXCEPTION_SPECIFICATION: show function exception specification.
350290075Sobrien   TFF_TEMPLATE_HEADER: show the template<...> header in a
350390075Sobrien       template-declaration.
350490075Sobrien   TFF_TEMPLATE_NAME: show only template-name.
350590075Sobrien   TFF_EXPR_IN_PARENS: Parenthesize expressions.  */
350690075Sobrien
350790075Sobrien#define TFF_PLAIN_IDENTIFIER               (0)
350890075Sobrien#define TFF_SCOPE                	   (1)
350990075Sobrien#define TFF_CHASE_TYPEDEF                  (1 << 1)
351090075Sobrien#define TFF_DECL_SPECIFIERS                (1 << 2)
351190075Sobrien#define TFF_CLASS_KEY_OR_ENUM              (1 << 3)
351290075Sobrien#define TFF_RETURN_TYPE                    (1 << 4)
351390075Sobrien#define TFF_FUNCTION_DEFAULT_ARGUMENTS     (1 << 5)
351490075Sobrien#define TFF_EXCEPTION_SPECIFICATION        (1 << 6)
351590075Sobrien#define TFF_TEMPLATE_HEADER                (1 << 7)
351690075Sobrien#define TFF_TEMPLATE_NAME                  (1 << 8)
351790075Sobrien#define TFF_EXPR_IN_PARENS                 (1 << 9)
351890075Sobrien
351990075Sobrien/* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM
352090075Sobrien   node.  */
352190075Sobrien#define TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL(NODE)	\
352290075Sobrien  ((TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM)	\
352390075Sobrien   ? TYPE_TI_TEMPLATE (NODE)				\
352490075Sobrien   : TYPE_NAME (NODE))
352590075Sobrien
352618334Speter/* in lex.c  */
352790075Sobrien
352890075Sobrienextern void init_reswords PARAMS ((void));
352990075Sobrien
353018334Speter/* Indexed by TREE_CODE, these tables give C-looking names to
353118334Speter   operators represented by TREE_CODES.  For example,
353218334Speter   opname_tab[(int) MINUS_EXPR] == "-".  */
353390075Sobrienextern const char **opname_tab, **assignop_tab;
353490075Sobrien
353590075Sobrientypedef struct operator_name_info_t
353690075Sobrien{
353790075Sobrien  /* The IDENTIFIER_NODE for the operator.  */
353890075Sobrien  tree identifier;
353990075Sobrien  /* The name of the operator.  */
354090075Sobrien  const char *name;
354190075Sobrien  /* The mangled name of the operator.  */
354290075Sobrien  const char *mangled_name;
354390075Sobrien} operator_name_info_t;
354490075Sobrien
354590075Sobrien/* A mapping from tree codes to operator name information.  */
354690075Sobrienextern operator_name_info_t operator_name_info[];
354790075Sobrien/* Similar, but for assignment operators.  */
354890075Sobrienextern operator_name_info_t assignment_operator_name_info[];
354990075Sobrien
355018334Speter/* in call.c */
355190075Sobrienextern int check_dtor_name			PARAMS ((tree, tree));
355290075Sobrienextern int get_arglist_len_in_bytes		PARAMS ((tree));
355318334Speter
355490075Sobrienextern tree build_vfield_ref			PARAMS ((tree, tree));
355590075Sobrienextern tree build_scoped_method_call		PARAMS ((tree, tree, tree, tree));
355690075Sobrienextern tree build_conditional_expr		PARAMS ((tree, tree, tree));
355790075Sobrienextern tree build_addr_func			PARAMS ((tree));
355890075Sobrienextern tree build_call				PARAMS ((tree, tree));
355990075Sobrienextern tree build_method_call			PARAMS ((tree, tree, tree, tree, int));
356090075Sobrienextern int null_ptr_cst_p			PARAMS ((tree));
356190075Sobrienextern int sufficient_parms_p                   PARAMS ((tree));
356290075Sobrienextern tree type_decays_to			PARAMS ((tree));
356390075Sobrienextern tree build_user_type_conversion		PARAMS ((tree, tree, int));
356490075Sobrienextern tree build_new_function_call		PARAMS ((tree, tree));
356590075Sobrienextern tree build_new_op			PARAMS ((enum tree_code, int, tree, tree, tree));
356690075Sobrienextern tree build_op_delete_call		PARAMS ((enum tree_code, tree, tree, int, tree));
356790075Sobrienextern int can_convert				PARAMS ((tree, tree));
356890075Sobrienextern int can_convert_arg			PARAMS ((tree, tree, tree));
356990075Sobrienextern int can_convert_arg_bad			PARAMS ((tree, tree, tree));
357090075Sobrienextern int enforce_access                       PARAMS ((tree, tree));
357190075Sobrienextern tree convert_default_arg                 PARAMS ((tree, tree, tree, int));
357290075Sobrienextern tree convert_arg_to_ellipsis             PARAMS ((tree));
357390075Sobrienextern tree build_x_va_arg                      PARAMS ((tree, tree));
357490075Sobrienextern tree convert_type_from_ellipsis          PARAMS ((tree));
357590075Sobrienextern int is_properly_derived_from             PARAMS ((tree, tree));
357690075Sobrienextern tree initialize_reference                PARAMS ((tree, tree));
357790075Sobrienextern tree strip_top_quals                     PARAMS ((tree));
357890075Sobrienextern tree perform_implicit_conversion         PARAMS ((tree, tree));
357918334Speter
358018334Speter/* in class.c */
358190075Sobrienextern tree build_base_path			PARAMS ((enum tree_code, tree, tree, int));
358290075Sobrienextern tree build_vbase_path			PARAMS ((enum tree_code, tree, tree, tree, int));
358390075Sobrienextern tree build_vtbl_ref			PARAMS ((tree, tree));
358490075Sobrienextern tree build_vfn_ref			PARAMS ((tree, tree));
358590075Sobrienextern tree get_vtable_decl                     PARAMS ((tree, int));
358690075Sobrienextern void add_method				PARAMS ((tree, tree, int));
358790075Sobrienextern int currently_open_class			PARAMS ((tree));
358890075Sobrienextern tree currently_open_derived_class	PARAMS ((tree));
358990075Sobrienextern void duplicate_tag_error			PARAMS ((tree));
359090075Sobrienextern tree finish_struct			PARAMS ((tree, tree));
359190075Sobrienextern void finish_struct_1			PARAMS ((tree));
359290075Sobrienextern int resolves_to_fixed_type_p		PARAMS ((tree, int *));
359390075Sobrienextern void init_class_processing		PARAMS ((void));
359490075Sobrienextern int is_empty_class			PARAMS ((tree));
359590075Sobrienextern void pushclass				PARAMS ((tree, int));
359690075Sobrienextern void popclass				PARAMS ((void));
359790075Sobrienextern void push_nested_class			PARAMS ((tree, int));
359890075Sobrienextern void pop_nested_class			PARAMS ((void));
359990075Sobrienextern int current_lang_depth			PARAMS ((void));
360090075Sobrienextern void push_lang_context			PARAMS ((tree));
360190075Sobrienextern void pop_lang_context			PARAMS ((void));
360296263Sobrienextern tree instantiate_type			PARAMS ((tree, tree, tsubst_flags_t));
360390075Sobrienextern void print_class_statistics              PARAMS ((void));
360490075Sobrienextern void cxx_print_statistics		PARAMS ((void));
360590075Sobrienextern void cxx_print_xnode			PARAMS ((FILE *, tree, int));
360690075Sobrienextern void cxx_print_decl			PARAMS ((FILE *, tree, int));
360790075Sobrienextern void cxx_print_type			PARAMS ((FILE *, tree, int));
360890075Sobrienextern void cxx_print_identifier		PARAMS ((FILE *, tree, int));
360990075Sobrienextern void cxx_set_yydebug			PARAMS ((int));
361090075Sobrienextern void build_self_reference		PARAMS ((void));
361190075Sobrienextern int same_signature_p			PARAMS ((tree, tree));
361290075Sobrienextern void warn_hidden				PARAMS ((tree));
361390075Sobrienextern tree get_enclosing_class			PARAMS ((tree));
361490075Sobrienint is_base_of_enclosing_class			PARAMS ((tree, tree));
361590075Sobrienextern void unreverse_member_declarations       PARAMS ((tree));
361690075Sobrienextern void invalidate_class_lookup_cache       PARAMS ((void));
361790075Sobrienextern void maybe_note_name_used_in_class       PARAMS ((tree, tree));
361890075Sobrienextern void note_name_declared_in_class         PARAMS ((tree, tree));
361990075Sobrienextern tree get_vtbl_decl_for_binfo             PARAMS ((tree));
362090075Sobrienextern tree in_charge_arg_for_name              PARAMS ((tree));
362190075Sobrienextern tree get_vtt_name                        PARAMS ((tree));
362290075Sobrienextern tree get_primary_binfo                   PARAMS ((tree));
362318334Speter
362418334Speter/* in cvt.c */
362590075Sobrienextern tree convert_to_reference		PARAMS ((tree, tree, int, int, tree));
362690075Sobrienextern tree convert_from_reference		PARAMS ((tree));
362790075Sobrienextern tree convert_lvalue			PARAMS ((tree, tree));
362890075Sobrienextern tree ocp_convert				PARAMS ((tree, tree, int, int));
362990075Sobrienextern tree cp_convert				PARAMS ((tree, tree));
363090075Sobrienextern tree convert_to_void			PARAMS ((tree, const char */*implicit context*/));
363190075Sobrienextern tree convert_force			PARAMS ((tree, tree, int));
363290075Sobrienextern tree build_type_conversion		PARAMS ((tree, tree, int));
363390075Sobrienextern tree build_expr_type_conversion		PARAMS ((int, tree, int));
363490075Sobrienextern tree type_promotes_to			PARAMS ((tree));
363590075Sobrienextern tree perform_qualification_conversions   PARAMS ((tree, tree));
363690075Sobrienextern void clone_function_decl                 PARAMS ((tree, int));
363790075Sobrienextern void adjust_clone_args			PARAMS ((tree));
363818334Speter
363918334Speter/* decl.c */
364050397Sobrien/* resume_binding_level */
364190075Sobrienextern void cxx_init_decl_processing		PARAMS ((void));
364290075Sobrienextern int toplevel_bindings_p			PARAMS ((void));
364390075Sobrienextern int namespace_bindings_p			PARAMS ((void));
364490075Sobrienextern void keep_next_level			PARAMS ((int));
364590075Sobrienextern int kept_level_p				PARAMS ((void));
364690075Sobrienextern int template_parm_scope_p		PARAMS ((void));
364790075Sobrienextern void set_class_shadows			PARAMS ((tree));
364890075Sobrienextern void maybe_push_cleanup_level		PARAMS ((tree));
364990075Sobrienextern void begin_scope                         PARAMS ((scope_kind));
365090075Sobrienextern void finish_scope                        PARAMS ((void));
365190075Sobrienextern void note_level_for_for			PARAMS ((void));
365290075Sobrienextern void note_level_for_try			PARAMS ((void));
365390075Sobrienextern void note_level_for_catch		PARAMS ((void));
365490075Sobrienextern void resume_level			PARAMS ((struct binding_level *));
365590075Sobrienextern void delete_block			PARAMS ((tree));
365690075Sobrienextern void add_block_current_level		PARAMS ((tree));
365790075Sobrienextern void pushlevel_class			PARAMS ((void));
365890075Sobrienextern void poplevel_class                      PARAMS ((void));
365990075Sobrienextern void print_binding_stack			PARAMS ((void));
366090075Sobrienextern void print_binding_level			PARAMS ((struct binding_level *));
366190075Sobrienextern void push_namespace			PARAMS ((tree));
366290075Sobrienextern void pop_namespace			PARAMS ((void));
366390075Sobrienextern void push_nested_namespace		PARAMS ((tree));
366490075Sobrienextern void pop_nested_namespace		PARAMS ((tree));
366590075Sobrienextern void maybe_push_to_top_level		PARAMS ((int));
366690075Sobrienextern void push_to_top_level			PARAMS ((void));
366790075Sobrienextern void pop_from_top_level			PARAMS ((void));
366890075Sobrienextern void push_switch				PARAMS ((tree));
366990075Sobrienextern void pop_switch				PARAMS ((void));
367090075Sobrienextern tree identifier_type_value		PARAMS ((tree));
367190075Sobrienextern void set_identifier_type_value		PARAMS ((tree, tree));
367290075Sobrienextern void pop_everything			PARAMS ((void));
367390075Sobrienextern void pushtag				PARAMS ((tree, tree, int));
367490075Sobrienextern tree make_anon_name			PARAMS ((void));
367590075Sobrienextern void clear_anon_tags			PARAMS ((void));
367690075Sobrienextern int decls_match				PARAMS ((tree, tree));
367790075Sobrienextern int duplicate_decls			PARAMS ((tree, tree));
367890075Sobrienextern tree pushdecl_top_level			PARAMS ((tree));
367990075Sobrienextern void pushdecl_class_level		PARAMS ((tree));
368090075Sobrienextern tree pushdecl_namespace_level            PARAMS ((tree));
368190075Sobrienextern tree push_using_decl                     PARAMS ((tree, tree));
368290075Sobrienextern tree push_using_directive                PARAMS ((tree));
368390075Sobrienextern void push_class_level_binding		PARAMS ((tree, tree));
368490075Sobrienextern tree implicitly_declare			PARAMS ((tree));
368590075Sobrienextern tree declare_local_label                 PARAMS ((tree));
368690075Sobrienextern tree define_label			PARAMS ((const char *, int, tree));
368790075Sobrienextern void check_goto				PARAMS ((tree));
368890075Sobrienextern void define_case_label			PARAMS ((void));
368990075Sobrienextern tree binding_for_name                    PARAMS ((tree, tree));
369090075Sobrienextern tree namespace_binding                   PARAMS ((tree, tree));
369190075Sobrienextern void set_namespace_binding               PARAMS ((tree, tree, tree));
369290075Sobrienextern tree lookup_namespace_name		PARAMS ((tree, tree));
369390075Sobrienextern tree build_typename_type                 PARAMS ((tree, tree, tree, tree));
369496263Sobrienextern tree make_typename_type			PARAMS ((tree, tree, tsubst_flags_t));
369590075Sobrienextern tree make_unbound_class_template		PARAMS ((tree, tree, int));
369690075Sobrienextern tree lookup_name_nonclass		PARAMS ((tree));
369790075Sobrienextern tree lookup_function_nonclass            PARAMS ((tree, tree));
369890075Sobrienextern tree lookup_name				PARAMS ((tree, int));
369990075Sobrienextern tree lookup_name_current_level		PARAMS ((tree));
370090075Sobrienextern tree lookup_type_current_level		PARAMS ((tree));
370190075Sobrienextern tree lookup_name_namespace_only          PARAMS ((tree));
370290075Sobrienextern void begin_only_namespace_names          PARAMS ((void));
370390075Sobrienextern void end_only_namespace_names            PARAMS ((void));
370490075Sobrienextern tree namespace_ancestor			PARAMS ((tree, tree));
370590075Sobrienextern tree unqualified_namespace_lookup	PARAMS ((tree, int, tree *));
370690075Sobrienextern int  lookup_using_namespace              PARAMS ((tree, tree, tree, tree, int, tree *));
370790075Sobrienextern int  qualified_lookup_using_namespace    PARAMS ((tree, tree, tree, int));
370890075Sobrienextern tree build_library_fn			PARAMS ((tree, tree));
370990075Sobrienextern tree build_library_fn_ptr		PARAMS ((const char *, tree));
371090075Sobrienextern tree build_cp_library_fn_ptr		PARAMS ((const char *, tree));
371190075Sobrienextern tree push_library_fn			PARAMS ((tree, tree));
371290075Sobrienextern tree push_void_library_fn		PARAMS ((tree, tree));
371390075Sobrienextern tree push_throw_library_fn		PARAMS ((tree, tree));
371490075Sobrienextern int init_type_desc			PARAMS ((void));
371590075Sobrienextern tree check_tag_decl			PARAMS ((tree));
371690075Sobrienextern void shadow_tag				PARAMS ((tree));
371790075Sobrienextern tree groktypename			PARAMS ((tree));
371890075Sobrienextern tree start_decl				PARAMS ((tree, tree, int, tree, tree));
371990075Sobrienextern void start_decl_1			PARAMS ((tree));
372090075Sobrienextern void cp_finish_decl			PARAMS ((tree, tree, tree, int));
372190075Sobrienextern void finish_decl				PARAMS ((tree, tree, tree));
372290075Sobrienextern void maybe_inject_for_scope_var          PARAMS ((tree));
372390075Sobrienextern void initialize_local_var                PARAMS ((tree, tree, int));
372490075Sobrienextern void expand_static_init			PARAMS ((tree, tree));
372590075Sobrienextern tree start_handler_parms                 PARAMS ((tree, tree));
372690075Sobrienextern int complete_array_type			PARAMS ((tree, tree, int));
372790075Sobrienextern tree build_ptrmemfunc_type		PARAMS ((tree));
372818334Speter/* the grokdeclarator prototype is in decl.h */
372990075Sobrienextern int parmlist_is_exprlist			PARAMS ((tree));
373090075Sobrienextern int copy_fn_p				PARAMS ((tree));
373190075Sobrienextern void grok_special_member_properties	PARAMS ((tree));
373290075Sobrienextern int grok_ctor_properties			PARAMS ((tree, tree));
373390075Sobrienextern void grok_op_properties			PARAMS ((tree, int));
373490075Sobrienextern tree xref_tag				PARAMS ((tree, tree, int));
373590075Sobrienextern tree xref_tag_from_type			PARAMS ((tree, tree, int));
373690075Sobrienextern void xref_basetypes			PARAMS ((tree, tree, tree, tree));
373790075Sobrienextern tree start_enum				PARAMS ((tree));
373890075Sobrienextern void finish_enum				PARAMS ((tree));
373990075Sobrienextern void build_enumerator			PARAMS ((tree, tree, tree));
374090075Sobrienextern int start_function			PARAMS ((tree, tree, tree, int));
374190075Sobrienextern tree begin_function_body			PARAMS ((void));
374290075Sobrienextern void finish_function_body		PARAMS ((tree));
374390075Sobrienextern tree finish_function			PARAMS ((int));
374490075Sobrienextern tree start_method			PARAMS ((tree, tree, tree));
374590075Sobrienextern tree finish_method			PARAMS ((tree));
374696263Sobrienextern void maybe_register_incomplete_var       PARAMS ((tree));
374796263Sobrienextern void complete_vars			PARAMS ((tree));
374890075Sobrienextern void finish_stmt				PARAMS ((void));
374990075Sobrienextern void print_other_binding_stack		PARAMS ((struct binding_level *));
375090075Sobrienextern void revert_static_member_fn             PARAMS ((tree));
375190075Sobrienextern void fixup_anonymous_aggr                PARAMS ((tree));
375290075Sobrienextern int check_static_variable_definition     PARAMS ((tree, tree));
375390075Sobrienextern tree compute_array_index_type		PARAMS ((tree, tree));
375490075Sobrienextern void push_local_binding                  PARAMS ((tree, tree, int));
375590075Sobrienextern int push_class_binding                   PARAMS ((tree, tree));
375690075Sobrienextern tree check_default_argument              PARAMS ((tree, tree));
375790075Sobrienextern tree push_overloaded_decl		PARAMS ((tree, int));
375890075Sobrienextern void clear_identifier_class_values       PARAMS ((void));
375990075Sobrienextern void storetags                           PARAMS ((tree));
376090075Sobrienextern int vtable_decl_p                        PARAMS ((tree, void *));
376190075Sobrienextern int vtype_decl_p                         PARAMS ((tree, void *));
376290075Sobrienextern int sigtable_decl_p                      PARAMS ((tree, void *));
376390075Sobrientypedef int (*walk_globals_pred)                PARAMS ((tree, void *));
376490075Sobrientypedef int (*walk_globals_fn)                  PARAMS ((tree *, void *));
376590075Sobrienextern int walk_globals                         PARAMS ((walk_globals_pred,
376652284Sobrien						       walk_globals_fn,
376752284Sobrien						       void *));
376890075Sobrientypedef int (*walk_namespaces_fn)               PARAMS ((tree, void *));
376990075Sobrienextern int walk_namespaces                      PARAMS ((walk_namespaces_fn,
377052284Sobrien						       void *));
377190075Sobrienextern int wrapup_globals_for_namespace         PARAMS ((tree, void *));
377290075Sobrienextern tree cp_namespace_decls                  PARAMS ((tree));
377390075Sobrienextern tree create_implicit_typedef             PARAMS ((tree, tree));
377490075Sobrienextern tree maybe_push_decl                     PARAMS ((tree));
377590075Sobrienextern tree build_target_expr_with_type         PARAMS ((tree, tree));
377690075Sobrienextern int local_variable_p                     PARAMS ((tree));
377790075Sobrienextern int nonstatic_local_decl_p               PARAMS ((tree));
377890075Sobrienextern tree declare_global_var                  PARAMS ((tree, tree));
377990075Sobrienextern void register_dtor_fn                    PARAMS ((tree));
378090075Sobrienextern tmpl_spec_kind current_tmpl_spec_kind    PARAMS ((int));
378190075Sobrienextern tree cp_fname_init			PARAMS ((const char *));
378218334Speter
378318334Speter/* in decl2.c */
378490075Sobrienextern void init_decl2				PARAMS ((void));
378590075Sobrienextern int check_java_method			PARAMS ((tree));
378690075Sobrienextern int cxx_decode_option			PARAMS ((int, char **));
378790075Sobrienextern int grok_method_quals			PARAMS ((tree, tree, tree));
378890075Sobrienextern void warn_if_unknown_interface		PARAMS ((tree));
378990075Sobrienextern void grok_x_components			PARAMS ((tree));
379090075Sobrienextern void maybe_retrofit_in_chrg		PARAMS ((tree));
379190075Sobrienextern void maybe_make_one_only			PARAMS ((tree));
379290075Sobrienextern void grokclassfn				PARAMS ((tree, tree, enum overload_flags, tree));
379390075Sobrienextern tree grok_array_decl			PARAMS ((tree, tree));
379490075Sobrienextern tree delete_sanity			PARAMS ((tree, tree, int, int));
379590075Sobrienextern tree check_classfn			PARAMS ((tree, tree));
379690075Sobrienextern void check_member_template               PARAMS ((tree));
379790075Sobrienextern tree grokfield				PARAMS ((tree, tree, tree, tree, tree));
379890075Sobrienextern tree grokbitfield			PARAMS ((tree, tree, tree));
379990075Sobrienextern tree groktypefield			PARAMS ((tree, tree));
380090075Sobrienextern tree grokoptypename			PARAMS ((tree, tree));
380190075Sobrienextern void cplus_decl_attributes		PARAMS ((tree *, tree, int));
380290075Sobrienextern tree constructor_name_full		PARAMS ((tree));
380390075Sobrienextern tree constructor_name			PARAMS ((tree));
380490075Sobrienextern void defer_fn            		PARAMS ((tree));
380590075Sobrienextern void finish_anon_union			PARAMS ((tree));
380690075Sobrienextern tree finish_table			PARAMS ((tree, tree, tree, int));
380790075Sobrienextern void finish_builtin_type			PARAMS ((tree, const char *,
380852284Sobrien						       tree *, int, tree));
380990075Sobrienextern tree coerce_new_type			PARAMS ((tree));
381090075Sobrienextern tree coerce_delete_type			PARAMS ((tree));
381190075Sobrienextern void comdat_linkage			PARAMS ((tree));
381290075Sobrienextern void import_export_vtable		PARAMS ((tree, tree, int));
381390075Sobrienextern void import_export_decl			PARAMS ((tree));
3814102780Skanextern void import_export_tinfo			PARAMS ((tree, tree, int));
381590075Sobrienextern tree build_cleanup			PARAMS ((tree));
381690075Sobrienextern void finish_file				PARAMS ((void));
381790075Sobrienextern tree reparse_absdcl_as_expr		PARAMS ((tree, tree));
381890075Sobrienextern tree reparse_absdcl_as_casts		PARAMS ((tree, tree));
381990075Sobrienextern tree build_expr_from_tree		PARAMS ((tree));
382090075Sobrienextern tree reparse_decl_as_expr		PARAMS ((tree, tree));
382190075Sobrienextern tree finish_decl_parsing			PARAMS ((tree));
382290075Sobrienextern void set_decl_namespace                  PARAMS ((tree, tree, int));
382390075Sobrienextern tree current_decl_namespace              PARAMS ((void));
382490075Sobrienextern void push_decl_namespace                 PARAMS ((tree));
382590075Sobrienextern void pop_decl_namespace                  PARAMS ((void));
382690075Sobrienextern void push_scope				PARAMS ((tree));
382790075Sobrienextern void pop_scope				PARAMS ((tree));
382890075Sobrienextern void do_namespace_alias			PARAMS ((tree, tree));
382990075Sobrienextern void do_toplevel_using_decl		PARAMS ((tree));
383090075Sobrienextern void do_local_using_decl                 PARAMS ((tree));
383190075Sobrienextern tree do_class_using_decl			PARAMS ((tree));
383290075Sobrienextern void do_using_directive			PARAMS ((tree));
383390075Sobrienextern void check_default_args			PARAMS ((tree));
383490075Sobrienextern void mark_used				PARAMS ((tree));
383590075Sobrienextern tree handle_class_head			PARAMS ((tree, tree, tree, int, int *));
383690075Sobrienextern tree lookup_arg_dependent                PARAMS ((tree, tree, tree));
383790075Sobrienextern void finish_static_data_member_decl      PARAMS ((tree, tree, tree, int));
383890075Sobrienextern tree build_artificial_parm               PARAMS ((tree, tree));
383990075Sobrienextern tree get_guard                           PARAMS ((tree));
384090075Sobrienextern tree get_guard_cond                      PARAMS ((tree));
384190075Sobrienextern tree set_guard                           PARAMS ((tree));
384218334Speter
384390075Sobrien/* in parse.y */
384490075Sobrienextern void cp_parse_init			PARAMS ((void));
384518334Speter
384690075Sobrienextern void cp_error_at		PARAMS ((const char *msgid, ...));
384790075Sobrienextern void cp_warning_at	PARAMS ((const char *msgid, ...));
384890075Sobrienextern void cp_pedwarn_at	PARAMS ((const char *msgid, ...));
384990075Sobrien
385090075Sobrien/* XXX Not i18n clean.  */
385190075Sobrien#define cp_deprecated(STR)							\
385290075Sobrien  do {										\
385390075Sobrien    if (warn_deprecated)							\
385490075Sobrien      warning ("%s is deprecated, please see the documentation for details",	\
385590075Sobrien	       (STR));								\
385690075Sobrien  } while (0)
385790075Sobrien
385850397Sobrien/* in error.c */
385990075Sobrienextern void init_error				PARAMS ((void));
386090075Sobrienextern const char *type_as_string		PARAMS ((tree, int));
386190075Sobrienextern const char *decl_as_string		PARAMS ((tree, int));
386290075Sobrienextern const char *expr_as_string		PARAMS ((tree, int));
386390075Sobrienextern const char *context_as_string            PARAMS ((tree, int));
386490075Sobrienextern const char *lang_decl_name		PARAMS ((tree, int));
386590075Sobrienextern const char *cp_file_of			PARAMS ((tree));
386690075Sobrienextern int cp_line_of				PARAMS ((tree));
386790075Sobrienextern const char *language_to_string           PARAMS ((enum languages, int));
386890075Sobrienextern void print_instantiation_context         PARAMS ((void));
386950397Sobrien
387018334Speter/* in except.c */
387190075Sobrienextern void init_exception_processing		PARAMS ((void));
387290075Sobrienextern tree expand_start_catch_block		PARAMS ((tree));
387390075Sobrienextern void expand_end_catch_block		PARAMS ((void));
387490075Sobrienextern void expand_builtin_throw		PARAMS ((void));
387590075Sobrienextern void expand_eh_spec_block	        PARAMS ((tree));
387690075Sobrienextern void expand_exception_blocks		PARAMS ((void));
387790075Sobrienextern tree build_exc_ptr			PARAMS ((void));
387890075Sobrienextern tree build_throw				PARAMS ((tree));
387990075Sobrienextern void mark_all_runtime_matches            PARAMS ((void));
388090075Sobrienextern int nothrow_libfn_p			PARAMS ((tree));
388190075Sobrienextern void check_handlers			PARAMS ((tree));
388290075Sobrienextern void choose_personality_routine		PARAMS ((enum languages));
388318334Speter
388418334Speter/* in expr.c */
388590075Sobrienextern void init_cplus_expand			PARAMS ((void));
388690075Sobrienextern int extract_init				PARAMS ((tree, tree));
388790075Sobrienextern tree cplus_expand_constant               PARAMS ((tree));
388818334Speter
388950397Sobrien/* friend.c */
389090075Sobrienextern int is_friend				PARAMS ((tree, tree));
389190075Sobrienextern void make_friend_class			PARAMS ((tree, tree));
389290075Sobrienextern void add_friend                          PARAMS ((tree, tree));
389390075Sobrienextern tree do_friend				PARAMS ((tree, tree, tree, tree, tree, enum overload_flags, tree, int));
389418334Speter
389518334Speter/* in init.c */
389690075Sobrienextern void init_init_processing		PARAMS ((void));
389790075Sobrienextern void emit_base_init			PARAMS ((tree, tree));
389890075Sobrienextern tree expand_member_init			PARAMS ((tree, tree, tree));
389990075Sobrienextern tree build_aggr_init			PARAMS ((tree, tree, int));
390090075Sobrienextern int is_aggr_type				PARAMS ((tree, int));
390190075Sobrienextern tree get_aggr_from_typedef		PARAMS ((tree, int));
390290075Sobrienextern tree get_type_value			PARAMS ((tree));
3903102780Skanextern tree build_forced_zero_init		PARAMS ((tree));
390490075Sobrienextern tree build_member_call			PARAMS ((tree, tree, tree));
390590075Sobrienextern tree build_offset_ref			PARAMS ((tree, tree));
390690075Sobrienextern tree resolve_offset_ref			PARAMS ((tree));
390790075Sobrienextern tree build_new				PARAMS ((tree, tree, tree, int));
390890075Sobrienextern tree build_vec_init			PARAMS ((tree, tree, int));
390990075Sobrienextern tree build_x_delete			PARAMS ((tree, int, tree));
391090075Sobrienextern tree build_delete			PARAMS ((tree, tree, special_function_kind, int, int));
391196263Sobrienextern void perform_base_cleanups		PARAMS ((void));
391290075Sobrienextern tree build_vbase_delete			PARAMS ((tree, tree));
391390075Sobrienextern tree build_vec_delete			PARAMS ((tree, tree, special_function_kind, int));
391490075Sobrienextern tree create_temporary_var                PARAMS ((tree));
391590075Sobrienextern void begin_init_stmts                    PARAMS ((tree *, tree *));
391690075Sobrienextern tree finish_init_stmts                   PARAMS ((tree, tree));
391790075Sobrienextern void initialize_vtbl_ptrs                PARAMS ((tree));
391890075Sobrienextern tree build_java_class_ref                PARAMS ((tree));
391918334Speter
392018334Speter/* in input.c */
392118334Speter
392218334Speter/* in lex.c */
392390075Sobrienextern tree make_pointer_declarator		PARAMS ((tree, tree));
392490075Sobrienextern tree make_reference_declarator		PARAMS ((tree, tree));
392590075Sobrienextern tree make_call_declarator		PARAMS ((tree, tree, tree, tree));
392690075Sobrienextern void set_quals_and_spec			PARAMS ((tree, tree, tree));
392790075Sobrienextern void print_parse_statistics		PARAMS ((void));
392890075Sobrienextern void do_pending_inlines			PARAMS ((void));
392990075Sobrienextern void process_next_inline			PARAMS ((struct unparsed_text *));
393090075Sobrien
393190075Sobrienextern void yyungetc				PARAMS ((int, int));
393290075Sobrienextern void snarf_method			PARAMS ((tree));
393390075Sobrien
393490075Sobrienextern void check_for_missing_semicolon		PARAMS ((tree));
393590075Sobrienextern void note_got_semicolon			PARAMS ((tree));
393690075Sobrienextern void note_list_got_semicolon		PARAMS ((tree));
393790075Sobrienextern void do_pending_lang_change		PARAMS ((void));
393890075Sobrienextern void see_typename			PARAMS ((void));
393990075Sobrienextern tree do_identifier			PARAMS ((tree, int, tree));
394090075Sobrienextern tree do_scoped_id			PARAMS ((tree, int));
394190075Sobrienextern tree identifier_typedecl_value		PARAMS ((tree));
394290075Sobrienextern tree build_lang_decl			PARAMS ((enum tree_code, tree, tree));
394390075Sobrienextern void retrofit_lang_decl			PARAMS ((tree));
394490075Sobrienextern tree copy_decl                           PARAMS ((tree));
394590075Sobrienextern tree copy_type                           PARAMS ((tree));
394690075Sobrienextern tree cp_make_lang_type			PARAMS ((enum tree_code));
394790075Sobrienextern tree make_aggr_type			PARAMS ((enum tree_code));
394890075Sobrienextern void compiler_error			PARAMS ((const char *, ...))
394952284Sobrien  ATTRIBUTE_PRINTF_1;
395090075Sobrienextern void yyerror				PARAMS ((const char *));
395190075Sobrienextern void clear_inline_text_obstack		PARAMS ((void));
395290075Sobrienextern void yyhook				PARAMS ((int));
395390075Sobrienextern int cp_type_qual_from_rid                PARAMS ((tree));
395490075Sobrienextern const char *cxx_init			PARAMS ((const char *));
395590075Sobrienextern void cxx_finish PARAMS ((void));
395690075Sobrienextern void cxx_init_options PARAMS ((void));
395718334Speter
395818334Speter/* in method.c */
395990075Sobrienextern void init_method				PARAMS ((void));
396090075Sobrienextern void set_mangled_name_for_decl           PARAMS ((tree));
396190075Sobrienextern tree build_opfncall			PARAMS ((enum tree_code, int, tree, tree, tree));
396290075Sobrienextern tree hack_identifier			PARAMS ((tree, tree));
396390075Sobrienextern tree make_thunk				PARAMS ((tree, tree, tree));
396490075Sobrienextern void use_thunk				PARAMS ((tree, int));
396590075Sobrienextern void synthesize_method			PARAMS ((tree));
396690075Sobrienextern tree implicitly_declare_fn               PARAMS ((special_function_kind, tree, int));
396790075Sobrienextern tree skip_artificial_parms_for		PARAMS ((tree, tree));
396818334Speter
396990075Sobrien/* In optimize.c */
397090075Sobrienextern void optimize_function                   PARAMS ((tree));
397190075Sobrienextern int calls_setjmp_p                       PARAMS ((tree));
397290075Sobrienextern int maybe_clone_body                     PARAMS ((tree));
397360967Sobrien
397418334Speter/* in pt.c */
397590075Sobrienextern void init_pt                             PARAMS ((void));
397690075Sobrienextern void check_template_shadow		PARAMS ((tree));
397790075Sobrienextern tree get_innermost_template_args         PARAMS ((tree, int));
397896263Sobrienextern tree tsubst				PARAMS ((tree, tree, tsubst_flags_t, tree));
397996263Sobrienextern tree tsubst_expr				PARAMS ((tree, tree, tsubst_flags_t, tree));
398096263Sobrienextern tree tsubst_copy				PARAMS ((tree, tree, tsubst_flags_t, tree));
398190075Sobrienextern void maybe_begin_member_template_processing PARAMS ((tree));
398290075Sobrienextern void maybe_end_member_template_processing PARAMS ((void));
398390075Sobrienextern tree finish_member_template_decl         PARAMS ((tree));
398490075Sobrienextern void begin_template_parm_list		PARAMS ((void));
398590075Sobrienextern void begin_specialization                PARAMS ((void));
398690075Sobrienextern void reset_specialization                PARAMS ((void));
398790075Sobrienextern void end_specialization                  PARAMS ((void));
398890075Sobrienextern void begin_explicit_instantiation        PARAMS ((void));
398990075Sobrienextern void end_explicit_instantiation          PARAMS ((void));
399090075Sobrienextern tree check_explicit_specialization       PARAMS ((tree, tree, int, int));
399190075Sobrienextern tree process_template_parm		PARAMS ((tree, tree));
399290075Sobrienextern tree end_template_parm_list		PARAMS ((tree));
399390075Sobrienextern void end_template_decl			PARAMS ((void));
399490075Sobrienextern tree current_template_args		PARAMS ((void));
399590075Sobrienextern tree push_template_decl			PARAMS ((tree));
399690075Sobrienextern tree push_template_decl_real             PARAMS ((tree, int));
399790075Sobrienextern void redeclare_class_template            PARAMS ((tree, tree));
399896263Sobrienextern tree lookup_template_class		PARAMS ((tree, tree, tree, tree, int, tsubst_flags_t));
399990075Sobrienextern tree lookup_template_function            PARAMS ((tree, tree));
400090075Sobrienextern int uses_template_parms			PARAMS ((tree));
400190075Sobrienextern tree instantiate_class_template		PARAMS ((tree));
400290075Sobrienextern tree instantiate_template		PARAMS ((tree, tree));
400390075Sobrienextern int fn_type_unification                  PARAMS ((tree, tree, tree, tree, tree, unification_kind_t, int));
400490075Sobrienextern tree tinst_for_decl			PARAMS ((void));
400590075Sobrienextern void mark_decl_instantiated		PARAMS ((tree, int));
400690075Sobrienextern int more_specialized			PARAMS ((tree, tree, int, int));
400790075Sobrienextern void mark_class_instantiated		PARAMS ((tree, int));
400890075Sobrienextern void do_decl_instantiation		PARAMS ((tree, tree, tree));
400996263Sobrienextern void do_type_instantiation		PARAMS ((tree, tree, tsubst_flags_t));
401090075Sobrienextern tree instantiate_decl			PARAMS ((tree, int));
401190075Sobrienextern tree get_bindings			PARAMS ((tree, tree, tree));
401290075Sobrienextern int push_tinst_level			PARAMS ((tree));
401390075Sobrienextern void pop_tinst_level			PARAMS ((void));
401490075Sobrienextern int more_specialized_class		PARAMS ((tree, tree));
401590075Sobrienextern int is_member_template                   PARAMS ((tree));
401690075Sobrienextern int template_parms_equal                 PARAMS ((tree, tree));
401790075Sobrienextern int comp_template_parms                  PARAMS ((tree, tree));
401890075Sobrienextern int template_class_depth                 PARAMS ((tree));
401990075Sobrienextern int is_specialization_of                 PARAMS ((tree, tree));
402090075Sobrienextern int comp_template_args                   PARAMS ((tree, tree));
402190075Sobrienextern void maybe_process_partial_specialization PARAMS ((tree));
402290075Sobrienextern void maybe_check_template_type           PARAMS ((tree));
402390075Sobrienextern tree most_specialized_instantiation      PARAMS ((tree));
402490075Sobrienextern void print_candidates                    PARAMS ((tree));
402590075Sobrienextern int instantiate_pending_templates        PARAMS ((void));
402690075Sobrienextern tree tsubst_default_argument             PARAMS ((tree, tree, tree));
402790075Sobrienextern tree most_general_template		PARAMS ((tree));
402890075Sobrienextern tree get_mostly_instantiated_function_type PARAMS ((tree, tree *, tree *));
402990075Sobrienextern int problematic_instantiation_changed    PARAMS ((void));
403090075Sobrienextern void record_last_problematic_instantiation PARAMS ((void));
403190075Sobrienextern tree current_instantiation               PARAMS ((void));
403250397Sobrienextern int processing_template_parmlist;
403350397Sobrien
403450397Sobrien/* in repo.c */
403590075Sobrienextern void repo_template_used			PARAMS ((tree));
403690075Sobrienextern void repo_template_instantiated		PARAMS ((tree, int));
403790075Sobrienextern void init_repo				PARAMS ((const char *));
403890075Sobrienextern void finish_repo				PARAMS ((void));
403950397Sobrien
404050397Sobrien/* in rtti.c */
404190075Sobrienextern void init_rtti_processing		PARAMS((void));
404290075Sobrienextern tree build_typeid			PARAMS((tree));
404390075Sobrienextern tree get_tinfo_decl                      PARAMS((tree));
404490075Sobrienextern tree get_typeid				PARAMS((tree));
404590075Sobrienextern tree build_dynamic_cast			PARAMS((tree, tree));
404690075Sobrienextern void emit_support_tinfos                 PARAMS((void));
4047102780Skanextern int unemitted_tinfo_decl_p    	        PARAMS((tree, void *));
404890075Sobrienextern int emit_tinfo_decl                      PARAMS((tree *, void *));
404950397Sobrien
405018334Speter/* in search.c */
405190075Sobrienextern tree lookup_base PARAMS ((tree, tree, base_access, base_kind *));
405290075Sobrienextern int types_overlap_p			PARAMS ((tree, tree));
405390075Sobrienextern tree get_vbase				PARAMS ((tree, tree));
405490075Sobrienextern tree get_dynamic_cast_base_type          PARAMS ((tree, tree));
405590075Sobrienextern void type_access_control			PARAMS ((tree, tree));
405690075Sobrienextern int accessible_p                         PARAMS ((tree, tree));
405790075Sobrienextern tree lookup_field			PARAMS ((tree, tree, int, int));
405890075Sobrienextern int lookup_fnfields_1                    PARAMS ((tree, tree));
405990075Sobrienextern tree lookup_fnfields			PARAMS ((tree, tree, int));
406090075Sobrienextern tree lookup_member			PARAMS ((tree, tree, int, int));
406190075Sobrienextern int look_for_overrides			PARAMS ((tree, tree));
406290075Sobrienextern void get_pure_virtuals		        PARAMS ((tree));
406390075Sobrienextern void get_vbase_types			PARAMS ((tree));
406490075Sobrienextern void maybe_suppress_debug_info		PARAMS ((tree));
406590075Sobrienextern void note_debug_info_needed		PARAMS ((tree));
406690075Sobrienextern void push_class_decls			PARAMS ((tree));
406790075Sobrienextern void pop_class_decls			PARAMS ((void));
406890075Sobrienextern void unuse_fields			PARAMS ((tree));
406990075Sobrienextern void print_search_statistics		PARAMS ((void));
407090075Sobrienextern void init_search_processing		PARAMS ((void));
407190075Sobrienextern void reinit_search_statistics		PARAMS ((void));
407290075Sobrienextern tree current_scope			PARAMS ((void));
407390075Sobrienextern int at_function_scope_p                  PARAMS ((void));
407490075Sobrienextern tree context_for_name_lookup		PARAMS ((tree));
407590075Sobrienextern tree lookup_conversions			PARAMS ((tree));
407690075Sobrienextern tree binfo_for_vtable			PARAMS ((tree));
407790075Sobrienextern tree binfo_from_vbase			PARAMS ((tree));
407890075Sobrienextern tree look_for_overrides_here		PARAMS ((tree, tree));
4079102780Skanextern int check_final_overrider		PARAMS ((tree, tree));
408090075Sobrienextern tree dfs_walk                            PARAMS ((tree,
408152284Sobrien						       tree (*) (tree, void *),
408290075Sobrien						       tree (*) (tree, void *),
408352284Sobrien						       void *));
408490075Sobrienextern tree dfs_walk_real                      PARAMS ((tree,
408590075Sobrien						       tree (*) (tree, void *),
408690075Sobrien						       tree (*) (tree, void *),
408790075Sobrien						       tree (*) (tree, void *),
408890075Sobrien						       void *));
408990075Sobrienextern tree dfs_unmark                          PARAMS ((tree, void *));
409090075Sobrienextern tree markedp                             PARAMS ((tree, void *));
409190075Sobrienextern tree unmarkedp                           PARAMS ((tree, void *));
409290075Sobrienextern tree dfs_unmarked_real_bases_queue_p     PARAMS ((tree, void *));
409390075Sobrienextern tree dfs_marked_real_bases_queue_p       PARAMS ((tree, void *));
409490075Sobrienextern tree dfs_skip_vbases                     PARAMS ((tree, void *));
409590075Sobrienextern tree marked_vtable_pathp                 PARAMS ((tree, void *));
409690075Sobrienextern tree unmarked_vtable_pathp               PARAMS ((tree, void *));
409790075Sobrienextern tree find_vbase_instance                 PARAMS ((tree, tree));
409890075Sobrienextern tree binfo_for_vbase                     PARAMS ((tree, tree));
409990075Sobrienextern tree binfo_via_virtual                   PARAMS ((tree, tree));
410018334Speter
410150397Sobrien/* in semantics.c */
410290075Sobrienextern void init_cp_semantics                   PARAMS ((void));
410390075Sobrienextern tree finish_expr_stmt                    PARAMS ((tree));
410490075Sobrienextern tree begin_if_stmt                       PARAMS ((void));
410590075Sobrienextern void finish_if_stmt_cond                 PARAMS ((tree, tree));
410690075Sobrienextern tree finish_then_clause                  PARAMS ((tree));
410790075Sobrienextern void begin_else_clause                   PARAMS ((void));
410890075Sobrienextern void finish_else_clause                  PARAMS ((tree));
410990075Sobrienextern void finish_if_stmt                      PARAMS ((void));
411090075Sobrienextern tree begin_while_stmt                    PARAMS ((void));
411190075Sobrienextern void finish_while_stmt_cond              PARAMS ((tree, tree));
411290075Sobrienextern void finish_while_stmt                   PARAMS ((tree));
411390075Sobrienextern tree begin_do_stmt                       PARAMS ((void));
411490075Sobrienextern void finish_do_body                      PARAMS ((tree));
411590075Sobrienextern void finish_do_stmt                      PARAMS ((tree, tree));
411690075Sobrienextern tree finish_return_stmt                  PARAMS ((tree));
411790075Sobrienextern tree begin_for_stmt                      PARAMS ((void));
411890075Sobrienextern void finish_for_init_stmt                PARAMS ((tree));
411990075Sobrienextern void finish_for_cond                     PARAMS ((tree, tree));
412090075Sobrienextern void finish_for_expr                     PARAMS ((tree, tree));
412190075Sobrienextern void finish_for_stmt                     PARAMS ((tree));
412290075Sobrienextern tree finish_break_stmt                   PARAMS ((void));
412390075Sobrienextern tree finish_continue_stmt                PARAMS ((void));
412490075Sobrienextern tree begin_switch_stmt                   PARAMS ((void));
412590075Sobrienextern void finish_switch_cond                  PARAMS ((tree, tree));
412690075Sobrienextern void finish_switch_stmt                  PARAMS ((tree));
412790075Sobrienextern tree finish_case_label                   PARAMS ((tree, tree));
412890075Sobrienextern tree finish_goto_stmt                    PARAMS ((tree));
412990075Sobrienextern tree begin_try_block                     PARAMS ((void));
413090075Sobrienextern void finish_try_block                    PARAMS ((tree));
413190075Sobrienextern tree begin_eh_spec_block			PARAMS ((void));
413290075Sobrienextern void finish_eh_spec_block		PARAMS ((tree, tree));
413390075Sobrienextern void finish_handler_sequence             PARAMS ((tree));
413490075Sobrienextern tree begin_function_try_block            PARAMS ((void));
413590075Sobrienextern void finish_function_try_block           PARAMS ((tree));
413690075Sobrienextern void finish_function_handler_sequence    PARAMS ((tree));
413790075Sobrienextern void finish_cleanup_try_block            PARAMS ((tree));
413890075Sobrienextern tree begin_handler                       PARAMS ((void));
413990075Sobrienextern void finish_handler_parms                PARAMS ((tree, tree));
414090075Sobrienextern void begin_catch_block                   PARAMS ((tree));
414190075Sobrienextern void finish_handler                      PARAMS ((tree));
414290075Sobrienextern void finish_cleanup                      PARAMS ((tree, tree));
414390075Sobrienextern tree begin_compound_stmt                 PARAMS ((int));
414490075Sobrienextern tree finish_compound_stmt                PARAMS ((int, tree));
414590075Sobrienextern tree finish_asm_stmt                     PARAMS ((tree, tree, tree, tree, tree));
414690075Sobrienextern void finish_label_stmt                   PARAMS ((tree));
414790075Sobrienextern void finish_label_decl                   PARAMS ((tree));
414890075Sobrienextern void finish_subobject                    PARAMS ((tree));
414990075Sobrienextern tree finish_parenthesized_expr           PARAMS ((tree));
415090075Sobrienextern tree begin_stmt_expr                     PARAMS ((void));
415190075Sobrienextern tree finish_stmt_expr                    PARAMS ((tree));
415290075Sobrienextern tree finish_call_expr                    PARAMS ((tree, tree, int));
415390075Sobrienextern tree finish_increment_expr               PARAMS ((tree, enum tree_code));
415490075Sobrienextern tree finish_this_expr                    PARAMS ((void));
415590075Sobrienextern tree finish_object_call_expr             PARAMS ((tree, tree, tree));
415690075Sobrienextern tree finish_qualified_object_call_expr   PARAMS ((tree, tree, tree));
415790075Sobrienextern tree finish_pseudo_destructor_call_expr  PARAMS ((tree, tree, tree));
415890075Sobrienextern tree finish_qualified_call_expr          PARAMS ((tree, tree));
415990075Sobrienextern tree finish_unary_op_expr                PARAMS ((enum tree_code, tree));
416090075Sobrienextern tree finish_id_expr                      PARAMS ((tree));
416190075Sobrienextern void save_type_access_control		PARAMS ((tree));
416296263Sobrienextern void reset_type_access_control           PARAMS ((void));
416390075Sobrienextern void decl_type_access_control		PARAMS ((tree));
416490075Sobrienextern int begin_function_definition            PARAMS ((tree, tree));
416590075Sobrienextern tree begin_constructor_declarator        PARAMS ((tree, tree));
416690075Sobrienextern tree finish_declarator                   PARAMS ((tree, tree, tree, tree, int));
416790075Sobrienextern void finish_translation_unit             PARAMS ((void));
416890075Sobrienextern tree finish_template_type_parm           PARAMS ((tree, tree));
416990075Sobrienextern tree finish_template_template_parm       PARAMS ((tree, tree));
417090075Sobrienextern tree finish_parmlist                     PARAMS ((tree, int));
417190075Sobrienextern tree begin_class_definition              PARAMS ((tree));
417290075Sobrienextern tree finish_class_definition             PARAMS ((tree, tree, int, int));
417390075Sobrienextern void finish_default_args                 PARAMS ((void));
417490075Sobrienextern void begin_inline_definitions            PARAMS ((void));
417590075Sobrienextern void finish_inline_definitions           PARAMS ((void));
417690075Sobrienextern tree finish_member_class_template        PARAMS ((tree));
417790075Sobrienextern void finish_template_decl                PARAMS ((tree));
417890075Sobrienextern tree finish_template_type                PARAMS ((tree, tree, int));
417990075Sobrienextern void enter_scope_of                      PARAMS ((tree));
418090075Sobrienextern tree finish_base_specifier               PARAMS ((tree, tree));
418190075Sobrienextern void finish_member_declaration           PARAMS ((tree));
418290075Sobrienextern void check_multiple_declarators          PARAMS ((void));
418390075Sobrienextern tree finish_typeof			PARAMS ((tree));
418490075Sobrienextern tree finish_sizeof			PARAMS ((tree));
418590075Sobrienextern tree finish_alignof			PARAMS ((tree));
418690075Sobrienextern void finish_decl_cleanup                 PARAMS ((tree, tree));
418790075Sobrienextern void finish_named_return_value           PARAMS ((tree, tree));
418890075Sobrienextern void expand_body                         PARAMS ((tree));
418990075Sobrienextern tree nullify_returns_r		      PARAMS ((tree *, int *, void *));
419090075Sobrienextern void do_pushlevel                        PARAMS ((void));
419190075Sobrienextern tree do_poplevel                         PARAMS ((void));
419290075Sobrienextern void finish_mem_initializers             PARAMS ((tree));
419390075Sobrienextern void setup_vtbl_ptr			PARAMS ((tree, tree));
419490075Sobrienextern void clear_out_block                     PARAMS ((void));
419590075Sobrienextern tree begin_global_stmt_expr              PARAMS ((void));
419690075Sobrienextern tree finish_global_stmt_expr             PARAMS ((tree));
419750397Sobrien
419818334Speter
419918334Speter/* in spew.c */
420090075Sobrienextern void init_spew				PARAMS ((void));
420190075Sobrienextern void mark_pending_inlines		PARAMS ((PTR));
420290075Sobrienextern int peekyylex				PARAMS ((void));
420390075Sobrienextern tree arbitrate_lookup			PARAMS ((tree, tree, tree));
420490075Sobrienextern tree frob_opname                         PARAMS ((tree));
420590075Sobrienextern void maybe_snarf_defarg			PARAMS ((void));
420690075Sobrienextern void add_defarg_fn			PARAMS ((tree));
420790075Sobrienextern void do_pending_defargs			PARAMS ((void));
420890075Sobrienextern void done_pending_defargs		PARAMS ((void));
420990075Sobrienextern void unprocessed_defarg_fn               PARAMS ((tree));
421090075Sobrienextern void replace_defarg			PARAMS ((tree, tree));
421190075Sobrienextern void end_input				PARAMS ((void));
421218334Speter
421318334Speter/* in tree.c */
421490075Sobrienextern void init_tree			        PARAMS ((void));
421590075Sobrienextern int pod_type_p				PARAMS ((tree));
4216102780Skanextern int zero_init_p				PARAMS ((tree));
421790075Sobrienextern tree canonical_type_variant              PARAMS ((tree));
421890075Sobrienextern void unshare_base_binfos			PARAMS ((tree));
421990075Sobrienextern int member_p				PARAMS ((tree));
422090075Sobrienextern cp_lvalue_kind real_lvalue_p		PARAMS ((tree));
422190075Sobrienextern tree build_min				PARAMS ((enum tree_code, tree, ...));
422290075Sobrienextern tree build_min_nt			PARAMS ((enum tree_code, ...));
422390075Sobrienextern tree build_cplus_new			PARAMS ((tree, tree));
422490075Sobrienextern tree get_target_expr			PARAMS ((tree));
422590075Sobrienextern tree break_out_calls			PARAMS ((tree));
422690075Sobrienextern tree build_cplus_method_type		PARAMS ((tree, tree, tree));
422790075Sobrienextern tree build_cplus_staticfn_type		PARAMS ((tree, tree, tree));
422890075Sobrienextern tree build_cplus_array_type		PARAMS ((tree, tree));
422990075Sobrienextern tree hash_tree_cons			PARAMS ((tree, tree, tree));
423090075Sobrienextern tree hash_tree_chain			PARAMS ((tree, tree));
423190075Sobrienextern tree hash_chainon			PARAMS ((tree, tree));
423290075Sobrienextern tree make_binfo				PARAMS ((tree, tree, tree, tree));
423390075Sobrienextern tree reverse_path			PARAMS ((tree));
423490075Sobrienextern int count_functions			PARAMS ((tree));
423590075Sobrienextern int is_overloaded_fn			PARAMS ((tree));
423690075Sobrienextern tree get_first_fn			PARAMS ((tree));
423790075Sobrienextern int bound_pmf_p				PARAMS ((tree));
423890075Sobrienextern tree ovl_cons                            PARAMS ((tree, tree));
423990075Sobrienextern tree build_overload                      PARAMS ((tree, tree));
424090075Sobrienextern tree function_arg_chain			PARAMS ((tree));
424190075Sobrienextern int promotes_to_aggr_type		PARAMS ((tree, enum tree_code));
424290075Sobrienextern int is_aggr_type_2			PARAMS ((tree, tree));
424390075Sobrienextern const char *lang_printable_name		PARAMS ((tree, int));
424490075Sobrienextern tree build_exception_variant		PARAMS ((tree, tree));
424590075Sobrienextern tree bind_template_template_parm		PARAMS ((tree, tree));
424690075Sobrienextern tree array_type_nelts_total		PARAMS ((tree));
424790075Sobrienextern tree array_type_nelts_top		PARAMS ((tree));
424890075Sobrienextern tree break_out_target_exprs		PARAMS ((tree));
424990075Sobrienextern tree get_type_decl			PARAMS ((tree));
425090075Sobrienextern tree vec_binfo_member			PARAMS ((tree, tree));
425190075Sobrienextern tree decl_namespace_context		PARAMS ((tree));
425290075Sobrienextern tree lvalue_type				PARAMS ((tree));
425390075Sobrienextern tree error_type				PARAMS ((tree));
425490075Sobrienextern tree build_ptr_wrapper			PARAMS ((void *));
425590075Sobrienextern tree build_int_wrapper			PARAMS ((int));
425690075Sobrienextern tree build_srcloc_here			PARAMS ((void));
425790075Sobrienextern int varargs_function_p			PARAMS ((tree));
425890075Sobrienextern int really_overloaded_fn			PARAMS ((tree));
425990075Sobrienextern int cp_tree_equal			PARAMS ((tree, tree));
426090075Sobrienextern tree no_linkage_check			PARAMS ((tree));
426190075Sobrienextern void debug_binfo				PARAMS ((tree));
426290075Sobrienextern tree build_dummy_object			PARAMS ((tree));
426390075Sobrienextern tree maybe_dummy_object			PARAMS ((tree, tree *));
426490075Sobrienextern int is_dummy_object			PARAMS ((tree));
426590075Sobrienextern const struct attribute_spec cp_attribute_table[];
426690075Sobrienextern tree make_ptrmem_cst                     PARAMS ((tree, tree));
426796263Sobrienextern tree cp_build_qualified_type_real        PARAMS ((tree, int, tsubst_flags_t));
426890075Sobrien#define cp_build_qualified_type(TYPE, QUALS) \
426996263Sobrien  cp_build_qualified_type_real ((TYPE), (QUALS), tf_error | tf_warning)
427090075Sobrienextern tree build_shared_int_cst                PARAMS ((int));
427190075Sobrienextern special_function_kind special_function_p PARAMS ((tree));
427290075Sobrienextern int count_trees                          PARAMS ((tree));
427390075Sobrienextern int char_type_p                          PARAMS ((tree));
427490075Sobrienextern void verify_stmt_tree                    PARAMS ((tree));
427590075Sobrienextern tree find_tree                           PARAMS ((tree, tree));
427690075Sobrienextern linkage_kind decl_linkage                PARAMS ((tree));
427790075Sobrienextern tree cp_walk_subtrees PARAMS ((tree*, int*, walk_tree_fn,
427890075Sobrien				      void*, void*));
427990075Sobrienextern int cp_cannot_inline_tree_fn PARAMS ((tree*));
428090075Sobrienextern tree cp_add_pending_fn_decls PARAMS ((void*,tree));
428190075Sobrienextern int cp_is_overload_p PARAMS ((tree));
428290075Sobrienextern int cp_auto_var_in_fn_p PARAMS ((tree,tree));
428390075Sobrienextern tree cp_copy_res_decl_for_inlining PARAMS ((tree, tree, tree, void*,
428490075Sobrien						   int*, void*));
428590075Sobrienextern int cp_start_inlining			PARAMS ((tree));
428690075Sobrienextern void cp_end_inlining			PARAMS ((tree));
428752284Sobrien
428818334Speter/* in typeck.c */
428990075Sobrienextern int string_conv_p			PARAMS ((tree, tree, int));
429090075Sobrienextern tree cp_truthvalue_conversion		PARAMS ((tree));
429190075Sobrienextern tree condition_conversion		PARAMS ((tree));
429290075Sobrienextern tree target_type				PARAMS ((tree));
429390075Sobrienextern tree require_complete_type		PARAMS ((tree));
429490075Sobrienextern tree complete_type			PARAMS ((tree));
429590075Sobrienextern tree complete_type_or_else               PARAMS ((tree, tree));
429690075Sobrienextern int type_unknown_p			PARAMS ((tree));
429790075Sobrienextern tree commonparms				PARAMS ((tree, tree));
429890075Sobrienextern tree original_type			PARAMS ((tree));
429990075Sobrienextern int comp_except_specs			PARAMS ((tree, tree, int));
430090075Sobrienextern int comptypes				PARAMS ((tree, tree, int));
430190075Sobrienextern int comp_target_types			PARAMS ((tree, tree, int));
430290075Sobrienextern int compparms				PARAMS ((tree, tree));
430390075Sobrienextern int comp_cv_qualification                PARAMS ((tree, tree));
430490075Sobrienextern int comp_cv_qual_signature               PARAMS ((tree, tree));
430590075Sobrienextern tree expr_sizeof				PARAMS ((tree));
430690075Sobrienextern tree c_sizeof_nowarn			PARAMS ((tree));
430790075Sobrienextern tree inline_conversion			PARAMS ((tree));
430890075Sobrienextern tree decay_conversion			PARAMS ((tree));
430990075Sobrienextern tree build_object_ref			PARAMS ((tree, tree, tree));
431090075Sobrienextern tree build_component_ref_1		PARAMS ((tree, tree, int));
431190075Sobrienextern tree build_component_ref			PARAMS ((tree, tree, tree, int));
431290075Sobrienextern tree build_x_component_ref		PARAMS ((tree, tree, tree, int));
431390075Sobrienextern tree build_x_indirect_ref		PARAMS ((tree, const char *));
431490075Sobrienextern tree build_indirect_ref			PARAMS ((tree, const char *));
431590075Sobrienextern tree build_array_ref			PARAMS ((tree, tree));
431690075Sobrienextern tree build_x_function_call		PARAMS ((tree, tree, tree));
431790075Sobrienextern tree get_member_function_from_ptrfunc	PARAMS ((tree *, tree));
431890075Sobrienextern tree build_function_call_real		PARAMS ((tree, tree, int, int));
431990075Sobrienextern tree build_function_call_maybe		PARAMS ((tree, tree));
432090075Sobrienextern tree convert_arguments			PARAMS ((tree, tree, tree, int));
432190075Sobrienextern tree build_x_binary_op			PARAMS ((enum tree_code, tree, tree));
432290075Sobrienextern tree build_x_unary_op			PARAMS ((enum tree_code, tree));
432390075Sobrienextern tree unary_complex_lvalue		PARAMS ((enum tree_code, tree));
432490075Sobrienextern tree build_x_conditional_expr		PARAMS ((tree, tree, tree));
432590075Sobrienextern tree build_x_compound_expr		PARAMS ((tree));
432690075Sobrienextern tree build_compound_expr			PARAMS ((tree));
432790075Sobrienextern tree build_static_cast			PARAMS ((tree, tree));
432890075Sobrienextern tree build_reinterpret_cast		PARAMS ((tree, tree));
432990075Sobrienextern tree build_const_cast			PARAMS ((tree, tree));
433090075Sobrienextern tree build_c_cast			PARAMS ((tree, tree));
433190075Sobrienextern tree build_x_modify_expr			PARAMS ((tree, enum tree_code, tree));
433290075Sobrienextern tree build_modify_expr			PARAMS ((tree, enum tree_code, tree));
433390075Sobrienextern tree dubious_conversion_warnings         PARAMS ((tree, tree, const char *, tree, int));
433490075Sobrienextern tree convert_for_initialization		PARAMS ((tree, tree, tree, int, const char *, tree, int));
433590075Sobrienextern int comp_ptr_ttypes			PARAMS ((tree, tree));
433690075Sobrienextern int ptr_reasonably_similar		PARAMS ((tree, tree));
433790075Sobrienextern tree build_ptrmemfunc			PARAMS ((tree, tree, int));
433890075Sobrienextern int cp_type_quals                        PARAMS ((tree));
433990075Sobrienextern int cp_has_mutable_p                     PARAMS ((tree));
434090075Sobrienextern int at_least_as_qualified_p              PARAMS ((tree, tree));
434190075Sobrienextern int more_qualified_p                     PARAMS ((tree, tree));
434290075Sobrienextern tree build_ptrmemfunc1                   PARAMS ((tree, tree, tree));
434390075Sobrienextern void expand_ptrmemfunc_cst               PARAMS ((tree, tree *, tree *));
434490075Sobrienextern tree pfn_from_ptrmemfunc                 PARAMS ((tree));
434590075Sobrienextern tree type_after_usual_arithmetic_conversions PARAMS ((tree, tree));
434690075Sobrienextern tree composite_pointer_type              PARAMS ((tree, tree, tree, tree,
434790075Sobrien						       const char*));
434896263Sobrienextern tree merge_types				PARAMS ((tree, tree));
434990075Sobrienextern tree check_return_expr                   PARAMS ((tree));
435090075Sobrien#define cp_build_binary_op(code, arg1, arg2) \
435190075Sobrien  build_binary_op(code, arg1, arg2, 1)
435218334Speter
435318334Speter/* in typeck2.c */
435490075Sobrienextern tree error_not_base_type			PARAMS ((tree, tree));
435590075Sobrienextern tree binfo_or_else			PARAMS ((tree, tree));
435690075Sobrienextern void readonly_error			PARAMS ((tree, const char *, int));
435790075Sobrienextern int abstract_virtuals_error		PARAMS ((tree, tree));
435818334Speter
435990075Sobrien#define my_friendly_assert(EXP, N) (void) \
436090075Sobrien (((EXP) == 0) ? (fancy_abort (__FILE__, __LINE__, __FUNCTION__), 0) : 0)
436190075Sobrien
4362102780Skanextern tree force_store_init_value		PARAMS ((tree, tree));
436390075Sobrienextern tree store_init_value			PARAMS ((tree, tree));
436490075Sobrienextern tree digest_init				PARAMS ((tree, tree, tree *));
436590075Sobrienextern tree build_scoped_ref			PARAMS ((tree, tree));
436690075Sobrienextern tree build_x_arrow			PARAMS ((tree));
436790075Sobrienextern tree build_m_component_ref		PARAMS ((tree, tree));
436890075Sobrienextern tree build_functional_cast		PARAMS ((tree, tree));
436990075Sobrienextern void check_for_new_type			PARAMS ((const char *, flagged_type_tree));
437090075Sobrienextern tree add_exception_specifier             PARAMS ((tree, tree, int));
437190075Sobrienextern tree merge_exception_specifiers          PARAMS ((tree, tree));
437290075Sobrien
437390075Sobrien/* in mangle.c */
437490075Sobrienextern void init_mangle                         PARAMS ((void));
437590075Sobrienextern void mangle_decl                         PARAMS ((tree));
437690075Sobrienextern const char *mangle_type_string           PARAMS ((tree));
437790075Sobrienextern tree mangle_type                         PARAMS ((tree));
437890075Sobrienextern tree mangle_typeinfo_for_type            PARAMS ((tree));
437990075Sobrienextern tree mangle_typeinfo_string_for_type     PARAMS ((tree));
438090075Sobrienextern tree mangle_vtbl_for_type                PARAMS ((tree));
438190075Sobrienextern tree mangle_vtt_for_type                 PARAMS ((tree));
438290075Sobrienextern tree mangle_ctor_vtbl_for_type           PARAMS ((tree, tree));
438390075Sobrienextern tree mangle_thunk                        PARAMS ((tree, tree, tree));
438490075Sobrienextern tree mangle_conv_op_name_for_type        PARAMS ((tree));
438590075Sobrienextern tree mangle_guard_variable               PARAMS ((tree));
438690075Sobrienextern tree mangle_ref_init_variable            PARAMS ((tree));
438790075Sobrien
438890075Sobrien/* in dump.c */
438990075Sobrienextern int cp_dump_tree                         PARAMS ((void *, tree));
439090075Sobrien
439118334Speter/* -- end of C++ */
439218334Speter
439390075Sobrien#endif /* ! GCC_CP_TREE_H */
4394