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 or BOUND_TEMPLATE_TEMPLATE_PARM,
+ For a TEMPLATE_TEMPLATE_PARM or BOUND_TEMPLATE_TEMPLATE_PARM,
this is TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO.
BINFO_VIRTUALS
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. */
#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__, \
__FUNCTION__); \
#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 error_locus;
};
-typedef struct
+typedef struct
{
tree t;
int new_type_flag;
tree lookups;
} flagged_type_tree;
-typedef struct
+typedef struct
{
struct tree_common common;
HOST_WIDE_INT index;
typedef struct ptrmem_cst
{
struct tree_common common;
- /* This isn't used, but the middle-end expects all constants to have
+ /* This isn't used, but the middle-end expects all constants to have
this field. */
struct rtx_def *rtl;
tree member;
/* 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 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_VMI_CLASS_DESC_TYPE,
CPTI_PTM_DESC_TYPE,
CPTI_BASE_DESC_TYPE,
-
+
CPTI_CLASS_TYPE,
CPTI_RECORD_TYPE,
CPTI_UNION_TYPE,
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;
|| 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. */
of this by updating the size of this bitfield whenever you add or
remove a flag. */
unsigned dummy : 8;
-
+
int vsize;
tree primary_base;
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)
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. */
/* 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, \
#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
/* 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
/* 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_LANG_SPECIFIC (NODE) \
+ (DECL_LANG_SPECIFIC (NODE) \
&& DECL_CLONED_FUNCTION (NODE) != NULL_TREE)
/* If DECL_CLONED_FUNCTION_P holds, this is the function that was
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) \
+#define DECL_OVERLOADED_OPERATOR_P(NODE) \
(IDENTIFIER_OPNAME_P (DECL_NAME ((NODE))) \
? DECL_LANG_SPECIFIC (NODE)->u2.operator_code : ERROR_MARK)
/* 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)
#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
(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'. */
but have not yet processed it. */
#define DECL_PENDING_INLINE_P(NODE) \
(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) \
/* 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
/* 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. */
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))
/* 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;
/* [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 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))
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)
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 \
#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)); \
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
#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,
+/* 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) \
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) \
+#define TEMPLATE_TEMPLATE_PARM_TEMPLATE_DECL(NODE) \
((TREE_CODE (NODE) == BOUND_TEMPLATE_TEMPLATE_PARM) \
- ? TYPE_TI_TEMPLATE (NODE) \
+ ? TYPE_TI_TEMPLATE (NODE) \
: TYPE_NAME (NODE))
/* in lex.c */
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 ((tree, tree));
-extern void defer_fn PARAMS ((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 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));
extern char *build_overload_name PARAMS ((tree, int, int));
extern tree build_static_name PARAMS ((tree, tree));
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 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 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 int is_dummy_object PARAMS ((tree));
extern tree walk_tree PARAMS ((tree *,
walk_tree_fn,
- void *,
+ void *,
htab_t));
extern tree walk_tree_without_duplicates PARAMS ((tree *,
walk_tree_fn,
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 tree condition_conversion 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_thunk PARAMS ((tree, tree, tree));
extern tree mangle_conv_op_name_for_type PARAMS ((tree));
extern tree mangle_guard_variable PARAMS ((tree));
TFF_CLASS_SCOPE: if possible, include the class-name part of a
qualified-id. This flag may be implied in some circumstances by
TFF_NAMESPACE_SCOPE.
- TFF_SCOPE: the combinaison of the two above.
+ TFF_SCOPE: the combinaison of the two above.
TFF_CHASE_TYPDEF: print the original type-id instead of the typedef-name.
TFF_DECL_SPECIFIERS: print decl-specifiers.
TFF_CLASS_KEY_OR_ENUM: precede a class-type name (resp. enum name) with
put_whitespace (TFI) = none; \
} while (0)
-typedef const char *cp_printer ();
-
#define obstack_chunk_alloc xmalloc
#define obstack_chunk_free free
# define OB_PUTI(CST) do { sprintf (digit_buffer, HOST_WIDE_INT_PRINT_DEC, (HOST_WIDE_INT)(CST)); \
OB_PUTCP (digit_buffer); } while (0)
-# define OB_END_TEMPLATE_ID() \
+# define OB_END_TEMPLATE_ID() \
(((obstack_next_free (&scratch_obstack) != obstack_base (&scratch_obstack) \
&& obstack_next_free (&scratch_obstack)[-1] == '>') \
? OB_PUTC (' ') : (void)0), OB_PUTC ('>'))
{
if (scope == NULL_TREE)
return;
-
+
if (TREE_CODE (scope) == NAMESPACE_DECL)
{
if (scope != global_namespace)
int ix;
int quals = TYPE_QUALS (t);
int do_after = p == after;
-
+
if (quals)
{
for (ix = 0; ix != 3; ix++)
dump_template_argument (arg, TS_PLAIN);
else
OB_PUTS ("{missing}");
-
+
++arg_idx;
need_comma = 1;
}
{
if (t == NULL_TREE)
return;
-
+
if (TYPE_PTRMEMFUNC_P (t))
goto offset_type;
break;
}
/* else fallthrough */
-
+
case TEMPLATE_DECL:
case NAMESPACE_DECL:
dump_decl (t, flags & ~TS_DECL_TYPE);
break;
-
+
case COMPLEX_TYPE:
OB_PUTS ("complex ");
dump_type (TREE_TYPE (t), flags);
enum tree_string_flags flags;
{
tree ctx = TYPE_CONTEXT (t);
-
+
if (TREE_CODE (ctx) == TYPENAME_TYPE)
dump_typename (ctx, flags);
else
OB_PUTCP (variety);
OB_PUTC (' ');
}
-
+
if (flags & TS_CHASE_TYPEDEFS)
t = TYPE_MAIN_VARIANT (t);
/* Because the template names are mangled, we have to locate
the most general template, and use that name. */
tree tpl = CLASSTYPE_TI_TEMPLATE (t);
-
+
while (DECL_TEMPLATE_INFO (tpl))
tpl = DECL_TI_TEMPLATE (tpl);
name = tpl;
deal with prefix and suffix.
Arrays must also do this for DECL nodes, like int a[], and for things like
- int *[]&.
-
+ int *[]&.
+
Return indicates how you should pad an object name after this. I.e. you
want to pad non-*, non-& cores, but not pad * or & types. */
enum tree_string_flags flags;
{
enum pad padding = before;
-
+
if (TYPE_PTRMEMFUNC_P (t))
{
t = TYPE_PTRMEMFUNC_FN_TYPE (t);
goto offset_type;
}
-
+
switch (TREE_CODE (t))
{
case POINTER_TYPE:
case REFERENCE_TYPE:
{
tree sub = TREE_TYPE (t);
-
+
padding = dump_type_prefix (sub, flags);
/* A tree for a member pointer looks like pointer to offset,
so let the OFFSET_TYPE case handle it. */
dump_type (t, flags);
padding = before;
break;
-
+
default:
sorry ("`%s' not supported by dump_type_prefix",
tree_code_name[(int) TREE_CODE (t)]);
OB_PUTC (']');
dump_type_suffix (TREE_TYPE (t), flags);
break;
-
+
case ENUMERAL_TYPE:
case IDENTIFIER_NODE:
case INTEGER_TYPE:
OB_PUTS ("destructors");
else
my_friendly_abort (352);
-
+
OB_PUTS (" for ");
OB_PUTCP (input_filename);
OB_PUTC (')');
}
if (flags & TS_DECORATE)
OB_PUTS ("typedef ");
- dump_simple_decl (t, DECL_ORIGINAL_TYPE (t)
+ dump_simple_decl (t, DECL_ORIGINAL_TYPE (t)
? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t),
flags);
break;
-
+
case VAR_DECL:
if (DECL_NAME (t) && VTABLE_NAME_P (DECL_NAME (t)))
{
dump_decl (TREE_OPERAND (t, 0), flags & ~TS_DECL_TYPE);
OB_PUTS ("::");
dump_decl (TREE_OPERAND (t, 1), flags);
- break;
+ break;
case ARRAY_REF:
dump_decl (TREE_OPERAND (t, 0), flags);
{
tree orig_parms = DECL_TEMPLATE_PARMS (t);
tree parms;
- int i;
-
+ int i;
+
if (flags & TS_TEMPLATE_PREFIX)
{
- for (parms = orig_parms = nreverse (orig_parms);
+ for (parms = orig_parms = nreverse (orig_parms);
parms;
parms = TREE_CHAIN (parms))
{
tree inner_parms = INNERMOST_TEMPLATE_PARMS (parms);
int len = TREE_VEC_LENGTH (inner_parms);
-
+
OB_PUTS ("template <");
for (i = 0; i < len; i++)
{
OB_PUTS ("static ");
else if (TYPE_POLYMORPHIC_P (t))
OB_PUTS ("virtual ");
-
+
/* Print the return type? */
if (show_return)
show_return = !DECL_CONV_FN_P (t) && !DECL_CONSTRUCTOR_P (t)
dump_scope (CP_DECL_CONTEXT (t), flags);
dump_function_name (t, flags);
-
+
if (!(flags & TS_DECL_TYPE))
return;
if (TREE_CODE (fntype) == METHOD_TYPE && parmtypes)
/* Skip "this" parameter. */
parmtypes = TREE_CHAIN (parmtypes);
-
+
/* Skip past the "in_charge" parameter. */
if (DECL_HAS_IN_CHARGE_PARM_P (t))
parmtypes = TREE_CHAIN (parmtypes);
-
+
dump_parameters (parmtypes, flags);
-
+
if (show_return)
dump_type_suffix (TREE_TYPE (fntype), flags);
if (TREE_CODE (fntype) == METHOD_TYPE)
dump_qualifiers (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (fntype))),
before);
-
+
if (flags & TS_FUNC_THROW)
dump_exception_spec (TYPE_RAISES_EXCEPTIONS (fntype), flags);
break;
}
dump_type (TREE_VALUE (parmtypes), flags);
-
+
if ((flags & TS_PARM_DEFAULTS) && TREE_PURPOSE (parmtypes))
{
OB_PUTS (" = ");
if (DECL_LANG_SPECIFIC (t) && DECL_TEMPLATE_INFO (t)
&& !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t)
- && (DECL_TEMPLATE_SPECIALIZATION (t)
+ && (DECL_TEMPLATE_SPECIALIZATION (t)
|| TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL
|| DECL_TEMPLATE_SPECIALIZATION (DECL_TI_TEMPLATE (t))
|| PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))))
enum tree_string_flags flags;
{
tree args = info ? TI_ARGS (info) : NULL_TREE;
-
+
if (primary && flags & TS_TEMPLATE_PLAIN)
return;
flags &= ~(TS_AGGR_TAGS | TS_TEMPLATE_PLAIN);
int len = 0;
int ix = 0;
int need_comma = 0;
-
+
if (TREE_CODE (args) == TREE_VEC)
{
if (TREE_VEC_LENGTH (args) > 0
- && TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
- args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
-
+ && TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
+ args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
+
len = TREE_VEC_LENGTH (args);
}
else if (TREE_CODE (args) == TREE_LIST)
}
if (need_comma)
OB_PUTS (", ");
-
+
if (!arg)
OB_PUTS ("{template parameter error}");
else
tree tpl = TI_TEMPLATE (info);
tree parms = DECL_TEMPLATE_PARMS (tpl);
int len, ix;
-
+
parms = TREE_CODE (parms) == TREE_LIST ? TREE_VALUE (parms) : NULL_TREE;
len = parms ? TREE_VEC_LENGTH (parms) : 0;
-
+
for (ix = 0; ix != len; ix++)
{
tree parm = TREE_VALUE (TREE_VEC_ELT (parms, ix));
if (ix)
OB_PUTS (", ");
-
+
dump_decl (parm, flags & ~TS_DECL_TYPE);
}
}
if (TREE_CODE (type) == ENUMERAL_TYPE)
{
tree values = TYPE_VALUES (type);
-
+
for (; values;
values = TREE_CHAIN (values))
if (tree_int_cst_equal (TREE_VALUE (values), t))
break;
-
+
if (values)
OB_PUTID (TREE_PURPOSE (values));
else
case AGGR_INIT_EXPR:
{
tree fn = NULL_TREE;
-
+
if (TREE_CODE (TREE_OPERAND (t, 0)) == ADDR_EXPR)
fn = TREE_OPERAND (TREE_OPERAND (t, 0), 0);
{
tree fn = TREE_OPERAND (t, 0);
tree args = TREE_OPERAND (t, 1);
-
+
if (TREE_CODE (fn) == ADDR_EXPR)
fn = TREE_OPERAND (fn, 0);
/* An ADDR_EXPR can have reference type. In that case, we
shouldn't print the `&' doing so indicates to the user
that the expression has pointer type. */
- || (TREE_TYPE (t)
+ || (TREE_TYPE (t)
&& TREE_CODE (TREE_TYPE (t)) == REFERENCE_TYPE))
dump_expr (TREE_OPERAND (t, 0), flags | TS_EXPR_PARENS);
else
while (TREE_CODE (next) == POINTER_TYPE)
next = TREE_TYPE (next);
-
+
if (TREE_CODE (next) == FUNCTION_TYPE)
{
if (flags & TS_EXPR_PARENS)
t = TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (TREE_TYPE (t)));
t = TYPE_METHOD_BASETYPE (t);
virtuals = TYPE_BINFO_VIRTUALS (TYPE_MAIN_VARIANT (t));
-
+
n = tree_low_cst (idx, 0) - first_vfun_index (t);
/* Map vtable index back one, to allow for the null pointer to
case ALIGNOF_EXPR:
if (TREE_CODE (t) == SIZEOF_EXPR)
OB_PUTS ("sizeof (");
- else
+ else
{
my_friendly_assert (TREE_CODE (t) == ALIGNOF_EXPR, 0);
OB_PUTS ("__alignof__ (");
dump_expr (TREE_OPERAND (t, 1), flags & ~TS_EXPR_PARENS);
OB_PUTS ("} ");
break;
-
+
case LOOP_EXPR:
OB_PUTS ("while (1) { ");
dump_expr (TREE_OPERAND (t, 0), flags & ~TS_EXPR_PARENS);
OB_PUTID (DECL_NAME (TREE_VALUE (t)));
break;
}
- /* else fall through */
+ /* else fall through */
/* This list is incomplete, but should suffice for now.
It is very important that `sorry' does not call
enum tree_string_flags flags;
{
OB_INIT ();
-
+
dump_scope (context, flags);
-
+
OB_FINISH ();
return (char *)obstack_base (&scratch_obstack);
else if (TREE_CODE (decl) == FUNCTION_DECL)
flags |= TS_DECL_TYPE | TS_FUNC_NORETURN;
flags |= TS_TEMPLATE_PREFIX;
-
+
OB_INIT ();
dump_decl (decl, flags);
int verbose;
{
enum tree_string_flags flags;
-
+
flags = TS_FUNC_THROW | TS_DECL_TYPE;
if (verbose)
flags |= TS_PARM_DEFAULTS;
OB_INIT ();
dump_decl (fndecl, flags);
-
+
OB_FINISH ();
return (char *)obstack_base (&scratch_obstack);
int verbose;
{
enum tree_string_flags flags;
-
+
flags = 0;
if (verbose)
flags |= TS_AGGR_TAGS;
flags |= TS_TEMPLATE_PREFIX;
-
+
OB_INIT ();
dump_type (typ, flags);
enum tree_string_flags flags = 0;
if (verbose)
flags |= TS_AGGR_TAGS;
-
+
if (p == NULL_TREE)
return "";
os = output_buffer_state (buffer);
output_set_prefix (buffer, prefix);
-
+
if (current_function_decl == NULL)
output_add_string (buffer, "At global scope:");
else
{
if (current_function_decl == TINST_DECL (p))
/* Avoid redundancy with the the "In function" line. */;
- else
+ else
output_verbatim (buffer, "%s: In instantiation of `%s':\n", file,
decl_as_string (TINST_DECL (p),
TS_DECL_TYPE | TS_FUNC_NORETURN));
-
+
line = TINST_LINE (p);
file = TINST_FILE (p);
p = TREE_CHAIN (p);
}
}
-
+
print_instantiation_partial_context (buffer, p, file, line);
}
| TFF_FUNCTION_DEFAULT_ARGUMENTS;
print_function_argument_list (buffer, &tfi);
break;
-
+
case 'D':
tree_being_formatted (&tfi) =
va_arg (output_buffer_format_args (buffer), tree);
| TFF_EXCEPTION_SPECIFICATION | TFF_CHASE_NAMESPACE_ALIAS;
print_declaration (buffer, &tfi);
break;
-
+
case 'E':
tree_being_formatted (&tfi) =
va_arg (output_buffer_format_args (buffer), tree);
tree_formatting_flags (&tfi) = TFF_SCOPE;
print_expression (buffer, &tfi);
break;
-
+
case 'F':
tree_being_formatted (&tfi) =
va_arg (output_buffer_format_args (buffer), tree);
if (be_verbose)
tree_formatting_flags (&tfi) = TFF_SCOPE | TFF_DECL_SPECIFIERS
| TFF_RETURN_TYPE | TFF_FUNCTION_DEFAULT_ARGUMENTS
- | TFF_EXCEPTION_SPECIFICATION;
+ | TFF_EXCEPTION_SPECIFICATION;
print_function_declaration (buffer, &tfi);
break;
-
+
case 'P':
print_function_parameter
(buffer, va_arg (output_buffer_format_args (buffer), int));
break;
-
+
case 'T':
tree_being_formatted (&tfi) =
va_arg (output_buffer_format_args (buffer), tree);
| TFF_RETURN_TYPE | TFF_EXCEPTION_SPECIFICATION;
print_type_id (buffer, &tfi);
break;
-
+
case 'V':
tree_being_formatted (&tfi) =
va_arg (output_buffer_format_args (buffer), tree);
print_cv_qualifier_seq (buffer, &tfi);
break;
-
+
default:
return 0;
}
-
+
return 1;
}
}
/* Print a declaration represented by tree_being_formatted (TFI)
- onto buffer. */
+ onto buffer. */
static void
print_declaration (buffer, tfi)
output_buffer *buffer __attribute__ ((__unused__));
if (flags & TFF_CHASE_TYPEDEF)
tree_being_formatted (tfi) =
typedef_original_name (tree_being_formatted (tfi));
-
+
/* A type-id is of the form:
type-id:
type-specifier-seq abstract-declarator(opt) */
case FUNCTION_TYPE:
ptr_mem_fun:
print_rest_of_abstract_declarator (buffer, tfi);
-
+
default:
break;
}
/* Because the abstract-declarator can modify the type-specifier-seq
in a highly non linear manner, we pretty-print its prefix here.
The suffix part is handled by print_rest_of_abstract_declarator. */
-
+
/* A RECORD_TYPE is also used to represent a pointer to member
function. */
case RECORD_TYPE:
TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (t));
print_type_id (buffer, tfi);
print_whitespace (buffer, tfi);
-
+
/* Then the beginning of the abstract-declarator part. */
tree_being_formatted (tfi) =
TYPE_METHOD_BASETYPE (TYPE_PTRMEMFUNC_FN_TYPE (t));
tree_being_formatted (tfi) = TREE_TYPE (t);
print_type_id (buffer, tfi);
print_whitespace (buffer, tfi);
-
+
/* Then, the containing class. */
tree_being_formatted (tfi) = TYPE_OFFSET_BASETYPE (t);
print_nested_name_specifier (buffer, tfi);
{
tree t = tree_being_formatted (tfi);
enum tree_code code = TREE_CODE (t);
-
+
/* An abstract-declarator has the form:
-
+
abstract-declarator:
ptr-operator abstract-declarator(opt)
direct-abstract-declarator
sorry_for_unsupported_tree (t);
/* fall throught. */
case ERROR_MARK:
- break;
+ break;
}
}
print_identifier (buffer, qualifier[i]);
put_whitespace (tfi) = before;
}
-
+
if (pad_after)
{
output_add_space (buffer);
}
}
- tree_being_formatted (tfi) = t;
+ tree_being_formatted (tfi) = t;
}
static void