the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#include "c-common.h"
#include "function.h"
+#include "hashtab.h"
#include "splay-tree.h"
#include "varray.h"
#ifndef _CP_TREE_H
#define _CP_TREE_H
+#include "c-common.h"
+
/* Usage of TREE_LANG_FLAG_?:
0: BINFO_MARKED (BINFO nodes).
- COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT).
+ IDENTIFIER_MARKED (IDENTIFIER_NODEs)
NEW_EXPR_USE_GLOBAL (in NEW_EXPR).
DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR).
LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR).
- TREE_NEGATED_INT (in INTEGER_CST).
TREE_INDIRECT_USING (in NAMESPACE_DECL).
- IDENTIFIER_MARKED (used by search routines).
LOCAL_BINDING_P (in CPLUS_BINDING)
ICS_USER_FLAG (in _CONV)
CLEANUP_P (in TRY_BLOCK)
AGGR_INIT_VIA_CTOR_P (in AGGR_INIT_EXPR)
- SCOPE_BEGIN_P (in SCOPE_STMT)
CTOR_BEGIN_P (in CTOR_STMT)
- DECL_PRETTY_FUNCTION_P (in VAR_DECL)
+ BV_USE_VCALL_INDEX_P (in the BINFO_VIRTUALS TREE_LIST)
+ PTRMEM_OK_P (in ADDR_EXPR, OFFSET_REF)
1: IDENTIFIER_VIRTUAL_P.
TI_PENDING_TEMPLATE_FLAG.
TEMPLATE_PARMS_FOR_INLINE.
DELETE_EXPR_USE_VEC (in DELETE_EXPR).
(TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out).
TYPE_BASE_CONVS_MAY_REQUIRE_CODE_P (in _TYPE).
- C_DECLARED_LABEL_FLAG (in LABEL_DECL)
INHERITED_VALUE_BINDING_P (in CPLUS_BINDING)
BASELINK_P (in TREE_LIST)
ICS_ELLIPSIS_FLAG (in _CONV)
- STMT_IS_FULL_EXPR_P (in _STMT)
+ BINFO_ACCESS (in BINFO)
+ BV_GENERATE_THUNK_WITH_VTABLE_P (in TREE_LIST)
2: IDENTIFIER_OPNAME_P.
TYPE_POLYMORHPIC_P (in _TYPE)
ICS_THIS_FLAG (in _CONV)
- STMT_LINENO_FOR_FN_P (in _STMT)
BINDING_HAS_LEVEL_P (in CPLUS_BINDING)
+ BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P (in BINFO)
3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE).
BINFO_VTABLE_PATH_MARKED.
BINFO_PUSHDECLS_MARKED.
(TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out).
ICS_BAD_FLAG (in _CONV)
FN_TRY_BLOCK_P (in TRY_BLOCK)
- SCOPE_NO_CLEANUPS_P (in SCOPE_STMT)
IDENTIFIER_CTOR_OR_DTOR_P (in IDENTIFIER_NODE)
4: BINFO_NEW_VTABLE_MARKED.
TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR,
or FIELD_DECL).
NEED_TEMPORARY_P (in REF_BIND, BASE_CONV)
- SCOPE_PARTIAL_P (in SCOPE_STMT)
IDENTIFIER_TYPENAME_P (in IDENTIFIER_NODE)
- 5: BINFO_PRIMARY_MARKED_P (in BINFO)
- 6: BINFO_VBASE_PRIMARY_P (in BINFO)
+ 5: C_IS_RESERVED_WORD (in IDENTIFIER_NODE)
+ 6: BINFO_ACCESS (in BINFO)
Usage of TYPE_LANG_FLAG_?:
0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE).
5: DECL_INTERFACE_KNOWN.
6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL).
7: DECL_DEAD_FOR_LOCAL (in VAR_DECL).
+ DECL_THUNK_P (in a member FUNCTION_DECL)
Usage of language-independent fields in a language-dependent manner:
-
+
+ TREE_USED
+ This field is BINFO_INDIRECT_PRIMARY_P in a BINFO.
+
TYPE_ALIAS_SET
This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so
forth as a substitute for the mark bits provided in `lang_type'.
TYPE_BINFO
For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO.
For a TYPENAME_TYPE, this is TYPENAME_TYPE_FULLNAME.
- For a TEMPLATE_TEMPLATE_PARM, this is
- TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
+ For a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM,
+ this is TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
BINFO_VIRTUALS
For a binfo, this is a TREE_LIST. The BV_DELTA of each node
the this pointer points to an object of the base class.
The BV_VCALL_INDEX of each node, if non-NULL, gives the vtable
- index of the vcall offset for this entry.
+ index of the vcall offset for this entry. If
+ BV_USE_VCALL_INDEX_P then the corresponding vtable entry should
+ use a virtual thunk, as opposed to an ordinary thunk.
The BV_FN is the declaration for the virtual function itself.
When CLASSTYPE_COM_INTERFACE_P does not hold, the first entry
in both ABIs.
DECL_ARGUMENTS
- For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
+ For a VAR_DECL this is DECL_ANON_UNION_ELEMS.
DECL_VINDEX
This field is NULL for a non-virtual function. For a virtual
a virtual function is declared, but before it is known what
function is overriden, this field is the error_mark_node.
- Temporarily, it may be set to a TREE_LIST whose TREE_VALUE is
+ Temporarily, it may be set to a TREE_LIST whose TREE_VALUE is
the virtual function this one overrides, and whose TREE_CHAIN is
the old DECL_VINDEX. */
({ const tree __t = NODE; \
enum tree_code __c = TREE_CODE(__t); \
if (__c != VAR_DECL && __c != FUNCTION_DECL) \
- tree_check_failed (__t, VAR_DECL, __FILE__, \
- __LINE__, __PRETTY_FUNCTION__); \
+ tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
+ __FUNCTION__); \
__t; })
#define VAR_FUNCTION_OR_PARM_DECL_CHECK(NODE) \
({ const tree __t = NODE; \
enum tree_code __c = TREE_CODE(__t); \
- if (__c != VAR_DECL \
- && __c != FUNCTION_DECL \
+ if (__c != VAR_DECL \
+ && __c != FUNCTION_DECL \
&& __c != PARM_DECL) \
- tree_check_failed (__t, VAR_DECL, __FILE__, \
- __LINE__, __PRETTY_FUNCTION__); \
+ tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
+ __FUNCTION__); \
__t; })
#define VAR_TEMPL_TYPE_OR_FUNCTION_DECL_CHECK(NODE) \
({ const tree __t = NODE; \
enum tree_code __c = TREE_CODE(__t); \
- if (__c != VAR_DECL \
+ if (__c != VAR_DECL \
&& __c != FUNCTION_DECL \
&& __c != TYPE_DECL \
&& __c != TEMPLATE_DECL) \
- tree_check_failed (__t, VAR_DECL, __FILE__, \
- __LINE__, __PRETTY_FUNCTION__); \
+ tree_check_failed (__t, VAR_DECL, __FILE__, __LINE__, \
+ __FUNCTION__); \
__t; })
#define RECORD_OR_UNION_TYPE_CHECK(NODE) \
({ const tree __t = NODE; \
enum tree_code __c = TREE_CODE(__t); \
if (__c != RECORD_TYPE && __c != UNION_TYPE) \
- tree_check_failed (__t, RECORD_TYPE, __FILE__, \
- __LINE__, __PRETTY_FUNCTION__); \
+ tree_check_failed (__t, RECORD_TYPE, __FILE__, __LINE__, \
+ __FUNCTION__); \
__t; })
#else /* not ENABLE_TREE_CHECKING, or not gcc */
#define RECORD_OR_UNION_TYPE_CHECK(NODE) NODE
#endif
+
\f
/* ABI control. */
tree class_value;
tree class_template_info;
struct lang_id2 *x;
+ enum rid rid_code;
};
+/* In an IDENTIFIER_NODE, nonzero if this identifier is actually a
+ keyword. C_RID_CODE (node) is then the RID_* value of the keyword,
+ and C_RID_YYCODE is the token number wanted by Yacc. */
+
+#define C_IS_RESERVED_WORD(id) TREE_LANG_FLAG_5 (id)
+#define C_RID_CODE(id) \
+ (((struct lang_identifier *) (id))->rid_code)
+
+extern const short rid_to_yy[RID_MAX];
+#define C_RID_YYCODE(id) \
+ rid_to_yy[((struct lang_identifier *) (id))->rid_code]
+
#define LANG_IDENTIFIER_CAST(NODE) \
((struct lang_identifier*)IDENTIFIER_NODE_CHECK (NODE))
tree error_locus;
};
-typedef struct
+typedef struct
{
tree t;
int new_type_flag;
tree lookups;
} flagged_type_tree;
-typedef struct
+typedef struct
{
- char common[sizeof (struct tree_common)];
+ struct tree_common common;
HOST_WIDE_INT index;
HOST_WIDE_INT level;
HOST_WIDE_INT orig_level;
typedef struct ptrmem_cst
{
- char common[sizeof (struct tree_common)];
- /* This isn't used, but the middle-end expects all constants to have
+ struct tree_common common;
+ /* This isn't used, but the middle-end expects all constants to have
this field. */
struct rtx_def *rtl;
tree member;
#define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \
set_namespace_binding (NODE, current_namespace, VAL)
+#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
+#define CLEANUP_DECL(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0)
+#define CLEANUP_EXPR(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1)
+
+/* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual
+ sense of `same'. */
+#define same_type_p(type1, type2) \
+ comptypes ((type1), (type2), COMPARE_STRICT)
+
+/* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring
+ top-level qualifiers. */
+#define same_type_ignoring_top_level_qualifiers_p(type1, type2) \
+ same_type_p (TYPE_MAIN_VARIANT (type1), TYPE_MAIN_VARIANT (type2))
+
+/* Non-zero if we are presently building a statement tree, rather
+ than expanding each statement as we encounter it. */
+#define building_stmt_tree() (last_tree != NULL_TREE)
+
+/* Returns non-zero iff NODE is a declaration for the global function
+ `main'. */
+#define DECL_MAIN_P(NODE) \
+ (DECL_EXTERN_C_FUNCTION_P (NODE) \
+ && DECL_NAME (NODE) != NULL_TREE \
+ && MAIN_NAME_P (DECL_NAME (NODE)))
+
+
struct tree_binding
{
- char common[sizeof (struct tree_common)];
+ struct tree_common common;
union {
tree scope;
struct binding_level *level;
struct tree_overload
{
- char common[sizeof (struct tree_common)];
+ struct tree_common common;
tree function;
};
struct tree_wrapper
{
- char common[sizeof (struct tree_common)];
+ struct tree_common common;
union {
void *ptr;
int i;
#define SRCLOC_LINE(NODE) (((struct tree_srcloc*)SRCLOC_CHECK (NODE))->linenum)
struct tree_srcloc
{
- char common[sizeof (struct tree_common)];
+ struct tree_common common;
const char *filename;
int linenum;
};
/* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or
NULL_TREE if there is no binding. */
#define IDENTIFIER_VALUE(NODE) \
- (IDENTIFIER_BINDING (NODE) \
+ (IDENTIFIER_BINDING (NODE) \
? BINDING_VALUE (IDENTIFIER_BINDING (NODE)) \
: NULL_TREE)
#define IDENTIFIER_CLASS_VALUE(NODE) \
(LANG_IDENTIFIER_CAST (NODE)->class_value)
-/* The amount of time used by the file whose special "time identifier"
- is NODE, represented as an INTEGER_CST. See get_time_identifier. */
-#define TIME_IDENTIFIER_TIME(NODE) IDENTIFIER_BINDING(NODE)
-
-/* For a "time identifier" this is a INTEGER_CST. The
- TREE_INT_CST_LOW is 1 if the corresponding file is "interface only".
- The TRE_INT_CST_HIGH is 1 if it is "interface unknown". */
-#define TIME_IDENTIFIER_FILEINFO(NODE) IDENTIFIER_CLASS_VALUE (NODE)
-
/* TREE_TYPE only indicates on local and class scope the current
type. For namespace scope, the presence of a type in any namespace
is indicated with global_type_node, and the real type behind must
#define LANG_ID_FIELD(NAME,NODE) \
(LANG_IDENTIFIER_CAST (NODE)->x \
- ? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)
+ ? LANG_IDENTIFIER_CAST (NODE)->x->NAME : 0)
#define SET_LANG_ID(NODE,VALUE,NAME) \
(LANG_IDENTIFIER_CAST (NODE)->x == 0 \
CPTI_JAVA_CHAR_TYPE,
CPTI_JAVA_BOOLEAN_TYPE,
- CPTI_VOID_ZERO,
CPTI_WCHAR_DECL,
CPTI_VTABLE_ENTRY_TYPE,
CPTI_DELTA_TYPE,
CPTI_VTABLE_INDEX_TYPE,
CPTI_CLEANUP_TYPE,
+ CPTI_VTT_PARM_TYPE,
CPTI_TI_DESC_TYPE,
CPTI_BLTN_DESC_TYPE,
CPTI_CLASS_DESC_TYPE,
CPTI_SI_CLASS_DESC_TYPE,
CPTI_VMI_CLASS_DESC_TYPE,
- CPTI_PTMD_DESC_TYPE,
+ CPTI_PTM_DESC_TYPE,
CPTI_BASE_DESC_TYPE,
-
+
CPTI_CLASS_TYPE,
CPTI_RECORD_TYPE,
CPTI_UNION_TYPE,
CPTI_TINFO_VAR_ID,
CPTI_ABORT_FNDECL,
CPTI_GLOBAL_DELETE_FNDECL,
+ CPTI_AGGR_TAG,
CPTI_ACCESS_DEFAULT,
CPTI_ACCESS_PUBLIC,
CPTI_DELTA2_IDENTIFIER,
CPTI_DELTA_IDENTIFIER,
CPTI_IN_CHARGE_IDENTIFIER,
+ CPTI_VTT_PARM_IDENTIFIER,
CPTI_INDEX_IDENTIFIER,
CPTI_NELTS_IDENTIFIER,
CPTI_THIS_IDENTIFIER,
CPTI_PFN_OR_DELTA2_IDENTIFIER,
CPTI_VPTR_IDENTIFIER,
CPTI_PUSH_EXCEPTION_IDENTIFIER,
+ CPTI_STD_IDENTIFIER,
CPTI_LANG_NAME_C,
CPTI_LANG_NAME_CPLUSPLUS,
#define java_char_type_node cp_global_trees[CPTI_JAVA_CHAR_TYPE]
#define java_boolean_type_node cp_global_trees[CPTI_JAVA_BOOLEAN_TYPE]
-#define void_zero_node cp_global_trees[CPTI_VOID_ZERO]
#define wchar_decl_node cp_global_trees[CPTI_WCHAR_DECL]
#define vtable_entry_type cp_global_trees[CPTI_VTABLE_ENTRY_TYPE]
/* The type used to represent an offset by which to adjust the `this'
#define class_desc_type_node cp_global_trees[CPTI_CLASS_DESC_TYPE]
#define si_class_desc_type_node cp_global_trees[CPTI_SI_CLASS_DESC_TYPE]
#define vmi_class_desc_type_node cp_global_trees[CPTI_VMI_CLASS_DESC_TYPE]
-#define ptmd_desc_type_node cp_global_trees[CPTI_PTMD_DESC_TYPE]
+#define ptm_desc_type_node cp_global_trees[CPTI_PTM_DESC_TYPE]
#define base_desc_type_node cp_global_trees[CPTI_BASE_DESC_TYPE]
#define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
#define tinfo_var_id cp_global_trees[CPTI_TINFO_VAR_ID]
#define abort_fndecl cp_global_trees[CPTI_ABORT_FNDECL]
#define global_delete_fndecl cp_global_trees[CPTI_GLOBAL_DELETE_FNDECL]
+#define current_aggr cp_global_trees[CPTI_AGGR_TAG]
/* Define the sets of attributes that member functions and baseclasses
can have. These are sensible combinations of {public,private,protected}
#define delta2_identifier cp_global_trees[CPTI_DELTA2_IDENTIFIER]
#define delta_identifier cp_global_trees[CPTI_DELTA_IDENTIFIER]
#define in_charge_identifier cp_global_trees[CPTI_IN_CHARGE_IDENTIFIER]
+
+/* The name of the parameter that contains a pointer to the VTT to use
+ for this subobject constructor or destructor. */
+#define vtt_parm_identifier cp_global_trees[CPTI_VTT_PARM_IDENTIFIER]
+
#define index_identifier cp_global_trees[CPTI_INDEX_IDENTIFIER]
#define nelts_identifier cp_global_trees[CPTI_NELTS_IDENTIFIER]
#define this_identifier cp_global_trees[CPTI_THIS_IDENTIFIER]
/* The name of the function to call to push an exception onto the
exception stack. */
#define cp_push_exception_identifier cp_global_trees[CPTI_PUSH_EXCEPTION_IDENTIFIER]
+/* The name of the std namespace. */
+#define std_identifier cp_global_trees[CPTI_STD_IDENTIFIER]
#define lang_name_c cp_global_trees[CPTI_LANG_NAME_C]
#define lang_name_cplusplus cp_global_trees[CPTI_LANG_NAME_CPLUSPLUS]
/* The type of a destructor. */
#define cleanup_type cp_global_trees[CPTI_CLEANUP_TYPE]
-/* Global state. */
+/* The type of the vtt parameter passed to subobject constructors and
+ destructors. */
+#define vtt_parm_type cp_global_trees[CPTI_VTT_PARM_TYPE]
-struct stmt_tree {
- tree x_last_stmt;
- tree x_last_expr_type;
- int stmts_are_full_exprs_p;
-};
+/* Global state. */
struct saved_scope {
tree old_bindings;
varray_type lang_base;
tree *lang_stack;
tree lang_name;
- tree x_function_parms;
tree template_parms;
tree x_previous_class_type;
tree x_previous_class_values;
int x_processing_explicit_instantiation;
int need_pop_function_context;
- struct stmt_tree x_stmt_tree;
+ struct stmt_tree_s x_stmt_tree;
struct binding_level *class_bindings;
struct binding_level *bindings;
/* Parsing a function declarator leaves a list of parameter names
or a chain or parameter decls here. */
-#define current_function_parms scope_chain->x_function_parms
#define current_template_parms scope_chain->template_parms
#define processing_template_decl scope_chain->x_processing_template_decl
/* Global state pertinent to the current function. */
-struct language_function
+struct cp_language_function
{
- tree x_named_labels;
+ struct language_function base;
+
tree x_ctor_label;
tree x_dtor_label;
- tree x_base_init_list;
- tree x_member_init_list;
tree x_current_class_ptr;
tree x_current_class_ref;
tree x_eh_spec_try_block;
- tree x_scope_stmt_stack;
tree x_in_charge_parm;
tree *x_vcalls_possible_p;
- struct rtx_def *x_result_rtx;
-
int returns_value;
int returns_null;
- int parms_stored;
- int temp_name_counter;
int in_function_try_handler;
int x_expanding_p;
- int name_declared;
int vtbls_set_up_p;
- struct stmt_tree x_stmt_tree;
-
- struct named_label_list *x_named_label_uses;
+ struct named_label_use_list *x_named_label_uses;
+ struct named_label_list *x_named_labels;
struct binding_level *bindings;
const char *cannot_inline;
/* The current C++-specific per-function global variables. */
-#define cp_function_chain (cfun->language)
+#define cp_function_chain \
+ ((struct cp_language_function *) (cfun->language))
/* In a destructor, the point at which all derived class destroying
has been done, just before any base class destroying will be done. */
#define ctor_label cp_function_chain->x_ctor_label
-/* In C++, structures with well-defined constructors are initialized by
- those constructors, unasked. CURRENT_BASE_INIT_LIST
- holds a list of stmts for a BASE_INIT term in the grammar.
- This list has one element for each base class which must be
- initialized. The list elements are [basename, init], with
- type basetype. This allows the possibly anachronistic form
- (assuming d : a, b, c) "d (int a) : c(a+5), b (a-4), a (a+3)"
- where each successive term can be handed down the constructor
- line. Perhaps this was not intended. */
-
-#define current_base_init_list cp_function_chain->x_base_init_list
-#define current_member_init_list cp_function_chain->x_member_init_list
-
/* When we're processing a member function, current_class_ptr is the
PARM_DECL for the `this' pointer. The current_class_ref is an
expression for `*this'. */
#define current_class_ref \
(cfun ? cp_function_chain->x_current_class_ref : NULL_TREE)
-/* Information about the current statement tree. */
-
-#define current_stmt_tree \
- (cfun \
- ? &cp_function_chain->x_stmt_tree \
- : &scope_chain->x_stmt_tree)
-
-/* When building a statement-tree, this is the last statement added to
- the tree. */
-
-#define last_tree current_stmt_tree->x_last_stmt
-
-/* The type of the last expression-statement we have seen. This is
- required because the type of a statement-expression is the type of
- the last expression statement. */
-
-#define last_expr_type current_stmt_tree->x_last_expr_type
-
/* The TRY_BLOCK for the exception-specifiers for the current
function, if any. */
#define current_eh_spec_try_block cp_function_chain->x_eh_spec_try_block
-/* The stack of SCOPE_STMTs for the current function. */
-
-#define current_scope_stmt_stack cp_function_chain->x_scope_stmt_stack
-
/* The `__in_chrg' parameter for the current function. Only used for
destructors. */
#define current_function_returns_null cp_function_chain->returns_null
-#define current_function_just_assigned_this \
- cp_function_chain->just_assigned_this
-
-#define current_function_parms_stored \
- cp_function_chain->parms_stored
-
-/* One if we have already declared __FUNCTION__ (and related
- variables) in the current function. Two if we are in the process
- of doing so. */
-
-#define current_function_name_declared \
- cp_function_chain->name_declared
-
/* Nonzero if we have already generated code to initialize virtual
function tables in this function. */
#define vtbls_set_up_p cp_function_chain->vtbls_set_up_p
-/* Used to help generate temporary names which are unique within
- a function. Reset to 0 by start_function. */
-
-#define temp_name_counter cp_function_chain->temp_name_counter
-
/* Non-zero if we should generate RTL for functions that we process.
When this is zero, we just accumulate tree structure, without
interacting with the back end. */
#define doing_semantic_analysis_p() (!expanding_p)
-/* Non-zero if we should treat statements as full expressions. In
- particular, this variable is no-zero if at the end of a statement
- we should destroy any temporaries created during that statement.
- Similarly, if, at the end of a block, we should destroy any local
- variables in this block. Normally, this variable is non-zero,
- since those are the normal semantics of C++.
-
- However, in order to represent aggregate initialization code as
- tree structure, we use statement-expressions. The statements
- within the statement expression should not result in cleanups being
- run until the entire enclosing statement is complete. */
+#define in_function_try_handler cp_function_chain->in_function_try_handler
-#define stmts_are_full_exprs_p \
- current_stmt_tree->stmts_are_full_exprs_p
+/* Nonzero if __FUNCTION__ and its ilk have been declared in this
+ function. */
-#define in_function_try_handler cp_function_chain->in_function_try_handler
+#define function_name_declared_p \
+ (cp_function_chain->base.x_function_name_declared_p)
extern tree current_function_return_value;
extern tree global_namespace;
-extern tree ridpointers[];
-extern tree ansi_opname[];
-extern tree ansi_assopname[];
+#define ansi_opname(CODE) \
+ (operator_name_info[(int) (CODE)].identifier)
+#define ansi_assopname(CODE) \
+ (assignment_operator_name_info[(int) (CODE)].identifier)
/* Nonzero means `$' can be in an identifier. */
extern int flag_no_asm;
+/* Nonzero means don't recognize any extended keywords. */
+
+extern int flag_no_gnu_keywords;
+
+/* Nonzero means recognize the named operators from C++98. */
+
+extern int flag_operator_names;
+
/* For cross referencing. */
extern int flag_gnu_xref;
extern int warn_return_type;
-/* Nonzero means give string constants the type `const char *', as mandated
- by the standard. */
-
-extern int flag_const_strings;
-
/* If non-NULL, dump the tree structure for the entire translation
unit to this file. */
-extern char *flag_dump_translation_unit;
+extern const char *flag_dump_translation_unit;
/* Nonzero means warn about deprecated conversion from string constant to
`char *'. */
extern int warn_pointer_arith;
-/* Nonzero means warn about suggesting putting in ()'s. */
-
-extern int warn_parentheses;
-
/* Nonzero means warn about multiple (redundant) decls for the same single
variable or function. */
extern int warn_cast_qual;
-/* Warn about *printf or *scanf format/argument anomalies. */
-
-extern int warn_format;
-
/* Nonzero means warn about non virtual destructors in classes that have
virtual functions. */
version 0. */
extern int name_mangling_version;
-/* Nonzero means that guiding declarations are allowed. */
-extern int flag_guiding_decls;
-
/* Nonzero if wchar_t should be `unsigned short' instead of whatever it
would normally be, for use with WINE. */
extern int flag_short_wchar;
-/* Nonzero if squashed mangling is to be performed.
- This uses the B and K codes to reference previously seen class types
+/* Nonzero if squashed mangling is to be performed.
+ This uses the B and K codes to reference previously seen class types
and class qualifiers. */
extern int flag_do_squangling;
required. */
extern int flag_optional_diags;
-/* Nonzero means do not consider empty argument prototype to mean function
- takes no arguments. */
-extern int flag_strict_prototype;
-
/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */
extern int flag_vtable_gc;
extern int flag_access_control;
+/* Nonzero if we want to check the return value of new and avoid calling
+ constructors if it is a null pointer. */
+
+extern int flag_check_new;
+
/* If this variable is defined to a non-NULL value, it will be called
after the file has been completely parsed. The argument will be
the GLOBAL_NAMESPACE. */
/* C++ language-specific tree codes. */
#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM,
enum cplus_tree_code {
- __DUMMY = LAST_AND_UNUSED_TREE_CODE,
+ CP_DUMMY_TREE_CODE = LAST_C_TREE_CODE,
#include "cp-tree.def"
LAST_CPLUS_TREE_CODE
};
(TREE_CODE (t) == TEMPLATE_TYPE_PARM \
|| TREE_CODE (t) == TYPENAME_TYPE \
|| TREE_CODE (t) == TYPEOF_TYPE \
- || (TREE_CODE (t) == TEMPLATE_TEMPLATE_PARM \
- && TYPE_TEMPLATE_INFO (t)) \
+ || TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM \
|| TYPE_LANG_FLAG_5 (t))
-/* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
- union type. */
+/* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or
+ union type. */
#define SET_IS_AGGR_TYPE(T, VAL) \
(TYPE_LANG_FLAG_5 (T) = (VAL))
/* The type qualifiers for this type, including the qualifiers on the
elements for an array type. */
#define CP_TYPE_QUALS(NODE) \
- ((TREE_CODE (NODE) != ARRAY_TYPE) \
+ ((TREE_CODE (NODE) != ARRAY_TYPE) \
? TYPE_QUALS (NODE) : cp_type_quals (NODE))
/* Nonzero if this type is const-qualified. */
unsigned has_abstract_assign_ref : 1;
unsigned non_aggregate : 1;
unsigned is_partial_instantiation : 1;
+ unsigned user_align : 1;
/* When adding a flag here, consider whether or not it ought to
apply to a template instance if it applies to the template. If
/* There are some bits left to fill out a 32-bit word. Keep track
of this by updating the size of this bitfield whenever you add or
remove a flag. */
- unsigned dummy : 9;
-
+ unsigned dummy : 8;
+
int vsize;
- int vfield_parent;
+ tree primary_base;
tree vfields;
tree vbases;
tree tags;
has a two-argument array operator delete. */
#define TYPE_VEC_NEW_USES_COOKIE(NODE) \
(TYPE_HAS_NONTRIVIAL_DESTRUCTOR (NODE) \
- || (TYPE_LANG_SPECIFIC (NODE) \
+ || (TYPE_LANG_SPECIFIC (NODE) \
&& TYPE_VEC_DELETE_TAKES_SIZE (NODE)))
/* Nonzero means that this _CLASSTYPE node defines ways of converting
#define SET_CLASSTYPE_MARKED2(NODE) SET_CLASSTYPE_MARKED_N(NODE, 1)
#define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 1)
#define SET_CLASSTYPE_MARKED3(NODE) SET_CLASSTYPE_MARKED_N(NODE, 2)
-#define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 2)
+#define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 2)
#define SET_CLASSTYPE_MARKED4(NODE) SET_CLASSTYPE_MARKED_N(NODE, 3)
#define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 3)
#define SET_CLASSTYPE_MARKED5(NODE) SET_CLASSTYPE_MARKED_N(NODE, 4)
nested member class templates. */
#define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags)
-/* If this value is non-negative, it is the index (in the
- TYPE_BINFO_BASETYPES) for the base-class whose vtable pointer we
- are reusing. For example, in D : B1, B2, PARENT would be 0, if D's
- vtable came from B1, 1, if D's vtable came from B2. */
-#define CLASSTYPE_VFIELD_PARENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfield_parent)
-
/* Nonzero if NODE has a primary base class, i.e., a base class with
- which it shares the virtual fucntion table pointer. */
+ which it shares the virtual function table pointer. */
#define CLASSTYPE_HAS_PRIMARY_BASE_P(NODE) \
- (CLASSTYPE_VFIELD_PARENT (NODE) != -1)
+ (CLASSTYPE_PRIMARY_BINFO (NODE) != NULL_TREE)
/* If non-NULL, this is the binfo for the primary base class, i.e.,
the base class which contains the virtual function table pointer
for this class. */
#define CLASSTYPE_PRIMARY_BINFO(NODE) \
- (BINFO_PRIMARY_BINFO (TYPE_BINFO (NODE)))
-
-/* If non-NULL, this is the binfo for the primary base of BINFO. Note
- that in a complex hierarchy the resulting BINFO may not actually
- *be* primary. In particular if the resulting BINFO is a virtual
- base, and it occurs elsewhere in the hierarchy, then this
- occurrence may not actually be a primary base in the complete
- object. Check BINFO_PRIMARY_MARKED_P to be sure. */
-#define BINFO_PRIMARY_BINFO(NODE) \
- (CLASSTYPE_HAS_PRIMARY_BASE_P (BINFO_TYPE (NODE)) \
- ? BINFO_BASETYPE (NODE, \
- CLASSTYPE_VFIELD_PARENT (BINFO_TYPE (NODE))) \
- : NULL_TREE)
+ (TYPE_LANG_SPECIFIC (NODE)->primary_base)
/* The number of virtual functions present in this class' virtual
function table. */
binfo_for_vbase. C is the most derived class for the hierarchy
containing BINFO. */
#define CANONICAL_BINFO(BINFO, C) \
- (TREE_VIA_VIRTUAL (BINFO) \
- ? binfo_for_vbase (BINFO_TYPE (BINFO), C) \
+ (TREE_VIA_VIRTUAL (BINFO) \
+ ? binfo_for_vbase (BINFO_TYPE (BINFO), C) \
: BINFO)
/* Number of direct baseclasses of NODE. */
#define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size)
#define CLASSTYPE_SIZE_UNIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->size_unit)
#define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align)
+#define CLASSTYPE_USER_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->user_align)
+
+/* The alignment of NODE, without its virtual bases, in bytes. */
+#define CLASSTYPE_ALIGN_UNIT(NODE) \
+ (CLASSTYPE_ALIGN (NODE) / BITS_PER_UNIT)
/* A cons list of virtual functions which cannot be inherited by
derived classes. When deriving from this type, the derived
/* Any subobject that needs a new vtable must have a vptr and must not
be a primary base (since it would then use the vtable from a
derived class.) */
-#define SET_BINFO_NEW_VTABLE_MARKED(B, C) \
+#define SET_BINFO_NEW_VTABLE_MARKED(B, C) \
(BINFO_NEW_VTABLE_MARKED (B, C) = 1, \
my_friendly_assert (!BINFO_PRIMARY_MARKED_P (B), 20000517), \
my_friendly_assert (CLASSTYPE_VFIELDS (BINFO_TYPE (B)) != NULL_TREE, \
20000517))
-#define CLEAR_BINFO_NEW_VTABLE_MARKED(B, C) \
- (BINFO_NEW_VTABLE_MARKED (B, C) = 0)
/* Nonzero means this class has done dfs_pushdecls. */
#define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE)
class of a non-primary virtual base. This flag is only valid for
paths (given by BINFO_INHERITANCE_CHAIN) that really exist in the
final object. */
-#define BINFO_PRIMARY_MARKED_P(NODE) TREE_LANG_FLAG_5 (NODE)
+#define BINFO_PRIMARY_MARKED_P(NODE) \
+ (BINFO_PRIMARY_BASE_OF (NODE) != NULL_TREE)
+
+/* The index in the VTT where this subobject's sub-VTT can be found.
+ NULL_TREE if there is no sub-VTT. */
+#define BINFO_SUBVTT_INDEX(NODE) TREE_VEC_ELT ((NODE), 8)
-/* Nonzero if the virtual baseclass with the type given by this BINFO
- is primary *somewhere* in the hierarchy. */
-#define BINFO_VBASE_PRIMARY_P(NODE) TREE_LANG_FLAG_6 (NODE)
+/* The index in the VTT where the vptr for this subobject can be
+ found. NULL_TREE if there is no secondary vptr in the VTT. */
+#define BINFO_VPTR_INDEX(NODE) TREE_VEC_ELT ((NODE), 9)
+
+/* The binfo of which NODE is a primary base. (This is different from
+ BINFO_INHERITANCE_CHAIN for virtual base because a virtual base is
+ sometimes a primary base for a class for which it is not an
+ immediate base.) */
+#define BINFO_PRIMARY_BASE_OF(NODE) TREE_VEC_ELT ((NODE), 10)
+
+/* Nonzero if this binfo declares a virtual function which is
+ overridden along a virtual path. */
+#define BINFO_OVERRIDE_ALONG_VIRTUAL_PATH_P(NODE) TREE_LANG_FLAG_2 (NODE)
+
+/* Nonzero if this binfo is an indirect primary base, i.e. a virtual
+ base that is a primary base of some of other class in the
+ hierarchy. */
+#define BINFO_INDIRECT_PRIMARY_P(NODE) TREE_USED (NODE)
/* Used by various search routines. */
#define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE)
/* The function to call. */
#define BV_FN(NODE) (TREE_VALUE (NODE))
+/* Nonzero if we should use a virtual thunk for this entry. */
+#define BV_USE_VCALL_INDEX_P(NODE) \
+ (TREE_LANG_FLAG_0 (NODE))
+
+/* Nonzero if we should generate this thunk when the vtable that
+ references it is emitted, rather than with the final overrider. */
+#define BV_GENERATE_THUNK_WITH_VTABLE_P(NODE) \
+ (TREE_LANG_FLAG_1 (NODE))
+
/* The most derived class. */
\f
#define CAN_HAVE_FULL_LANG_DECL_P(NODE) \
(!(TREE_CODE ((NODE)) == VAR_DECL \
|| TREE_CODE ((NODE)) == CONST_DECL \
- || TREE_CODE ((NODE)) == FIELD_DECL \
+ || TREE_CODE ((NODE)) == FIELD_DECL \
|| TREE_CODE ((NODE)) == USING_DECL))
struct lang_decl_flags
{
+ struct c_lang_decl base;
+
ENUM_BITFIELD(languages) language : 8;
unsigned operator_attr : 1;
unsigned global_ctor_p : 1;
unsigned global_dtor_p : 1;
unsigned tinfo_fn_p : 1;
- unsigned dummy : 4;
-
- tree context;
+ unsigned assignment_operator_p : 1;
+ unsigned anticipated_p : 1;
+ unsigned generate_with_vtable_p : 1;
+ unsigned dummy : 1;
union {
/* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this
/* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
THUNK_VCALL_OFFSET. */
- HOST_WIDE_INT vcall_offset;
+ tree vcall_offset;
} u2;
};
+struct unparsed_text;
+
struct lang_decl
{
struct lang_decl_flags decl_flags;
tree befriending_classes;
- /* In a FUNCTION_DECL, this is DECL_SAVED_TREE. */
- tree saved_tree;
+ /* For a virtual FUNCTION_DECL, this is DECL_VIRTUAL_CONTEXT. For a
+ non-virtual FUNCTION_DECL, this is DECL_FRIEND_CONTEXT. */
+ tree context;
/* In a FUNCTION_DECL, this is DECL_CLONED_FUNCTION. */
tree cloned_function;
union
{
tree sorted_fields;
- struct pending_inline *pending_inline_info;
- struct language_function *saved_language_function;
+ struct unparsed_text *pending_inline_info;
+ struct cp_language_function *saved_language_function;
} u;
+
+ union {
+ /* In an overloaded operator, this is the value of
+ DECL_OVERLOADED_OPERATOR_P. */
+ enum tree_code operator_code;
+ /* In a maybe-in-charge constructor or destructor, this is
+ DECL_VTT_PARM. */
+ tree vtt_parm;
+ } u2;
};
+#define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.pointer)
+
/* Non-zero if NODE is a _DECL with TREE_READONLY set. */
#define TREE_READONLY_DECL_P(NODE) \
(TREE_READONLY (NODE) && DECL_P (NODE))
+/* DECL_NEEDED_P holds of a declaration when we need to emit its
+ definition. This is true when the back-end tells us that
+ the symbol has been referenced in the generated code. If, however,
+ we are not generating code, then it is also true when a symbol has
+ just been used somewhere, even if it's not really needed. We need
+ anything that isn't comdat, but we don't know for sure whether or
+ not something is comdat until end-of-file. */
+#define DECL_NEEDED_P(DECL) \
+ ((at_eof && TREE_PUBLIC (DECL) && !DECL_COMDAT (DECL)) \
+ || (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL)))) \
+ || (flag_syntax_only && TREE_USED ((DECL))))
+
/* Non-zero iff DECL is memory-based. The DECL_RTL of
certain const variables might be a CONST_INT, or a REG
in some cases. We cannot use `memory_operand' as a test
/* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a complete
object. */
#define DECL_COMPLETE_CONSTRUCTOR_P(NODE) \
- (DECL_CONSTRUCTOR_P (NODE) \
+ (DECL_CONSTRUCTOR_P (NODE) \
&& DECL_NAME (NODE) == complete_ctor_identifier)
/* Nonzero if NODE (a FUNCTION_DECL) is a constructor for a base
#define DECL_COPY_CONSTRUCTOR_P(NODE) \
(DECL_CONSTRUCTOR_P (NODE) && copy_args_p (NODE))
-/* There ought to be a better way to find out whether or not something is
- a destructor. */
+/* Nonzero if NODE is a destructor. */
#define DECL_DESTRUCTOR_P(NODE) \
(DECL_LANG_SPECIFIC (NODE)->decl_flags.destructor_attr)
/* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete
object. */
#define DECL_COMPLETE_DESTRUCTOR_P(NODE) \
- (DECL_DESTRUCTOR_P (NODE) \
+ (DECL_DESTRUCTOR_P (NODE) \
&& DECL_NAME (NODE) == complete_dtor_identifier)
/* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a base
/* Nonzero if NODE (a FUNCTION_DECL) is a destructor for a complete
object that deletes the object after it has been destroyed. */
#define DECL_DELETING_DESTRUCTOR_P(NODE) \
- (DECL_DESTRUCTOR_P (NODE) \
+ (DECL_DESTRUCTOR_P (NODE) \
&& DECL_NAME (NODE) == deleting_dtor_identifier)
/* Nonzero if NODE (a FUNCTION_DECL) is a cloned constructor or
destructor. */
-#define DECL_CLONED_FUNCTION_P(NODE) \
- (DECL_CLONED_FUNCTION (NODE) != NULL_TREE)
+#define DECL_CLONED_FUNCTION_P(NODE) \
+ (DECL_LANG_SPECIFIC (NODE) \
+ && DECL_CLONED_FUNCTION (NODE) != NULL_TREE)
/* If DECL_CLONED_FUNCTION_P holds, this is the function that was
cloned. */
#define DECL_CLONED_FUNCTION(NODE) \
(DECL_LANG_SPECIFIC (NODE)->cloned_function)
+/* In a maybe-in-charge constructor or destructor, this is the VTT
+ parameter. It's not actually on the DECL_ARGUMENTS list. */
+#define DECL_VTT_PARM(NODE) \
+ (DECL_LANG_SPECIFIC (NODE)->u2.vtt_parm)
+
+/* If there's a DECL_VTT_PARM, this is a magic variable that indicates
+ whether or not the VTT parm should be used. In a subobject
+ constructor, `true' is substituted for this value; in a complete
+ object constructor, `false' is substituted instead. */
+#define DECL_USE_VTT_PARM(NODE) \
+ (TREE_CHAIN (DECL_VTT_PARM (NODE)))
+
+/* Non-zero if NODE is a FUNCTION_DECL for which a VTT parameter is
+ required. */
+#define DECL_NEEDS_VTT_PARM_P(NODE) \
+ (TYPE_USES_VIRTUAL_BASECLASSES (DECL_CONTEXT (NODE)) \
+ && (DECL_BASE_CONSTRUCTOR_P (NODE) \
+ || DECL_BASE_DESTRUCTOR_P (NODE)))
+
/* Non-zero if NODE is a user-defined conversion operator. */
#define DECL_CONV_FN_P(NODE) \
(IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)))
-/* Non-zero if NODE is an overloaded operator. */
-#define DECL_OVERLOADED_OPERATOR_P(NODE) \
- (IDENTIFIER_OPNAME_P (DECL_NAME ((NODE))))
+/* Set the overloaded operator code for NODE to CODE. */
+#define SET_OVERLOADED_OPERATOR_CODE(NODE, CODE) \
+ (DECL_LANG_SPECIFIC (NODE)->u2.operator_code = (CODE))
+
+/* If NODE is an overloaded operator, then this returns the TREE_CODE
+ associcated with the overloaded operator.
+ DECL_ASSIGNMENT_OPERATOR_P must also be checked to determine
+ whether or not NODE is an assignment operator. If NODE is not an
+ overloaded operator, ERROR_MARK is returned. Since the numerical
+ value of ERROR_MARK is zero, this macro can be used as a predicate
+ to test whether or not NODE is an overloaded operator. */
+#define DECL_OVERLOADED_OPERATOR_P(NODE) \
+ (IDENTIFIER_OPNAME_P (DECL_NAME ((NODE))) \
+ ? DECL_LANG_SPECIFIC (NODE)->u2.operator_code : ERROR_MARK)
+
+/* Non-zero if NODE is an assignment operator. */
+#define DECL_ASSIGNMENT_OPERATOR_P(NODE) \
+ (DECL_LANG_SPECIFIC (NODE)->decl_flags.assignment_operator_p)
/* For FUNCTION_DECLs: nonzero means that this function is a
constructor or a destructor with an extra in-charge parameter to
/* Non-zero for a FUNCTION_DECL that declares a type-info function.
This only happens in the old abi. */
-#define DECL_TINFO_FN_P(NODE) \
+#define DECL_TINFO_FN_P(NODE) \
(TREE_CODE (NODE) == FUNCTION_DECL \
&& DECL_ARTIFICIAL (NODE) \
&& DECL_LANG_SPECIFIC(NODE)->decl_flags.tinfo_fn_p)
/* Nonzero if NODE is an overloaded `operator delete[]' function. */
#define DECL_ARRAY_DELETE_OPERATOR_P(NODE) \
- (DECL_NAME (NODE) == ansi_opname[(int) VEC_DELETE_EXPR])
+ (DECL_OVERLOADED_OPERATOR_P (NODE) == VEC_DELETE_EXPR)
/* Nonzero for _DECL means that this decl appears in (or will appear
in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for
#define SHARED_MEMBER_P(NODE) \
(TREE_CODE (NODE) == VAR_DECL || TREE_CODE (NODE) == TYPE_DECL \
|| TREE_CODE (NODE) == CONST_DECL)
-
+
/* Nonzero for FUNCTION_DECL means that this decl is a non-static
member function. */
#define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
has `this' as const X *const. */
#define DECL_CONST_MEMFUNC_P(NODE) \
(DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \
- && CP_TYPE_CONST_P (TREE_TYPE (TREE_VALUE \
+ && CP_TYPE_CONST_P (TREE_TYPE (TREE_VALUE \
+ (TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
+
+/* Nonzero for FUNCTION_DECL means that this member function
+ has `this' as volatile X *const. */
+#define DECL_VOLATILE_MEMFUNC_P(NODE) \
+ (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \
+ && CP_TYPE_VOLATILE_P (TREE_TYPE (TREE_VALUE \
(TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
/* Nonzero for a DECL means that this member is a non-static member. */
-#define DECL_NONSTATIC_MEMBER_P(NODE) \
- ((TREE_CODE (NODE) == FUNCTION_DECL \
+#define DECL_NONSTATIC_MEMBER_P(NODE) \
+ ((TREE_CODE (NODE) == FUNCTION_DECL \
&& DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)) \
|| TREE_CODE (NODE) == FIELD_DECL)
/* For a non-member friend function, the class (if any) in which this
friend was defined. For example, given:
-
+
struct S { friend void f (); };
the DECL_FRIEND_CONTEXT for `f' will be `S'. */
#define DECL_FRIEND_CONTEXT(NODE) \
((DECL_FRIEND_P (NODE) && !DECL_FUNCTION_MEMBER_P (NODE)) \
- ? DECL_LANG_SPECIFIC (NODE)->decl_flags.context \
+ ? DECL_LANG_SPECIFIC (NODE)->context \
: NULL_TREE)
/* Set the DECL_FRIEND_CONTEXT for NODE to CONTEXT. */
#define SET_DECL_FRIEND_CONTEXT(NODE, CONTEXT) \
- (DECL_LANG_SPECIFIC (NODE)->decl_flags.context = (CONTEXT))
+ (DECL_LANG_SPECIFIC (NODE)->context = (CONTEXT))
/* NULL_TREE in DECL_CONTEXT represents the global namespace. */
#define CP_DECL_CONTEXT(NODE) \
/* For a virtual function, the base where we find its vtable entry.
For a non-virtual function, the base where it is defined. */
#define DECL_VIRTUAL_CONTEXT(NODE) \
- (DECL_LANG_SPECIFIC (NODE)->decl_flags.context)
+ (DECL_LANG_SPECIFIC (NODE)->context)
/* 1 iff NODE has namespace scope, including the global namespace. */
#define DECL_NAMESPACE_SCOPE_P(NODE) \
#define DECL_FUNCTION_SCOPE_P(NODE) \
(DECL_CONTEXT (NODE) \
&& TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
-
+
+/* 1 iff NODE is function-local, but for types. */
+#define LOCAL_CLASS_P(NODE) \
+ (decl_function_context (TYPE_MAIN_DECL (NODE)) != NULL_TREE)
+
/* For a NAMESPACE_DECL: the list of using namespace directives
The PURPOSE is the used namespace, the value is the namespace
that is the common ancestor. */
#define ORIGINAL_NAMESPACE(NODE) \
(DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE))
+/* Non-zero if NODE is the std namespace. */
+#define DECL_NAMESPACE_STD_P(NODE) \
+ (TREE_CODE (NODE) == NAMESPACE_DECL \
+ && CP_DECL_CONTEXT (NODE) == global_namespace \
+ && DECL_NAME (NODE) == std_identifier)
+
/* In a non-local VAR_DECL with static storage duration, this is the
initialization priority. If this value is zero, the NODE will be
initialized at the DEFAULT_INIT_PRIORITY. */
the class definition. We have saved away the text of the function,
but have not yet processed it. */
#define DECL_PENDING_INLINE_P(NODE) \
- (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->decl_flags.pending_inline_p)
-
+ (DECL_LANG_SPECIFIC (NODE)->decl_flags.pending_inline_p)
+
/* If DECL_PENDING_INLINE_P holds, this is the saved text of the
function. */
#define DECL_PENDING_INLINE_INFO(NODE) \
non-type template parameters. */
#define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (ENUMERAL_TYPE_CHECK (NODE)))
-/* Template information for a template template parameter. */
+/* Template information for a bound template template parameter. */
#define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE))
/* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE. */
#define TYPE_TEMPLATE_INFO(NODE) \
(TREE_CODE (NODE) == ENUMERAL_TYPE \
- ? ENUM_TEMPLATE_INFO (NODE) : \
- (TREE_CODE (NODE) == TEMPLATE_TEMPLATE_PARM \
- ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) \
- : CLASSTYPE_TEMPLATE_INFO (NODE)))
+ ? ENUM_TEMPLATE_INFO (NODE) : \
+ (TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM \
+ ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) : \
+ (TYPE_LANG_SPECIFIC (NODE) \
+ ? CLASSTYPE_TEMPLATE_INFO (NODE) \
+ : NULL_TREE)))
/* Set the template information for an ENUMERAL_, RECORD_, or
UNION_TYPE to VAL. */
-#define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
- (TREE_CODE (NODE) == ENUMERAL_TYPE \
- ? (ENUM_TEMPLATE_INFO (NODE) = VAL) \
+#define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \
+ (TREE_CODE (NODE) == ENUMERAL_TYPE \
+ ? (ENUM_TEMPLATE_INFO (NODE) = VAL) \
: (CLASSTYPE_TEMPLATE_INFO (NODE) = VAL))
#define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE))
arguments, then each entry in the TREE_VEC is itself a TREE_VEC,
containing the template arguments for a single level. The first
entry in the outer TREE_VEC is the outermost level of template
- parameters; the last is the innermost.
+ parameters; the last is the innermost.
It is incorrect to ever form a template argument vector containing
only one level of arguments, but which is a TREE_VEC containing as
#define TMPL_ARGS_DEPTH(NODE) \
(TMPL_ARGS_HAVE_MULTIPLE_LEVELS (NODE) ? TREE_VEC_LENGTH (NODE) : 1)
-/* The LEVELth level of the template ARGS. Note that template
- parameter levels are indexed from 1, not from 0. */
+/* The LEVELth level of the template ARGS. The outermost level of of
+ args is level 1, not level 0. */
#define TMPL_ARGS_LEVEL(ARGS, LEVEL) \
- (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (ARGS) \
+ (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (ARGS) \
? TREE_VEC_ELT ((ARGS), (LEVEL) - 1) : ARGS)
/* Set the LEVELth level of the template ARGS to VAL. This macro does
/* Given a single level of template arguments in NODE, return the
number of arguments. */
-#define NUM_TMPL_ARGS(NODE) \
- ((NODE) == NULL_TREE ? 0 \
- : (TREE_CODE (NODE) == TREE_VEC \
+#define NUM_TMPL_ARGS(NODE) \
+ ((NODE) == NULL_TREE ? 0 \
+ : (TREE_CODE (NODE) == TREE_VEC \
? TREE_VEC_LENGTH (NODE) : list_length (NODE)))
+/* Returns the innermost level of template arguments in ARGS. */
+#define INNERMOST_TEMPLATE_ARGS(NODE) \
+ (get_innermost_template_args ((NODE), 1))
+
/* The number of levels of template parameters given by NODE. */
#define TMPL_PARMS_DEPTH(NODE) \
(TREE_INT_CST_HIGH (TREE_PURPOSE (NODE)))
template <class T> struct S { template <class U> void f(U); }
the FUNCTION_DECL for S<int>::f<double> will have, as its
- DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
+ DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'.
As a special case, for a member friend template of a template
class, this value will not be a TEMPLATE_DECL, but rather a
template <class T> struct S { friend void f<int>(int, double); }
the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the
- DECL_TI_ARGS will be {int}. */
+ DECL_TI_ARGS will be {int}. */
#define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE))
/* The template arguments used to obtain this decl from the most
#define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE))
#define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE))
#define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE))
-#define ENUM_TI_TEMPLATE(NODE) \
+#define ENUM_TI_TEMPLATE(NODE) \
TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE))
#define ENUM_TI_ARGS(NODE) \
TI_ARGS (ENUM_TEMPLATE_INFO (NODE))
the class definition is complete. */
#define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE)
-/* In a FUNCTION_DECL, the saved representation of the body of the
- entire function. Usually a COMPOUND_STMT, but this may also be a
- RETURN_INIT, CTOR_INITIALIZER, or TRY_BLOCK. */
-#define DECL_SAVED_TREE(NODE) \
- (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->saved_tree)
-
/* In a FUNCTION_DECL, the saved language-specific per-function data. */
#define DECL_SAVED_FUNCTION_DATA(NODE) \
(DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->u.saved_language_function)
-#define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE)
#define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
#define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE)
#define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE)
#define AGGR_INIT_VIA_CTOR_P(NODE) \
TREE_LANG_FLAG_0 (AGGR_INIT_EXPR_CHECK (NODE))
-/* Nonzero if this statement should be considered a full-expression. */
-#define STMT_IS_FULL_EXPR_P(NODE) TREE_LANG_FLAG_1 ((NODE))
-
/* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a
TEMPLATE_DECL. This macro determines whether or not a given class
type is really a template type, as opposed to an instantiation or
/* Nonzero if NODE is a TYPE_DECL that should not be visible because
it is from a dependent base class. */
-#define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE) \
+#define IMPLICIT_TYPENAME_TYPE_DECL_P(NODE) \
(TREE_CODE (NODE) == TYPE_DECL \
&& DECL_ARTIFICIAL (NODE) \
&& IMPLICIT_TYPENAME_P (TREE_TYPE (NODE)))
#define TYPE_POLYMORPHIC_P(NODE) (TREE_LANG_FLAG_2 (NODE))
/* Nonzero if this class has a virtual function table pointer. */
-#define TYPE_CONTAINS_VPTR_P(NODE) \
- (TYPE_POLYMORPHIC_P (NODE) \
- || (vbase_offsets_in_vtable_p () \
+#define TYPE_CONTAINS_VPTR_P(NODE) \
+ (TYPE_POLYMORPHIC_P (NODE) \
+ || (vbase_offsets_in_vtable_p () \
&& TYPE_USES_VIRTUAL_BASECLASSES (NODE)))
extern int flag_new_for_scope;
#define DECL_LOCAL_FUNCTION_P(NODE) \
DECL_LANG_FLAG_0 (FUNCTION_DECL_CHECK (NODE))
-/* This _DECL represents a compiler-generated entity. */
-#define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1)
+/* Nonzero if NODE is a FUNCTION_DECL for a built-in function, and we have
+ not yet seen a prototype for that function. */
+#define DECL_ANTICIPATED(NODE) \
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (NODE))->decl_flags.anticipated_p)
/* Record whether a typedef for type `int' was actually `signed int'. */
#define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp))
/* [basic.fundamental]
Types bool, char, wchar_t, and the signed and unsigned integer types
- are collectively called integral types.
+ are collectively called integral types.
Note that INTEGRAL_TYPE_P, as defined in tree.h, allows enumeration
types as well, which is incorrect in C++. */
-#define CP_INTEGRAL_TYPE_P(TYPE) \
- (TREE_CODE ((TYPE)) == BOOLEAN_TYPE \
+#define CP_INTEGRAL_TYPE_P(TYPE) \
+ (TREE_CODE ((TYPE)) == BOOLEAN_TYPE \
|| TREE_CODE ((TYPE)) == INTEGER_TYPE)
/* [basic.fundamental]
#define ARITHMETIC_TYPE_P(TYPE) \
(CP_INTEGRAL_TYPE_P (TYPE) || TREE_CODE (TYPE) == REAL_TYPE)
-/* Mark which labels are explicitly declared.
- These may be shadowed, and may be referenced from nested functions. */
-#define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label)
-
/* Nonzero for _TYPE means that the _TYPE defines
at least one constructor. */
#define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE))
&& CONSTRUCTOR_ELTS (NODE) == NULL_TREE \
&& ! TREE_HAS_CONSTRUCTOR (NODE))
-#if 0
-/* Indicates that a NON_LVALUE_EXPR came from a C++ reference.
- Used to generate more helpful error message in case somebody
- tries to take its address. */
-#define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE))
-#endif
-
/* Nonzero for _TYPE means that the _TYPE defines a destructor. */
#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE))
#define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->has_complex_init_ref)
/* Nonzero if TYPE has a trivial destructor. From [class.dtor]:
-
+
A destructor is trivial if it is an implicitly declared
destructor and if:
- all of the direct base classes of its class have trivial
- destructors,
+ destructors,
- for all of the non-static data members of its class that are
- of class type (or array thereof), each such class has a
+ of class type (or array thereof), each such class has a
trivial destructor. */
#define TYPE_HAS_TRIVIAL_DESTRUCTOR(NODE) \
(!TYPE_HAS_NONTRIVIAL_DESTRUCTOR (NODE))
#define TYPE_PTRMEMFUNC_FLAG(NODE) \
(TYPE_LANG_SPECIFIC(NODE)->ptrmemfunc_flag)
+/* Indicates when overload resolution may resolve to a pointer to
+ member function. [expr.unary.op]/3 */
+#define PTRMEM_OK_P(NODE) TREE_LANG_FLAG_0 (NODE)
+
/* A pointer-to-function member type looks like:
struct {
function.
(Of course, the exact values may differ depending on the mangling
- scheme, sizes of types, and such.).
+ scheme, sizes of types, and such.).
Under the new ABI, we do:
in the object.) If the function is virtual, then PFN is one plus
twice the index into the vtable; otherwise, it is just a pointer to
the function. */
-
+
/* Get the POINTER_TYPE to the METHOD_TYPE associated with this
pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true,
before using this macro. */
#define PTRMEM_CST_CLASS(NODE) \
TYPE_PTRMEM_CLASS_TYPE (TREE_TYPE (PTRMEM_CST_CHECK (NODE)))
-/* For a pointer-to-member constant `X::Y' this is the _DECL for
+/* For a pointer-to-member constant `X::Y' this is the _DECL for
`Y'. */
#define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t)PTRMEM_CST_CHECK (NODE))->member)
#define ANON_UNION_TYPE_P(NODE) \
(TREE_CODE (NODE) == UNION_TYPE && ANON_AGGR_TYPE_P (NODE))
-/* For a VAR_DECL that is an anonymous union, these are the various
- sub-variables that make up the anonymous union. */
-#define DECL_ANON_UNION_ELEMS(NODE) DECL_ARGUMENTS ((NODE))
-
#define UNKNOWN_TYPE LANG_TYPE
/* Define fields and accessors for nodes representing declared names. */
-#if 0
-/* C++: A derived class may be able to directly use the virtual
- function table of a base class. When it does so, it may
- still have a decl node used to access the virtual function
- table (so that variables of this type can initialize their
- virtual function table pointers by name). When such thievery
- is committed, know exactly which base class's virtual function
- table is the one being stolen. This effectively computes the
- transitive closure. */
-#define DECL_VPARENT(NODE) ((NODE)->decl.arguments)
-#endif
-
#define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->was_anonymous)
/* C++: all of these are overloaded! These apply only to TYPE_DECLs. */
template <class T> struct S {
template <class U> void f(U);
- template <> void f(T);
+ template <> void f(T);
};
the `S<int>::f<int>(int)' function will appear on the
#define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE)
/* Nonzero for a DECL which is actually a template parameter. */
-#define DECL_TEMPLATE_PARM_P(NODE) \
+#define DECL_TEMPLATE_PARM_P(NODE) \
(DECL_LANG_FLAG_0 (NODE) \
&& (TREE_CODE (NODE) == CONST_DECL \
|| TREE_CODE (NODE) == TYPE_DECL \
`this' pointer when this function is called. */
#define THUNK_DELTA(DECL) (DECL_CHECK (DECL)->decl.u1.i)
-/* An integer indicating how many bytes should be subtracted from the
+/* A tree indicating how many bytes should be subtracted from the
vtable for the `this' pointer to find the vcall offset. (The vptr
is always located at offset zero from the f `this' pointer.) If
- zero, then there is no vcall offset. */
+ NULL, then there is no vcall offset. */
#define THUNK_VCALL_OFFSET(DECL) \
(DECL_LANG_SPECIFIC (DECL)->decl_flags.u2.vcall_offset)
-/* DECL_NEEDED_P holds of a declaration when we need to emit its
- definition. This is true when the back-end tells us that
- the symbol has been referenced in the generated code. If, however,
- we are not generating code, then it is also true when a symbol has
- just been used somewhere, even if it's not really needed. We need
- anything that isn't comdat, but we don't know for sure whether or
- not something is comdat until end-of-file. */
-#define DECL_NEEDED_P(DECL) \
- ((at_eof && !DECL_COMDAT (DECL)) \
- || (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME ((DECL)))) \
- || (flag_syntax_only && TREE_USED ((DECL))))
-
-/* An un-parsed default argument looks like an identifier. */
-#define DEFARG_LENGTH(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.length)
-#define DEFARG_POINTER(NODE) (DEFAULT_ARG_CHECK(NODE)->identifier.pointer)
+/* Nonzero if this thunk should be generated with the vtable that
+ references it. */
+#define THUNK_GENERATE_WITH_VTABLE_P(DECL) \
+ (DECL_LANG_SPECIFIC (DECL)->decl_flags.generate_with_vtable_p)
/* These macros provide convenient access to the various _STMT nodes
created when parsing template declarations. */
-#define IF_COND(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 0)
-#define THEN_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 1)
-#define ELSE_CLAUSE(NODE) TREE_OPERAND (IF_STMT_CHECK (NODE), 2)
-#define WHILE_COND(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 0)
-#define WHILE_BODY(NODE) TREE_OPERAND (WHILE_STMT_CHECK (NODE), 1)
-#define DO_COND(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 0)
-#define DO_BODY(NODE) TREE_OPERAND (DO_STMT_CHECK (NODE), 1)
-#define RETURN_EXPR(NODE) TREE_OPERAND (RETURN_STMT_CHECK (NODE), 0)
-#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (EXPR_STMT_CHECK (NODE), 0)
-#define FOR_INIT_STMT(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 0)
-#define FOR_COND(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 1)
-#define FOR_EXPR(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 2)
-#define FOR_BODY(NODE) TREE_OPERAND (FOR_STMT_CHECK (NODE), 3)
-#define SWITCH_COND(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 0)
-#define SWITCH_BODY(NODE) TREE_OPERAND (SWITCH_STMT_CHECK (NODE), 1)
-#define CASE_LOW(NODE) TREE_OPERAND (CASE_LABEL_CHECK (NODE), 0)
-#define CASE_HIGH(NODE) TREE_OPERAND (CASE_LABEL_CHECK (NODE), 1)
-#define GOTO_DESTINATION(NODE) TREE_OPERAND (GOTO_STMT_CHECK (NODE), 0)
#define TRY_STMTS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 0)
#define TRY_HANDLERS(NODE) TREE_OPERAND (TRY_BLOCK_CHECK (NODE), 1)
-#define CLEANUP_P(NODE) TREE_LANG_FLAG_0 (TRY_BLOCK_CHECK (NODE))
+
/* Nonzero if this try block is a function try block. */
#define FN_TRY_BLOCK_P(NODE) TREE_LANG_FLAG_3 (TRY_BLOCK_CHECK (NODE))
#define HANDLER_PARMS(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 0)
#define HANDLER_BODY(NODE) TREE_OPERAND (HANDLER_CHECK (NODE), 1)
-#define COMPOUND_BODY(NODE) TREE_OPERAND (COMPOUND_STMT_CHECK (NODE), 0)
-#define ASM_CV_QUAL(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 0)
-#define ASM_STRING(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 1)
-#define ASM_OUTPUTS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 2)
-#define ASM_INPUTS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 3)
-#define ASM_CLOBBERS(NODE) TREE_OPERAND (ASM_STMT_CHECK (NODE), 4)
-#define DECL_STMT_DECL(NODE) TREE_OPERAND (DECL_STMT_CHECK (NODE), 0)
-#define STMT_EXPR_STMT(NODE) TREE_OPERAND (STMT_EXPR_CHECK (NODE), 0)
#define SUBOBJECT_CLEANUP(NODE) TREE_OPERAND (SUBOBJECT_CHECK (NODE), 0)
-#define CLEANUP_DECL(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 0)
-#define CLEANUP_EXPR(NODE) TREE_OPERAND (CLEANUP_STMT_CHECK (NODE), 1)
#define START_CATCH_TYPE(NODE) TREE_TYPE (START_CATCH_STMT_CHECK (NODE))
-#define LABEL_STMT_LABEL(NODE) TREE_OPERAND (LABEL_STMT_CHECK (NODE), 0)
-
-/* Nonzero if this SCOPE_STMT is for the beginning of a scope. */
-#define SCOPE_BEGIN_P(NODE) \
- (TREE_LANG_FLAG_0 (SCOPE_STMT_CHECK (NODE)))
-
-/* Nonzero if this SCOPE_STMT is for the end of a scope. */
-#define SCOPE_END_P(NODE) \
- (!SCOPE_BEGIN_P (SCOPE_STMT_CHECK (NODE)))
-/* The BLOCK containing the declarations contained in this scope. */
-#define SCOPE_STMT_BLOCK(NODE) \
- (TREE_OPERAND (SCOPE_STMT_CHECK (NODE), 0))
/* Nonzero if this CTOR_STMT is for the beginning of a constructor. */
#define CTOR_BEGIN_P(NODE) \
#define CTOR_END_P(NODE) \
(!CTOR_BEGIN_P (NODE))
-/* Nonzero for a SCOPE_STMT if there were no variables in this scope. */
-#define SCOPE_NULLIFIED_P(NODE) \
- (SCOPE_STMT_BLOCK ((NODE)) == NULL_TREE)
-
-/* Nonzero for a SCOPE_STMT which represents a lexical scope, but
- which should be treated as non-existant from the point of view of
- running cleanup actions. */
-#define SCOPE_NO_CLEANUPS_P(NODE) \
- (TREE_LANG_FLAG_3 (SCOPE_STMT_CHECK (NODE)))
-
-/* Nonzero for a SCOPE_STMT if this statement is for a partial scope.
- For example, in:
-
- S s;
- l:
- S s2;
- goto l;
-
- there is (implicitly) a new scope after `l', even though there are
- no curly braces. In particular, when we hit the goto, we must
- destroy s2 and then re-construct it. For the implicit scope,
- SCOPE_PARTIAL_P will be set. */
-#define SCOPE_PARTIAL_P(NODE) \
- (TREE_LANG_FLAG_4 (SCOPE_STMT_CHECK (NODE)))
-
-/* Nonzero for an ASM_STMT if the assembly statement is volatile. */
-#define ASM_VOLATILE_P(NODE) \
- (ASM_CV_QUAL (ASM_STMT_CHECK (NODE)) != NULL_TREE)
-
-/* The line-number at which a statement began. But if
- STMT_LINENO_FOR_FN_P does holds, then this macro gives the
- line number for the end of the current function instead. */
-#define STMT_LINENO(NODE) \
- (TREE_COMPLEXITY ((NODE)))
-
-/* If non-zero, the STMT_LINENO for NODE is the line at which the
- function ended. */
-#define STMT_LINENO_FOR_FN_P(NODE) \
- (TREE_LANG_FLAG_2 ((NODE)))
-
/* The parameters for a call-declarator. */
#define CALL_DECLARATOR_PARMS(NODE) \
(TREE_PURPOSE (TREE_OPERAND ((NODE), 1)))
/* The various kinds of access. BINFO_ACCESS depends on these being
two bit quantities. The numerical values are important; they are
- used to initialize RTTI data structures, so chaning them changes
+ used to initialize RTTI data structures, so changing them changes
the ABI. */
typedef enum access_kind {
ak_none = 0, /* Inaccessible. */
sfk_conversion /* A conversion operator. */
} special_function_kind;
-/* Zero means prototype weakly, as in ANSI C (no args means nothing).
- Each language context defines how this variable should be set. */
-extern int strict_prototype;
-extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus;
+/* Bitmask flags to pass to instantiate_type. */
+typedef enum instantiate_type_flags {
+ itf_none = 0, /* nothing special */
+ itf_complain = 1 << 0, /* complain about errors */
+ itf_no_attributes = 1 << 1, /* ignore attributes on comparisons */
+ itf_ptrmem_ok = 1 << 2, /* pointers to member ok (internal use) */
+} instantiate_type_flags;
/* Non-zero means that if a label exists, and no other identifier
applies, use the value of the label. */
/* Nonzero means allow Microsoft extensions without a pedwarn. */
extern int flag_ms_extensions;
-/* Non-zero means to collect statistics which might be expensive
- and to print them when we are done. */
-extern int flag_detailed_statistics;
-
/* Non-zero means warn in function declared in derived class has the
same name as a virtual in the base class, but fails to match the
type signature of any virtual function in the base class. */
extern void decl_attributes PARAMS ((tree, tree, tree));
extern void init_function_format_info PARAMS ((void));
extern void record_function_format PARAMS ((tree, tree, int, int, int));
-extern void check_function_format PARAMS ((tree, tree, tree));
+extern void check_function_format PARAMS ((int *, tree, tree, tree));
/* Print an error message for invalid operands to arith operation CODE.
NOP_EXPR is used as a special case (see truthvalue_conversion). */
extern void binary_op_error PARAMS ((enum tree_code));
extern void overflow_warning PARAMS ((tree));
extern void unsigned_conversion_warning PARAMS ((tree, tree));
extern void c_apply_type_quals_to_decl PARAMS ((int, tree));
-extern unsigned int min_precision PARAMS ((tree, int));
/* Read the rest of the current #-directive line. */
#if USE_CPPLIB
extern tree truthvalue_conversion PARAMS ((tree));
extern tree type_for_mode PARAMS ((enum machine_mode, int));
extern tree type_for_size PARAMS ((unsigned, int));
-extern int c_get_alias_set PARAMS ((tree));
/* in decl{2}.c */
/* A node that is a list (length 1) of error_mark_nodes. */
extern tree anonymous_namespace_name;
+/* The number of function bodies which we are currently processing.
+ (Zero if we are at namespace scope, one inside the body of a
+ function, two inside the body of a function in a local class, etc.) */
+extern int function_depth;
+
/* in pt.c */
/* These values are used for the `STRICT' parameter to type_unfication and
DEDUCE_EXACT
} unification_kind_t;
-/* The template currently being instantiated, and where the instantiation
- was triggered. */
-struct tinst_level
-{
- tree decl;
- int line;
- const char *file;
- struct tinst_level *next;
-};
+/* Macros for operating on a template instantation level node, represented
+ by an EXPR_WITH_FILE_LOCATION. */
-extern void maybe_print_template_context PARAMS ((void));
+#define TINST_DECL(NODE) EXPR_WFL_NODE (NODE)
+#define TINST_LINE(NODE) EXPR_WFL_LINENO (NODE)
+#define TINST_FILE(NODE) EXPR_WFL_FILENAME (NODE)
/* in class.c */
/* Points to the name of that function. May not be the DECL_NAME
of CURRENT_FUNCTION_DECL due to overloading */
extern tree original_function_name;
+
+/* An array of all local classes present in this translation unit, in
+ declaration order. */
+extern varray_type local_classes;
\f
/* Here's where we control how name mangling takes place. */
#define VTABLE_PFN_NAME "__pfn"
#define VTABLE_DELTA2_NAME "__delta2"
-#define EXCEPTION_CLEANUP_NAME "exception cleanup"
+#define EXCEPTION_CLEANUP_NAME "exception cleanup"
/* The name used as a prefix for VTTs. When the new ABI mangling
scheme is implemented, this should be removed. */
#define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \
&& IDENTIFIER_POINTER (ID_NODE)[1] == 'v')
#define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER \
- && IDENTIFIER_POINTER (ID_NODE)[2] == '_')
+ && IDENTIFIER_POINTER (ID_NODE)[2] == '_')
#define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \
&& IDENTIFIER_POINTER (ID_NODE)[2] == 't' \
#endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */
/* Store the vbase pointer field name for type TYPE into pointer BUF. */
-#define FORMAT_VBASE_NAME(BUF,TYPE) do { \
+#define FORMAT_VBASE_NAME(BUF,TYPE) do { \
char *wbuf = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE) \
+ sizeof (VBASE_NAME) + 1); \
sprintf (wbuf, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \
(BUF) = wbuf; \
} while (0)
-/* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is
- `main'. */
-#define MAIN_NAME_P(ID_NODE) \
- (strcmp (IDENTIFIER_POINTER (ID_NODE), "main") == 0)
-
/* Returns non-zero iff NODE is a declaration for the global function
`main'. */
#define DECL_MAIN_P(NODE) \
\f
/* Things for handling inline functions. */
-struct pending_inline
-{
- struct pending_inline *next; /* pointer to next in chain */
- int lineno; /* line number we got the text from */
- const char *filename; /* name of file we were processing */
- tree fndecl; /* FUNCTION_DECL that brought us here */
- int token; /* token we were scanning */
- int token_value; /* value of token we were scanning (YYSTYPE) */
-
- char *buf; /* pointer to character stream */
- int len; /* length of stream */
- unsigned int can_free : 1; /* free this after we're done with it? */
- unsigned int deja_vu : 1; /* set iff we don't want to see it again. */
- unsigned int interface : 2; /* 0=interface 1=unknown 2=implementation */
-};
-
-/* in method.c */
-extern struct pending_inline *pending_inlines;
-
/* Negative values means we know `this' to be of static type. */
extern int flag_this_is_variable;
extern int at_eof;
+/* Functions called along with real static constructors and destructors. */
+
+extern tree static_ctors;
+extern tree static_dtors;
+
enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG };
/* Some macros for char-based bitfields. */
These are used in global lookup to support elaborated types and
qualifiers.
-
+
LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces.
LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types.
LOOKUP_PREFER_BOTH means class-or-namespace-name.
#define LOOKUP_TYPES_ONLY(f) \
(!((f) & LOOKUP_PREFER_NAMESPACES) && ((f) & LOOKUP_PREFER_TYPES))
#define LOOKUP_QUALIFIERS_ONLY(f) ((f) & LOOKUP_PREFER_BOTH)
-
+
/* These flags are used by the conversion code.
CONV_IMPLICIT : Perform implicit conversions (standard and user-defined).
CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast.
CONV_PRIVATE : Perform upcasts to private bases.
CONV_FORCE_TEMP : Require a new temporary when converting to the same
- aggregate type. */
+ aggregate type. */
#define CONV_IMPLICIT 1
#define CONV_STATIC 2
already been parsed. */
#define SF_INCLASS_INLINE 2 /* The function is an inline, defined
in the class body. */
-#define SF_EXPAND 4 /* Generate RTL for this function. */
-
-/* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual
- sense of `same'. */
-#define same_type_p(type1, type2) \
- comptypes ((type1), (type2), COMPARE_STRICT)
-
-/* Returns nonzero iff TYPE1 and TYPE2 are the same type, ignoring
- top-level qualifiers. */
-#define same_type_ignoring_top_level_qualifiers_p(type1, type2) \
- same_type_p (TYPE_MAIN_VARIANT (type1), TYPE_MAIN_VARIANT (type2))
/* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2
is derived from TYPE1, or if TYPE2 is a pointer (reference) to a
#define TEMPLATE_PARM_ORIG_LEVEL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->orig_level)
#define TEMPLATE_PARM_DECL(NODE) (TEMPLATE_PARM_INDEX_CAST (NODE)->decl)
-/* These macros are for accessing the fields of TEMPLATE_TYPE_PARM
- and TEMPLATE_TEMPLATE_PARM nodes. */
+/* These macros are for accessing the fields of TEMPLATE_TYPE_PARM,
+ TEMPLATE_TEMPLATE_PARM and BOUND_TEMPLATE_TEMPLATE_PARM nodes. */
#define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE))
#define TEMPLATE_TYPE_IDX(NODE) \
(TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE)))
TS_FUNC_SCOPE = 1 << 8, /* show function scope */
TS_PEDANTIC_NAME = 1 << 9, /* pedantically name things */
TS_TEMPLATE_PREFIX= 1 << 10, /* show template <parms> prefix */
-
+
/* Internal use flags */
TS_TEMPLATE_PARM = 1 << 11, /* decl is really a non-type template parm */
TS_TEMPLATE_PLAIN = 1 << 12, /* don't decorate primary template_name */
-
+
TS_NEXT_BIT = 13 /* next available bit */
};
+/* Returns the TEMPLATE_DECL associated to a TEMPLATE_TEMPLATE_PARM
+ node. */
+#define TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL(NODE) \
+ ((TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM) \
+ ? TYPE_TI_TEMPLATE (NODE) \
+ : TYPE_NAME (NODE))
+
/* in lex.c */
/* Indexed by TREE_CODE, these tables give C-looking names to
operators represented by TREE_CODES. For example,
opname_tab[(int) MINUS_EXPR] == "-". */
extern const char **opname_tab, **assignop_tab;
-\f
+
+typedef struct operator_name_info_t
+{
+ /* The IDENTIFIER_NODE for the operator. */
+ tree identifier;
+ /* The name of the operator. */
+ const char *name;
+ /* The mangled name of the operator. */
+ const char *mangled_name;
+} operator_name_info_t;
+
+/* A mapping from tree codes to operator name information. */
+extern operator_name_info_t operator_name_info[];
+/* Similar, but for assignment operators. */
+extern operator_name_info_t assignment_operator_name_info[];
+
/* in call.c */
extern int check_dtor_name PARAMS ((tree, tree));
extern int get_arglist_len_in_bytes PARAMS ((tree));
extern tree build_vfield_ref PARAMS ((tree, tree));
-extern tree resolve_scope_to_name PARAMS ((tree, tree));
extern tree build_scoped_method_call PARAMS ((tree, tree, tree, tree));
extern tree build_addr_func PARAMS ((tree));
extern tree build_call PARAMS ((tree, tree));
extern tree build_vtbl_ref PARAMS ((tree, tree));
extern tree build_vfn_ref PARAMS ((tree *, tree, tree));
extern tree get_vtable_decl PARAMS ((tree, int));
-extern void add_method PARAMS ((tree, tree *, tree));
+extern void add_method PARAMS ((tree, tree, int));
extern int currently_open_class PARAMS ((tree));
extern tree currently_open_derived_class PARAMS ((tree));
extern tree get_vfield_offset PARAMS ((tree));
extern void pop_nested_class PARAMS ((void));
extern void push_lang_context PARAMS ((tree));
extern void pop_lang_context PARAMS ((void));
-extern tree instantiate_type PARAMS ((tree, tree, int));
+extern tree instantiate_type PARAMS ((tree, tree, enum instantiate_type_flags));
extern void print_class_statistics PARAMS ((void));
extern int first_vfun_index PARAMS ((tree));
extern void build_self_reference PARAMS ((void));
extern void note_name_declared_in_class PARAMS ((tree, tree));
extern tree get_vtbl_decl_for_binfo PARAMS ((tree));
extern tree in_charge_arg_for_name PARAMS ((tree));
+extern tree get_vtt_name PARAMS ((tree));
+extern tree get_primary_binfo PARAMS ((tree));
/* in cvt.c */
extern tree convert_to_reference PARAMS ((tree, tree, int, int, tree));
extern void begin_scope PARAMS ((scope_kind));
extern void finish_scope PARAMS ((void));
extern void note_level_for_for PARAMS ((void));
+extern void note_level_for_eh PARAMS ((void));
extern void resume_level PARAMS ((struct binding_level *));
extern void delete_block PARAMS ((tree));
extern void insert_block PARAMS ((tree));
extern void maybe_push_to_top_level PARAMS ((int));
extern void push_to_top_level PARAMS ((void));
extern void pop_from_top_level PARAMS ((void));
+extern void push_switch PARAMS ((tree));
+extern void pop_switch PARAMS ((void));
extern tree identifier_type_value PARAMS ((tree));
extern void set_identifier_type_value PARAMS ((tree, tree));
extern void pop_everything PARAMS ((void));
extern tree pushdecl PARAMS ((tree));
extern tree pushdecl_top_level PARAMS ((tree));
extern void pushdecl_class_level PARAMS ((tree));
-#if 0
-extern void pushdecl_nonclass_level PARAMS ((tree));
-#endif
extern tree pushdecl_namespace_level PARAMS ((tree));
extern tree push_using_decl PARAMS ((tree, tree));
extern tree push_using_directive PARAMS ((tree));
extern tree lookup_label PARAMS ((tree));
extern tree declare_local_label PARAMS ((tree));
extern tree define_label PARAMS ((const char *, int, tree));
-extern void push_switch PARAMS ((void));
-extern void pop_switch PARAMS ((void));
+extern void check_goto PARAMS ((tree));
extern void define_case_label PARAMS ((void));
extern tree getdecls PARAMS ((void));
extern tree gettags PARAMS ((void));
-#if 0
-extern void set_current_level_tags_transparency PARAMS ((int));
-#endif
extern tree binding_for_name PARAMS ((tree, tree));
extern tree namespace_binding PARAMS ((tree, tree));
extern void set_namespace_binding PARAMS ((tree, tree, tree));
extern int lookup_using_namespace PARAMS ((tree, tree, tree, tree, int, tree *));
extern int qualified_lookup_using_namespace PARAMS ((tree, tree, tree, int));
extern tree build_library_fn PARAMS ((tree, tree));
-extern tree build_cp_library_fn PARAMS ((tree, tree));
extern tree build_library_fn_ptr PARAMS ((const char *, tree));
extern tree build_cp_library_fn_ptr PARAMS ((const char *, tree));
extern tree push_library_fn PARAMS ((tree, tree));
-extern tree push_cp_library_fn PARAMS ((tree, tree));
extern tree push_void_library_fn PARAMS ((tree, tree));
extern tree push_throw_library_fn PARAMS ((tree, tree));
extern void init_decl_processing PARAMS ((void));
extern tree finish_enum PARAMS ((tree));
extern void build_enumerator PARAMS ((tree, tree, tree));
extern int start_function PARAMS ((tree, tree, tree, int));
-extern void expand_start_early_try_stmts PARAMS ((void));
-extern void store_parm_decls PARAMS ((void));
-extern void store_return_init PARAMS ((tree));
extern tree finish_function PARAMS ((int));
extern tree start_method PARAMS ((tree, tree, tree));
extern tree finish_method PARAMS ((tree));
extern void hack_incomplete_structures PARAMS ((tree));
extern tree maybe_build_cleanup PARAMS ((tree));
-extern void cplus_expand_expr_stmt PARAMS ((tree));
extern void finish_stmt PARAMS ((void));
extern void replace_defarg PARAMS ((tree, tree));
extern void print_other_binding_stack PARAMS ((struct binding_level *));
extern tree cp_namespace_decls PARAMS ((tree));
extern tree create_implicit_typedef PARAMS ((tree, tree));
extern tree maybe_push_decl PARAMS ((tree));
-extern void emit_local_var PARAMS ((tree));
extern tree build_target_expr_with_type PARAMS ((tree, tree));
-extern void make_rtl_for_local_static PARAMS ((tree));
extern int local_variable_p PARAMS ((tree));
extern int nonstatic_local_decl_p PARAMS ((tree));
extern tree declare_global_var PARAMS ((tree, tree));
extern tree groktypefield PARAMS ((tree, tree));
extern tree grokoptypename PARAMS ((tree, tree));
extern int copy_assignment_arg_p PARAMS ((tree, int));
-extern void cplus_decl_attributes PARAMS ((tree, tree, tree));
+extern void cplus_decl_attributes PARAMS ((tree, tree, tree));
extern tree constructor_name_full PARAMS ((tree));
extern tree constructor_name PARAMS ((tree));
-extern void setup_vtbl_ptr PARAMS ((void));
-extern void defer_fn PARAMS ((tree));
-extern tree get_temp_name PARAMS ((tree, int));
+extern void setup_vtbl_ptr PARAMS ((tree, tree));
+extern void defer_fn PARAMS ((tree));
+extern tree get_temp_name PARAMS ((tree));
extern void finish_anon_union PARAMS ((tree));
extern tree finish_table PARAMS ((tree, tree, tree, int));
extern void finish_builtin_type PARAMS ((tree, const char *,
extern tree build_expr_from_tree PARAMS ((tree));
extern tree reparse_decl_as_expr PARAMS ((tree, tree));
extern tree finish_decl_parsing PARAMS ((tree));
-extern tree check_cp_case_value PARAMS ((tree));
extern void set_decl_namespace PARAMS ((tree, tree, int));
extern tree current_decl_namespace PARAMS ((void));
extern void push_decl_namespace PARAMS ((tree));
extern tree handle_class_head PARAMS ((tree, tree, tree));
extern tree lookup_arg_dependent PARAMS ((tree, tree, tree));
extern void finish_static_data_member_decl PARAMS ((tree, tree, tree, int));
+extern tree build_artificial_parm PARAMS ((tree, tree));
+extern tree get_guard PARAMS ((tree));
+extern tree get_guard_cond PARAMS ((tree));
+extern tree set_guard PARAMS ((tree));
/* in parse.y */
extern void cp_parse_init PARAMS ((void));
extern const char *cp_file_of PARAMS ((tree));
extern int cp_line_of PARAMS ((tree));
extern const char *language_to_string PARAMS ((enum languages, int));
+extern void print_instantiation_context PARAMS ((void));
+/* cp_printer is the type of a function which converts an argument into
+ a string for digestion by printf. The cp_printer function should deal
+ with all memory management; the functions in errfn will not free
+ the char*s returned. See error.c for an example use of this code. */
+typedef const char *cp_printer PARAMS ((tree, int));
+extern cp_printer *cp_printers[256];
+
/* in except.c */
extern void init_exception_processing PARAMS ((void));
/* in expr.c */
extern void init_cplus_expand PARAMS ((void));
-extern void fixup_result_decl PARAMS ((tree, struct rtx_def *));
extern int extract_init PARAMS ((tree, tree));
-extern void do_case PARAMS ((tree, tree));
extern tree cplus_expand_constant PARAMS ((tree));
/* friend.c */
/* in init.c */
extern void init_init_processing PARAMS ((void));
-extern void emit_base_init PARAMS ((void));
-extern void expand_member_init PARAMS ((tree, tree, tree));
+extern void emit_base_init PARAMS ((tree, tree));
+extern tree expand_member_init PARAMS ((tree, tree, tree));
extern tree build_aggr_init PARAMS ((tree, tree, int));
extern int is_aggr_type PARAMS ((tree, int));
extern tree get_aggr_from_typedef PARAMS ((tree, int));
extern tree build_member_call PARAMS ((tree, tree, tree));
extern tree build_offset_ref PARAMS ((tree, tree));
extern tree resolve_offset_ref PARAMS ((tree));
-extern tree decl_constant_value PARAMS ((tree));
extern tree build_new PARAMS ((tree, tree, tree, int));
extern tree build_vec_init PARAMS ((tree, tree, tree, tree, int));
extern tree build_x_delete PARAMS ((tree, int, tree));
-extern tree build_delete PARAMS ((tree, tree, tree, int, int));
+extern tree build_delete PARAMS ((tree, tree, special_function_kind, int, int));
extern tree build_vbase_delete PARAMS ((tree, tree));
-extern tree build_vec_delete PARAMS ((tree, tree, tree, int));
+extern tree build_vec_delete PARAMS ((tree, tree, special_function_kind, int));
extern tree create_temporary_var PARAMS ((tree));
extern void begin_init_stmts PARAMS ((tree *, tree *));
extern tree finish_init_stmts PARAMS ((tree, tree));
extern tree make_reference_declarator PARAMS ((tree, tree));
extern tree make_call_declarator PARAMS ((tree, tree, tree, tree));
extern void set_quals_and_spec PARAMS ((tree, tree, tree));
-extern const char *operator_name_string PARAMS ((tree));
extern void lang_init PARAMS ((void));
extern void lang_finish PARAMS ((void));
-#if 0
-extern void reinit_lang_specific PARAMS ((void));
-#endif
-extern void reinit_parse_for_function PARAMS ((void));
extern void print_parse_statistics PARAMS ((void));
-extern void extract_interface_info PARAMS ((void));
extern void do_pending_inlines PARAMS ((void));
-extern void process_next_inline PARAMS ((struct pending_inline *));
-extern struct pending_input *save_pending_input PARAMS ((void));
-extern void restore_pending_input PARAMS ((struct pending_input *));
+extern void process_next_inline PARAMS ((struct unparsed_text *));
+
extern void yyungetc PARAMS ((int, int));
-extern void reinit_parse_for_method PARAMS ((int, tree));
-extern void reinit_parse_for_block PARAMS ((int, struct obstack *));
+extern void snarf_method PARAMS ((tree));
+
extern void check_for_missing_semicolon PARAMS ((tree));
extern void note_got_semicolon PARAMS ((tree));
extern void note_list_got_semicolon PARAMS ((tree));
extern void do_pending_lang_change PARAMS ((void));
-extern int identifier_type PARAMS ((tree));
extern void see_typename PARAMS ((void));
extern tree do_identifier PARAMS ((tree, int, tree));
extern tree do_scoped_id PARAMS ((tree, int));
extern tree identifier_typedecl_value PARAMS ((tree));
-extern int real_yylex PARAMS ((void));
-extern int is_rid PARAMS ((tree));
extern tree build_lang_decl PARAMS ((enum tree_code, tree, tree));
extern void retrofit_lang_decl PARAMS ((tree));
extern tree copy_decl PARAMS ((tree));
extern void copy_lang_decl PARAMS ((tree));
extern tree cp_make_lang_type PARAMS ((enum tree_code));
extern tree make_aggr_type PARAMS ((enum tree_code));
-extern void dump_time_statistics PARAMS ((void));
extern void compiler_error PARAMS ((const char *, ...))
ATTRIBUTE_PRINTF_1;
extern void yyerror PARAMS ((const char *));
extern void clear_inline_text_obstack PARAMS ((void));
extern void maybe_snarf_defarg PARAMS ((void));
-extern tree snarf_defarg PARAMS ((void));
extern void add_defarg_fn PARAMS ((tree));
extern void do_pending_defargs PARAMS ((void));
-extern int identifier_type PARAMS ((tree));
extern void yyhook PARAMS ((int));
extern int cp_type_qual_from_rid PARAMS ((tree));
extern void init_method PARAMS ((void));
extern char *build_overload_name PARAMS ((tree, int, int));
extern tree build_static_name PARAMS ((tree, tree));
-extern tree build_decl_overload PARAMS ((tree, tree, int));
extern tree build_decl_overload_real PARAMS ((tree, tree, tree, tree,
- tree, int));
+ tree, int));
extern void set_mangled_name_for_decl PARAMS ((tree));
extern tree build_typename_overload PARAMS ((tree));
extern tree build_overload_with_type PARAMS ((tree, tree));
extern tree build_destructor_name PARAMS ((tree));
extern tree build_opfncall PARAMS ((enum tree_code, int, tree, tree, tree));
extern tree hack_identifier PARAMS ((tree, tree));
-extern tree make_thunk PARAMS ((tree, int, int));
-extern void emit_thunk PARAMS ((tree));
+extern tree make_thunk PARAMS ((tree, tree, tree, int));
+extern void use_thunk PARAMS ((tree, int));
extern void synthesize_method PARAMS ((tree));
extern tree get_id_2 PARAMS ((const char *, tree));
extern tree implicitly_declare_fn PARAMS ((special_function_kind, tree, int));
/* in pt.c */
extern void init_pt PARAMS ((void));
extern void check_template_shadow PARAMS ((tree));
-extern tree innermost_args PARAMS ((tree));
+extern tree get_innermost_template_args PARAMS ((tree, int));
extern tree tsubst PARAMS ((tree, tree, int, tree));
extern tree tsubst_expr PARAMS ((tree, tree, int, tree));
extern tree tsubst_copy PARAMS ((tree, tree, int, tree));
extern tree instantiate_template PARAMS ((tree, tree));
extern void overload_template_name PARAMS ((tree));
extern int fn_type_unification PARAMS ((tree, tree, tree, tree, tree, unification_kind_t));
-struct tinst_level *tinst_for_decl PARAMS ((void));
+extern tree tinst_for_decl PARAMS ((void));
extern void mark_decl_instantiated PARAMS ((tree, int));
extern int more_specialized PARAMS ((tree, tree, tree));
extern void mark_class_instantiated PARAMS ((tree, int));
extern void do_decl_instantiation PARAMS ((tree, tree, tree));
-extern void do_type_instantiation PARAMS ((tree, tree));
+extern void do_type_instantiation PARAMS ((tree, tree, int));
extern tree instantiate_decl PARAMS ((tree, int));
extern tree get_bindings PARAMS ((tree, tree, tree));
-extern void add_tree PARAMS ((tree));
extern void add_maybe_template PARAMS ((tree, tree));
extern void pop_tinst_level PARAMS ((void));
extern int more_specialized_class PARAMS ((tree, tree));
extern int instantiate_pending_templates PARAMS ((void));
extern tree tsubst_default_argument PARAMS ((tree, tree, tree));
extern tree most_general_template PARAMS ((tree));
-
+extern tree get_mostly_instantiated_function_type PARAMS ((tree, tree *, tree *));
+extern int problematic_instantiation_changed PARAMS ((void));
+extern void record_last_problematic_instantiation PARAMS ((void));
+extern tree current_instantiation PARAMS ((void));
extern int processing_template_parmlist;
/* in repo.c */
extern int lookup_fnfields_1 PARAMS ((tree, tree));
extern tree lookup_fnfields PARAMS ((tree, tree, int));
extern tree lookup_member PARAMS ((tree, tree, int, int));
-extern tree lookup_nested_tag PARAMS ((tree, tree));
extern tree get_matching_virtual PARAMS ((tree, tree, int));
extern void get_pure_virtuals PARAMS ((tree));
extern tree init_vbase_pointers PARAMS ((tree, tree));
-extern void expand_indirect_vtbls_init PARAMS ((tree));
extern void get_vbase_types PARAMS ((tree));
extern void maybe_suppress_debug_info PARAMS ((tree));
extern void note_debug_info_needed PARAMS ((tree));
extern tree lookup_conversions PARAMS ((tree));
extern tree binfo_for_vtable PARAMS ((tree));
extern int binfo_from_vbase PARAMS ((tree));
-extern tree dfs_walk PARAMS ((tree,
+extern tree dfs_walk PARAMS ((tree,
tree (*)(tree, void *),
tree (*) (tree, void *),
void *));
-extern tree dfs_walk_real PARAMS ((tree,
+extern tree dfs_walk_real PARAMS ((tree,
tree (*) (tree, void *),
tree (*) (tree, void *),
tree (*) (tree, void *),
extern tree convert_pointer_to_vbase PARAMS ((tree, tree));
extern tree find_vbase_instance PARAMS ((tree, tree));
extern tree binfo_for_vbase PARAMS ((tree, tree));
+extern void fixup_all_virtual_upcast_offsets PARAMS ((tree));
/* in semantics.c */
+extern void init_cp_semantics PARAMS ((void));
extern void finish_expr_stmt PARAMS ((tree));
extern tree begin_if_stmt PARAMS ((void));
extern void finish_if_stmt_cond PARAMS ((tree, tree));
extern void finish_for_init_stmt PARAMS ((tree));
extern void finish_for_cond PARAMS ((tree, tree));
extern void finish_for_expr PARAMS ((tree, tree));
-extern void finish_for_stmt PARAMS ((tree, tree));
+extern void finish_for_stmt PARAMS ((tree));
extern void finish_break_stmt PARAMS ((void));
extern void finish_continue_stmt PARAMS ((void));
extern tree begin_switch_stmt PARAMS ((void));
extern void finish_switch_cond PARAMS ((tree, tree));
-extern void finish_switch_stmt PARAMS ((tree, tree));
+extern void finish_switch_stmt PARAMS ((tree));
extern void finish_case_label PARAMS ((tree, tree));
extern void finish_goto_stmt PARAMS ((tree));
extern tree begin_try_block PARAMS ((void));
extern void finish_member_declaration PARAMS ((tree));
extern void check_multiple_declarators PARAMS ((void));
extern tree finish_typeof PARAMS ((tree));
-extern void add_decl_stmt PARAMS ((tree));
extern void finish_decl_cleanup PARAMS ((tree, tree));
extern void finish_named_return_value PARAMS ((tree, tree));
-extern tree expand_stmt PARAMS ((tree));
extern void expand_body PARAMS ((tree));
-extern void begin_stmt_tree PARAMS ((tree *));
-extern void finish_stmt_tree PARAMS ((tree *));
extern void prep_stmt PARAMS ((tree));
-extern tree add_scope_stmt PARAMS ((int, int));
extern void do_pushlevel PARAMS ((void));
extern tree do_poplevel PARAMS ((void));
-/* Non-zero if we are presently building a statement tree, rather
- than expanding each statement as we encounter it. */
-#define building_stmt_tree() (last_tree != NULL_TREE)
+extern void finish_mem_initializers PARAMS ((tree));
+
+extern void clear_out_block PARAMS ((void));
+extern tree begin_global_stmt_expr PARAMS ((void));
+extern tree finish_global_stmt_expr PARAMS ((tree));
+
/* in spew.c */
extern void init_spew PARAMS ((void));
extern int peekyylex PARAMS ((void));
extern int yylex PARAMS ((void));
extern tree arbitrate_lookup PARAMS ((tree, tree, tree));
+extern tree frob_opname PARAMS ((tree));
/* in tree.c */
extern void init_tree PARAMS ((void));
extern int is_aggr_type_2 PARAMS ((tree, tree));
extern const char *lang_printable_name PARAMS ((tree, int));
extern tree build_exception_variant PARAMS ((tree, tree));
-extern tree copy_template_template_parm PARAMS ((tree));
+extern tree copy_template_template_parm PARAMS ((tree, tree));
extern void print_lang_statistics PARAMS ((void));
extern tree array_type_nelts_total PARAMS ((tree));
extern tree array_type_nelts_top PARAMS ((tree));
extern tree break_out_target_exprs PARAMS ((tree));
extern tree get_type_decl PARAMS ((tree));
extern tree vec_binfo_member PARAMS ((tree, tree));
-extern tree decl_namespace_context PARAMS ((tree));
+extern tree decl_namespace_context PARAMS ((tree));
extern tree lvalue_type PARAMS ((tree));
extern tree error_type PARAMS ((tree));
extern tree build_ptr_wrapper PARAMS ((void *));
extern tree build_dummy_object PARAMS ((tree));
extern tree maybe_dummy_object PARAMS ((tree, tree *));
extern int is_dummy_object PARAMS ((tree));
-typedef tree (*walk_tree_fn) PARAMS ((tree *, int *, void *));
-extern tree walk_tree PARAMS ((tree *, walk_tree_fn, void *));
+extern tree walk_tree PARAMS ((tree *,
+ walk_tree_fn,
+ void *,
+ htab_t));
+extern tree walk_tree_without_duplicates PARAMS ((tree *,
+ walk_tree_fn,
+ void *));
extern tree copy_tree_r PARAMS ((tree *, int *, void *));
extern int cp_valid_lang_attribute PARAMS ((tree, tree, tree, tree));
extern tree make_ptrmem_cst PARAMS ((tree, tree));
cp_build_qualified_type_real ((TYPE), (QUALS), /*complain=*/1)
extern tree build_shared_int_cst PARAMS ((int));
extern special_function_kind special_function_p PARAMS ((tree));
+extern int count_trees PARAMS ((tree));
+extern int char_type_p PARAMS ((tree));
+extern void verify_stmt_tree PARAMS ((tree));
+extern tree find_tree PARAMS ((tree, tree));
/* in typeck.c */
extern int string_conv_p PARAMS ((tree, tree, int));
extern int type_unknown_p PARAMS ((tree));
extern tree commonparms PARAMS ((tree, tree));
extern tree original_type PARAMS ((tree));
-extern tree common_type PARAMS ((tree, tree));
extern int comp_except_specs PARAMS ((tree, tree, int));
extern int comptypes PARAMS ((tree, tree, int));
extern int comp_target_types PARAMS ((tree, tree, int));
extern tree c_alignof PARAMS ((tree));
extern tree inline_conversion PARAMS ((tree));
extern tree decay_conversion PARAMS ((tree));
-extern tree default_conversion PARAMS ((tree));
extern tree build_object_ref PARAMS ((tree, tree, tree));
extern tree build_component_ref_1 PARAMS ((tree, tree, int));
extern tree build_component_ref PARAMS ((tree, tree, tree, int));
extern tree build_function_call_maybe PARAMS ((tree, tree));
extern tree convert_arguments PARAMS ((tree, tree, tree, int));
extern tree build_x_binary_op PARAMS ((enum tree_code, tree, tree));
-extern tree build_binary_op PARAMS ((enum tree_code, tree, tree));
extern tree build_x_unary_op PARAMS ((enum tree_code, tree));
-extern tree build_unary_op PARAMS ((enum tree_code, tree, int));
extern tree unary_complex_lvalue PARAMS ((enum tree_code, tree));
extern int mark_addressable PARAMS ((tree));
extern tree build_x_conditional_expr PARAMS ((tree, tree, tree));
extern tree build_modify_expr PARAMS ((tree, enum tree_code, tree));
extern tree dubious_conversion_warnings PARAMS ((tree, tree, const char *, tree, int));
extern tree convert_for_initialization PARAMS ((tree, tree, tree, int, const char *, tree, int));
-extern void c_expand_asm_operands PARAMS ((tree, tree, tree, tree, int, const char *, int));
-extern void c_expand_return PARAMS ((tree));
-extern tree c_expand_start_case PARAMS ((tree));
extern int comp_ptr_ttypes PARAMS ((tree, tree));
extern int ptr_reasonably_similar PARAMS ((tree, tree));
extern tree build_ptrmemfunc PARAMS ((tree, tree, int));
extern tree composite_pointer_type PARAMS ((tree, tree, tree, tree,
const char*));
extern tree check_return_expr PARAMS ((tree));
+#define cp_build_binary_op(code, arg1, arg2) \
+ build_binary_op(code, arg1, arg2, 1)
/* in typeck2.c */
extern tree error_not_base_type PARAMS ((tree, tree));
extern void readonly_error PARAMS ((tree, const char *, int));
extern int abstract_virtuals_error PARAMS ((tree, tree));
extern void incomplete_type_error PARAMS ((tree, tree));
-extern void my_friendly_abort PARAMS ((int))
+extern void friendly_abort PARAMS ((int, const char *,
+ int, const char *))
ATTRIBUTE_NORETURN;
-extern void my_friendly_assert PARAMS ((int, int));
+
+#define my_friendly_abort(N) \
+ friendly_abort (N, __FILE__, __LINE__, __FUNCTION__)
+#define my_friendly_assert(EXP, N) (void) \
+ (((EXP) == 0) ? (friendly_abort (N, __FILE__, __LINE__, __FUNCTION__), 0) : 0)
+
extern tree store_init_value PARAMS ((tree, tree));
extern tree digest_init PARAMS ((tree, tree, tree *));
extern tree build_scoped_ref PARAMS ((tree, tree));
extern tree build_x_arrow PARAMS ((tree));
extern tree build_m_component_ref PARAMS ((tree, tree));
extern tree build_functional_cast PARAMS ((tree, tree));
-extern char *enum_name_string PARAMS ((tree, tree));
-extern void report_case_error PARAMS ((int, tree, tree, tree));
extern void check_for_new_type PARAMS ((const char *, flagged_type_tree));
extern tree add_exception_specifier PARAMS ((tree, tree, int));
/* in dump.c */
extern void dump_node_to_file PARAMS ((tree, const char *));
+/* in mangle.c */
+extern void init_mangle PARAMS ((void));
+extern tree mangle_decl PARAMS ((tree));
+extern const char *mangle_type_string PARAMS ((tree));
+extern tree mangle_type PARAMS ((tree));
+extern tree mangle_typeinfo_for_type PARAMS ((tree));
+extern tree mangle_typeinfo_string_for_type PARAMS ((tree));
+extern tree mangle_vtbl_for_type PARAMS ((tree));
+extern tree mangle_vtt_for_type PARAMS ((tree));
+extern tree mangle_ctor_vtbl_for_type PARAMS ((tree, tree));
+extern tree mangle_thunk PARAMS ((tree, tree, tree));
+extern tree mangle_conv_op_name_for_type PARAMS ((tree));
+extern tree mangle_guard_variable PARAMS ((tree));
+
/* -- end of C++ */
#endif /* not _CP_TREE_H */