1/* Definitions for C++ parsing and type checking. 2 Copyright (C) 1987, 92-97, 1998, 1999 Free Software Foundation, Inc. 3 Hacked by Michael Tiemann (tiemann@cygnus.com) 4 5This file is part of GNU CC. 6 7GNU CC is free software; you can redistribute it and/or modify 8it under the terms of the GNU General Public License as published by 9the Free Software Foundation; either version 2, or (at your option) 10any later version. 11 12GNU CC is distributed in the hope that it will be useful, 13but WITHOUT ANY WARRANTY; without even the implied warranty of 14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15GNU General Public License for more details. 16 17You should have received a copy of the GNU General Public License 18along with GNU CC; see the file COPYING. If not, write to 19the Free Software Foundation, 59 Temple Place - Suite 330, 20Boston, MA 02111-1307, USA. */ 21 22#ifndef _CP_TREE_H 23#define _CP_TREE_H 24 25/* Usage of TREE_LANG_FLAG_?: 26 0: BINFO_MARKED (BINFO nodes). 27 COMPOUND_STMT_NO_SCOPE (in COMPOUND_STMT). 28 NEW_EXPR_USE_GLOBAL (in NEW_EXPR). 29 DELETE_EXPR_USE_GLOBAL (in DELETE_EXPR). 30 LOOKUP_EXPR_GLOBAL (in LOOKUP_EXPR). 31 TREE_NEGATED_INT (in INTEGER_CST). 32 TREE_INDIRECT_USING (in NAMESPACE_DECL). 33 IDENTIFIER_MARKED (used by search routines). 34 LOCAL_BINDING_P (in CPLUS_BINDING) 35 1: IDENTIFIER_VIRTUAL_P. 36 TI_PENDING_TEMPLATE_FLAG. 37 TEMPLATE_PARMS_FOR_INLINE. 38 DELETE_EXPR_USE_VEC (in DELETE_EXPR). 39 (TREE_CALLS_NEW) (in _EXPR or _REF) (commented-out). 40 TYPE_USES_COMPLEX_INHERITANCE (in _TYPE). 41 C_DECLARED_LABEL_FLAG. 42 INHERITED_VALUE_BINDING_P (in CPLUS_BINDING) 43 BASELINK_P (in TREE_LIST) 44 2: IDENTIFIER_OPNAME_P. 45 BINFO_VBASE_MARKED. 46 BINFO_FIELDS_MARKED. 47 TYPE_VIRTUAL_P. 48 3: TYPE_USES_VIRTUAL_BASECLASSES (in a class TYPE). 49 BINFO_VTABLE_PATH_MARKED. 50 BINFO_PUSHDECLS_MARKED. 51 (TREE_REFERENCE_EXPR) (in NON_LVALUE_EXPR) (commented-out). 52 4: BINFO_NEW_VTABLE_MARKED. 53 TREE_HAS_CONSTRUCTOR (in INDIRECT_REF, SAVE_EXPR, CONSTRUCTOR, 54 or FIELD_DECL). 55 5: TYPE_USES_PVBASES (in a class TYPE). 56 6: Not used. 57 58 Usage of TYPE_LANG_FLAG_?: 59 0: C_TYPE_FIELDS_READONLY (in RECORD_TYPE or UNION_TYPE). 60 1: TYPE_HAS_CONSTRUCTOR. 61 2: TYPE_HAS_DESTRUCTOR. 62 3: TYPE_FOR_JAVA. 63 4: TYPE_NEEDS_DESTRUCTOR. 64 5: IS_AGGR_TYPE. 65 6: TYPE_BUILT_IN. 66 67 Usage of DECL_LANG_FLAG_?: 68 0: DECL_ERROR_REPORTED (in VAR_DECL). 69 DECL_TEMPLATE_PARM_P (in CONST_DECL, TYPE_DECL, or TEMPLATE_DECL) 70 1: C_TYPEDEF_EXPLICITLY_SIGNED (in TYPE_DECL). 71 DECL_TEMPLATE_INSTANTIATED (in a VAR_DECL or a FUNCTION_DECL) 72 2: DECL_THIS_EXTERN (in VAR_DECL or FUNCTION_DECL). 73 3: DECL_IN_AGGR_P. 74 4: DECL_MAYBE_TEMPLATE. 75 5: DECL_INTERFACE_KNOWN. 76 6: DECL_THIS_STATIC (in VAR_DECL or FUNCTION_DECL). 77 7: DECL_DEAD_FOR_LOCAL (in VAR_DECL). 78 79 Usage of language-independent fields in a language-dependent manner: 80 81 TYPE_ALIAS_SET 82 This field is used by TYPENAME_TYPEs, TEMPLATE_TYPE_PARMs, and so 83 forth as a substitute for the mark bits provided in `lang_type'. 84 At present, only the six low-order bits are used. 85 86 TYPE_BINFO 87 For an ENUMERAL_TYPE, this is ENUM_TEMPLATE_INFO. 88 For a TYPENAME_TYPE, this is TYPENAME_TYPE_FULLNAME. 89 For a TEMPLATE_TEMPLATE_PARM, this is 90 TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO. 91 92 DECL_SAVED_INSNS/DECL_FIELD_SIZE 93 For a static VAR_DECL, this is DECL_INIT_PRIORITY. 94*/ 95 96/* Language-dependent contents of an identifier. */ 97 98struct lang_identifier 99{ 100 struct tree_identifier ignore; 101 tree namespace_bindings; 102 tree bindings; 103 tree class_value; 104 tree class_template_info; 105 struct lang_id2 *x; 106}; 107 108struct lang_id2 109{ 110 tree label_value, implicit_decl; 111 tree error_locus; 112}; 113 114typedef struct 115{ 116 tree t; 117 int new_type_flag; 118} flagged_type_tree; 119 120typedef struct 121{ 122 char common[sizeof (struct tree_common)]; 123 struct rtx_def *rtl; /* Unused, but required to match up with what 124 the middle-end expects. */ 125 HOST_WIDE_INT index; 126 HOST_WIDE_INT level; 127 HOST_WIDE_INT orig_level; 128 tree decl; 129} template_parm_index; 130 131typedef struct ptrmem_cst 132{ 133 char common[sizeof (struct tree_common)]; 134 tree member; 135}* ptrmem_cst_t; 136 137/* Nonzero if this binding is for a local scope, as opposed to a class 138 or namespace scope. */ 139#define LOCAL_BINDING_P(NODE) TREE_LANG_FLAG_0(NODE) 140 141/* Nonzero if BINDING_VALUE is from a base class of the class which is 142 currently being defined. */ 143#define INHERITED_VALUE_BINDING_P(NODE) TREE_LANG_FLAG_1(NODE) 144 145/* For a binding between a name and an entity at a non-local scope, 146 defines the scope where the binding is declared. (Either a class 147 _TYPE node, or a NAMESPACE_DECL.) This macro should be used only 148 for namespace-level bindings; on the IDENTIFIER_BINDING list 149 BINDING_LEVEL is used instead. */ 150#define BINDING_SCOPE(NODE) (((struct tree_binding*)NODE)->scope.scope) 151 152/* This is the declaration bound to the name. Possible values: 153 variable, overloaded function, namespace, template, enumerator. */ 154#define BINDING_VALUE(NODE) (((struct tree_binding*)NODE)->value) 155 156/* If name is bound to a type, this is the type (struct, union, enum). */ 157#define BINDING_TYPE(NODE) TREE_TYPE(NODE) 158 159#define IDENTIFIER_GLOBAL_VALUE(NODE) \ 160 namespace_binding (NODE, global_namespace) 161#define SET_IDENTIFIER_GLOBAL_VALUE(NODE, VAL) \ 162 set_namespace_binding (NODE, global_namespace, VAL) 163#define IDENTIFIER_NAMESPACE_VALUE(NODE) \ 164 namespace_binding (NODE, current_namespace) 165#define SET_IDENTIFIER_NAMESPACE_VALUE(NODE, VAL) \ 166 set_namespace_binding (NODE, current_namespace, VAL) 167 168struct tree_binding 169{ 170 char common[sizeof (struct tree_common)]; 171 union { 172 tree scope; 173 struct binding_level *level; 174 } scope; 175 tree value; 176}; 177 178/* The overloaded FUNCTION_DECL. */ 179#define OVL_FUNCTION(NODE) (((struct tree_overload*)NODE)->function) 180#define OVL_CHAIN(NODE) TREE_CHAIN(NODE) 181/* Polymorphic access to FUNCTION and CHAIN. */ 182#define OVL_CURRENT(NODE) \ 183 ((TREE_CODE(NODE)==OVERLOAD) ? OVL_FUNCTION(NODE) : NODE) 184#define OVL_NEXT(NODE) \ 185 ((TREE_CODE(NODE)==OVERLOAD) ? TREE_CHAIN(NODE) : NULL_TREE) 186/* If set, this was imported in a using declaration. 187 This is not to confuse with being used somewhere, which 188 is not important for this node. */ 189#define OVL_USED(NODE) TREE_USED(NODE) 190 191struct tree_overload 192{ 193 char common[sizeof (struct tree_common)]; 194 tree function; 195}; 196 197/* A `baselink' is a TREE_LIST whose TREE_PURPOSE is a BINFO 198 indicating a particular base class, and whose TREE_VALUE is a 199 (possibly overloaded) function from that base class. */ 200#define BASELINK_P(NODE) \ 201 (TREE_CODE ((NODE)) == TREE_LIST && TREE_LANG_FLAG_1 ((NODE))) 202#define SET_BASELINK_P(NODE) \ 203 (TREE_LANG_FLAG_1 ((NODE)) = 1) 204 205#define WRAPPER_PTR(NODE) (((struct tree_wrapper*)NODE)->u.ptr) 206#define WRAPPER_INT(NODE) (((struct tree_wrapper*)NODE)->u.i) 207 208struct tree_wrapper 209{ 210 char common[sizeof (struct tree_common)]; 211 union { 212 void *ptr; 213 int i; 214 } u; 215}; 216 217#define SRCLOC_FILE(NODE) (((struct tree_srcloc*)NODE)->filename) 218#define SRCLOC_LINE(NODE) (((struct tree_srcloc*)NODE)->linenum) 219struct tree_srcloc 220{ 221 char common[sizeof (struct tree_common)]; 222 char *filename; 223 int linenum; 224}; 225 226/* To identify to the debug emitters if it should pay attention to the 227 flag `-Wtemplate-debugging'. */ 228#define HAVE_TEMPLATES 1 229 230/* Macros for access to language-specific slots in an identifier. */ 231 232#define IDENTIFIER_NAMESPACE_BINDINGS(NODE) \ 233 (((struct lang_identifier *)(NODE))->namespace_bindings) 234#define IDENTIFIER_TEMPLATE(NODE) \ 235 (((struct lang_identifier *)(NODE))->class_template_info) 236 237/* The IDENTIFIER_BINDING is the innermost CPLUS_BINDING for the 238 identifier. It's TREE_CHAIN is the next outermost binding. Each 239 BINDING_VALUE is a DECL for the associated declaration. Thus, 240 name lookup consists simply of pulling off the node at the front 241 of the list (modulo oddities for looking up the names of types, 242 and such.) You can use BINDING_SCOPE or BINDING_LEVEL to 243 determine the scope that bound the name. */ 244#define IDENTIFIER_BINDING(NODE) \ 245 (((struct lang_identifier*) (NODE))->bindings) 246 247/* The IDENTIFIER_VALUE is the value of the IDENTIFIER_BINDING, or 248 NULL_TREE if there is no binding. */ 249#define IDENTIFIER_VALUE(NODE) \ 250 (IDENTIFIER_BINDING (NODE) \ 251 ? BINDING_VALUE (IDENTIFIER_BINDING (NODE)) \ 252 : NULL_TREE) 253 254/* If IDENTIFIER_CLASS_VALUE is set, then NODE is bound in the current 255 class, and IDENTIFIER_CLASS_VALUE is the value binding. This is 256 just a pointer to the BINDING_VALUE of one of the bindings in the 257 IDENTIFIER_BINDINGs list, so any time that this is non-NULL so is 258 IDENTIFIER_BINDING. */ 259#define IDENTIFIER_CLASS_VALUE(NODE) \ 260 (((struct lang_identifier *) (NODE))->class_value) 261 262/* The amount of time used by the file whose special "time identifier" 263 is NODE, represented as an INTEGER_CST. See get_time_identifier. */ 264#define TIME_IDENTIFIER_TIME(NODE) IDENTIFIER_BINDING(NODE) 265 266/* For a "time identifier" this is a INTEGER_CST. The 267 TREE_INT_CST_LOW is 1 if the corresponding file is "interface only". 268 The TRE_INT_CST_HIGH is 1 if it is "interface unknown". */ 269#define TIME_IDENTIFIER_FILEINFO(NODE) IDENTIFIER_CLASS_VALUE (NODE) 270 271/* TREE_TYPE only indicates on local and class scope the current 272 type. For namespace scope, the presence of a type in any namespace 273 is indicated with global_type_node, and the real type behind must 274 be found through lookup. */ 275#define IDENTIFIER_TYPE_VALUE(NODE) (identifier_type_value(NODE)) 276#define REAL_IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE)) 277#define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE) 278#define IDENTIFIER_HAS_TYPE_VALUE(NODE) (IDENTIFIER_TYPE_VALUE (NODE) ? 1 : 0) 279 280#define LANG_ID_FIELD(NAME,NODE) \ 281 (((struct lang_identifier *)(NODE))->x \ 282 ? ((struct lang_identifier *)(NODE))->x->NAME : 0) 283#define SET_LANG_ID(NODE,VALUE,NAME) \ 284 (((struct lang_identifier *)(NODE))->x == 0 \ 285 ? ((struct lang_identifier *)(NODE))->x \ 286 = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \ 287 ((struct lang_identifier *)(NODE))->x->NAME = (VALUE)) 288 289#define IDENTIFIER_LABEL_VALUE(NODE) LANG_ID_FIELD(label_value, NODE) 290#define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE) \ 291 SET_LANG_ID(NODE, VALUE, label_value) 292 293#define IDENTIFIER_IMPLICIT_DECL(NODE) LANG_ID_FIELD(implicit_decl, NODE) 294#define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \ 295 SET_LANG_ID(NODE, VALUE, implicit_decl) 296 297#define IDENTIFIER_ERROR_LOCUS(NODE) LANG_ID_FIELD(error_locus, NODE) 298#define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \ 299 SET_LANG_ID(NODE, VALUE, error_locus) 300 301 302#define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE) 303 304/* Nonzero if this identifier is the prefix for a mangled C++ operator name. */ 305#define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE) 306 307/* Nonzero if this identifier is the name of a type-conversion 308 operator. */ 309#define IDENTIFIER_TYPENAME_P(NODE) \ 310 (! strncmp (IDENTIFIER_POINTER (NODE), \ 311 OPERATOR_TYPENAME_FORMAT, \ 312 strlen (OPERATOR_TYPENAME_FORMAT))) 313 314/* Nonzero means reject anything that ANSI standard C forbids. */ 315extern int pedantic; 316 317/* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ 318#define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type) 319 320/* Record in each node resulting from a binary operator 321 what operator was specified for it. */ 322#define C_EXP_ORIGINAL_CODE(exp) ((enum tree_code) TREE_COMPLEXITY (exp)) 323 324/* Store a value in that field. */ 325#define C_SET_EXP_ORIGINAL_CODE(exp, code) \ 326 (TREE_COMPLEXITY (exp) = (int)(code)) 327 328/* If non-zero, a VAR_DECL whose cleanup will cause a throw to the 329 next exception handler. */ 330extern tree exception_throw_decl; 331 332extern tree double_type_node, long_double_type_node, float_type_node; 333extern tree char_type_node, unsigned_char_type_node, signed_char_type_node; 334extern tree ptrdiff_type_node; 335 336extern tree short_integer_type_node, short_unsigned_type_node; 337extern tree long_integer_type_node, long_unsigned_type_node; 338extern tree long_long_integer_type_node, long_long_unsigned_type_node; 339extern tree unsigned_type_node; 340extern tree string_type_node, char_array_type_node, int_array_type_node; 341extern tree wchar_array_type_node; 342extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node; 343 344extern tree complex_integer_type_node; 345extern tree complex_float_type_node; 346extern tree complex_double_type_node; 347extern tree complex_long_double_type_node; 348 349extern tree intQI_type_node, unsigned_intQI_type_node; 350extern tree intHI_type_node, unsigned_intHI_type_node; 351extern tree intSI_type_node, unsigned_intSI_type_node; 352extern tree intDI_type_node, unsigned_intDI_type_node; 353#if HOST_BITS_PER_WIDE_INT >= 64 354extern tree intTI_type_node, unsigned_intTI_type_node; 355#endif 356 357extern tree java_byte_type_node; 358extern tree java_short_type_node; 359extern tree java_int_type_node; 360extern tree java_long_type_node; 361extern tree java_float_type_node; 362extern tree java_double_type_node; 363extern tree java_char_type_node; 364extern tree java_boolean_type_node; 365 366extern int current_function_returns_value; 367extern int current_function_returns_null; 368extern tree current_function_return_value; 369 370extern tree current_namespace; 371extern tree global_namespace; 372 373extern tree ridpointers[]; 374extern tree ansi_opname[]; 375extern tree ansi_assopname[]; 376 377/* Nonzero means `$' can be in an identifier. */ 378 379extern int dollars_in_ident; 380 381/* Nonzero means allow type mismatches in conditional expressions; 382 just make their values `void'. */ 383 384extern int flag_cond_mismatch; 385 386/* Nonzero means don't recognize the keyword `asm'. */ 387 388extern int flag_no_asm; 389 390/* For cross referencing. */ 391 392extern int flag_gnu_xref; 393 394/* For environments where you can use GNU binutils (as, ld in particular). */ 395 396extern int flag_gnu_binutils; 397 398/* Nonzero means warn about implicit declarations. */ 399 400extern int warn_implicit; 401 402/* Nonzero means warn about usage of long long when `-pedantic'. */ 403 404extern int warn_long_long; 405 406/* Nonzero means warn when all ctors or dtors are private, and the class 407 has no friends. */ 408 409extern int warn_ctor_dtor_privacy; 410 411/* Nonzero means warn about function definitions that default the return type 412 or that use a null return and have a return-type other than void. */ 413 414extern int warn_return_type; 415 416/* Nonzero means give string constants the type `const char *', as mandated 417 by the standard. */ 418 419extern int flag_const_strings; 420 421/* Nonzero means warn about deprecated conversion from string constant to 422 `char *'. */ 423 424extern int warn_write_strings; 425 426/* Nonzero means warn about sizeof(function) or addition/subtraction 427 of function pointers. */ 428 429extern int warn_pointer_arith; 430 431/* Nonzero means warn about suggesting putting in ()'s. */ 432 433extern int warn_parentheses; 434 435/* Nonzero means warn about multiple (redundant) decls for the same single 436 variable or function. */ 437 438extern int warn_redundant_decls; 439 440/* Warn if initializer is not completely bracketed. */ 441 442extern int warn_missing_braces; 443 444/* Warn about comparison of signed and unsigned values. */ 445 446extern int warn_sign_compare; 447 448/* Warn about a subscript that has type char. */ 449 450extern int warn_char_subscripts; 451 452/* Nonzero means warn about pointer casts that can drop a type qualifier 453 from the pointer target type. */ 454 455extern int warn_cast_qual; 456 457/* Warn about *printf or *scanf format/argument anomalies. */ 458 459extern int warn_format; 460 461/* Nonzero means warn about non virtual destructors in classes that have 462 virtual functions. */ 463 464extern int warn_nonvdtor; 465 466/* Non-zero means warn when we convert a pointer to member function 467 into a pointer to (void or function). */ 468 469extern int warn_pmf2ptr; 470 471/* Nonzero means warn about violation of some Effective C++ style rules. */ 472 473extern int warn_ecpp; 474 475/* Nonzero means warn where overload resolution chooses a promotion from 476 unsigned to signed over a conversion to an unsigned of the same size. */ 477 478extern int warn_sign_promo; 479 480/* Non-zero means warn when a function is declared extern and later inline. */ 481 482extern int warn_extern_inline; 483 484/* Non-zero means warn when an old-style cast is used. */ 485 486extern int warn_old_style_cast; 487 488/* Nonzero means to treat bitfields as unsigned unless they say `signed'. */ 489 490extern int flag_signed_bitfields; 491 492/* 3 means write out only virtuals function tables `defined' 493 in this implementation file. 494 2 means write out only specific virtual function tables 495 and give them (C) public access. 496 1 means write out virtual function tables and give them 497 (C) public access. 498 0 means write out virtual function tables and give them 499 (C) static access (default). 500 -1 means declare virtual function tables extern. */ 501 502extern int write_virtuals; 503 504/* True for more efficient but incompatible (not fully tested) 505 vtable implementation (using thunks). 506 0 is old behavior; 1 is new behavior; 3 adds vlist arguments; 507 2 is 3 plus backwards-compatibility to 1. */ 508extern int flag_vtable_thunks, flag_vtable_thunks_compat; 509 510/* INTERFACE_ONLY nonzero means that we are in an "interface" 511 section of the compiler. INTERFACE_UNKNOWN nonzero means 512 we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN 513 is zero and INTERFACE_ONLY is zero, it means that we are responsible 514 for exporting definitions that others might need. */ 515extern int interface_only, interface_unknown; 516 517/* Nonzero means we should attempt to elide constructors when possible. */ 518 519extern int flag_elide_constructors; 520 521/* Nonzero means enable obscure ANSI features and disable GNU extensions 522 that might cause ANSI-compliant code to be miscompiled. */ 523 524extern int flag_ansi; 525 526/* Nonzero means recognize and handle signature language constructs. */ 527 528extern int flag_handle_signatures; 529 530/* Nonzero means that member functions defined in class scope are 531 inline by default. */ 532 533extern int flag_default_inline; 534 535/* The name-mangling scheme to use. Versions of gcc before 2.8 use 536 version 0. */ 537extern int name_mangling_version; 538 539/* Nonzero means that guiding declarations are allowed. */ 540extern int flag_guiding_decls; 541 542/* Nonzero if squashed mangling is to be performed. 543 This uses the B and K codes to reference previously seen class types 544 and class qualifiers. */ 545extern int flag_do_squangling; 546 547/* Nonzero means generate separate instantiation control files and juggle 548 them at link time. */ 549extern int flag_use_repository; 550 551/* Nonzero if we want to issue diagnostics that the standard says are not 552 required. */ 553extern int flag_optional_diags; 554 555/* Nonzero means do not consider empty argument prototype to mean function 556 takes no arguments. */ 557extern int flag_strict_prototype; 558 559/* Nonzero means output .vtable_{entry,inherit} for use in doing vtable gc. */ 560extern int flag_vtable_gc; 561 562/* Nonzero means make the default pedwarns warnings instead of errors. 563 The value of this flag is ignored if -pedantic is specified. */ 564extern int flag_permissive; 565 566/* Nonzero if we want to obey access control semantics. */ 567 568extern int flag_access_control; 569 570/* Nonzero to force the use of multiple symbol spaces */ 571int flag_multiple_symbol_spaces; 572 573 574/* C++ language-specific tree codes. */ 575#define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, 576enum cplus_tree_code { 577 __DUMMY = LAST_AND_UNUSED_TREE_CODE, 578#include "cp-tree.def" 579 LAST_CPLUS_TREE_CODE 580}; 581#undef DEFTREECODE 582 583enum languages { lang_c, lang_cplusplus, lang_java }; 584 585/* Macros to make error reporting functions' lives easier. */ 586#define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE))) 587#define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE))) 588#define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE))) 589 590#define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) 591#define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) 592 593/* The _DECL for this _TYPE. */ 594#define TYPE_MAIN_DECL(NODE) (TYPE_STUB_DECL (TYPE_MAIN_VARIANT (NODE))) 595 596/* Nonzero if T is a class (or struct or union) type. Also nonzero 597 for template type parameters and typename types. Despite its name, 598 this macro has nothing to do with the definition of aggregate given 599 in the standard. Think of this macro as MAYBE_CLASS_TYPE_P. */ 600#define IS_AGGR_TYPE(t) \ 601 (TREE_CODE (t) == TEMPLATE_TYPE_PARM \ 602 || TREE_CODE (t) == TYPENAME_TYPE \ 603 || TREE_CODE (t) == TYPEOF_TYPE \ 604 || TYPE_LANG_FLAG_5 (t)) 605 606/* Set IS_AGGR_TYPE for T to VAL. T must be a class, struct, or 607 union type. */ 608#define SET_IS_AGGR_TYPE(T, VAL) \ 609 (TYPE_LANG_FLAG_5 (T) = (VAL)) 610 611/* Nonzero if T is a class type. Zero for template type parameters, 612 typename types, and so forth. */ 613#define CLASS_TYPE_P(t) \ 614 (IS_AGGR_TYPE_CODE (TREE_CODE (t)) && IS_AGGR_TYPE (t)) 615 616#define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE) 617#define IS_AGGR_TYPE_2(TYPE1,TYPE2) \ 618 (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \ 619 && IS_AGGR_TYPE (TYPE1)&IS_AGGR_TYPE (TYPE2)) 620#define IS_OVERLOAD_TYPE(t) \ 621 (IS_AGGR_TYPE (t) || TREE_CODE (t) == ENUMERAL_TYPE) 622 623/* In a *_TYPE, nonzero means a built-in type. */ 624#define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE) 625 626/* True if this a "Java" type, defined in 'extern "Java"'. */ 627#define TYPE_FOR_JAVA(NODE) TYPE_LANG_FLAG_3(NODE) 628 629/* The type qualifiers for this type, including the qualifiers on the 630 elements for an array type. */ 631#define CP_TYPE_QUALS(NODE) \ 632 ((TREE_CODE (NODE) != ARRAY_TYPE) \ 633 ? TYPE_QUALS (NODE) : cp_type_quals (NODE)) 634 635/* Nonzero if this type is const-qualified. */ 636#define CP_TYPE_CONST_P(NODE) \ 637 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_CONST) != 0) 638 639/* Nonzero if this type is volatile-qualified. */ 640#define CP_TYPE_VOLATILE_P(NODE) \ 641 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_VOLATILE) != 0) 642 643/* Nonzero if this type is restrict-qualified. */ 644#define CP_TYPE_RESTRICT_P(NODE) \ 645 ((CP_TYPE_QUALS (NODE) & TYPE_QUAL_RESTRICT) != 0) 646 647/* Nonzero if this type is const-qualified, but not 648 volatile-qualified. Other qualifiers are ignored. This macro is 649 used to test whether or not it is OK to bind an rvalue to a 650 reference. */ 651#define CP_TYPE_CONST_NON_VOLATILE_P(NODE) \ 652 ((CP_TYPE_QUALS (NODE) & (TYPE_QUAL_CONST | TYPE_QUAL_VOLATILE)) \ 653 == TYPE_QUAL_CONST) 654 655#define DELTA_FROM_VTABLE_ENTRY(ENTRY) \ 656 (!flag_vtable_thunks ? \ 657 TREE_VALUE (CONSTRUCTOR_ELTS (ENTRY)) \ 658 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? integer_zero_node \ 659 : build_int_2 (THUNK_DELTA (TREE_OPERAND ((ENTRY), 0)), 0)) 660 661/* Virtual function addresses can be gotten from a virtual function 662 table entry using this macro. */ 663#define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \ 664 (!flag_vtable_thunks ? \ 665 TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) \ 666 : TREE_CODE (TREE_OPERAND ((ENTRY), 0)) != THUNK_DECL ? (ENTRY) \ 667 : DECL_INITIAL (TREE_OPERAND ((ENTRY), 0))) 668#define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \ 669 (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE)) 670#define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE)))) 671#define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \ 672 (((CODE) == TREE_CODE (NODE) \ 673 && IS_AGGR_TYPE (TREE_TYPE (NODE))) \ 674 || IS_AGGR_TYPE (NODE)) 675 676/* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can 677 be an ambiguous base class of TYPE, and this macro will be false. */ 678#define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) >= 0) 679#define ACCESSIBLY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, -1, (tree *)0) >= 0) 680#define ACCESSIBLY_UNIQUELY_DERIVED_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 1, (tree *)0) >= 0) 681#define DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) != -1) 682 683/* This structure provides additional information above and beyond 684 what is provide in the ordinary tree_type. In the past, we used it 685 for the types of class types, template parameters types, typename 686 types, and so forth. However, there can be many (tens to hundreds 687 of thousands) of template parameter types in a compilation, and 688 there's no need for this additional information in that case. 689 Therefore, we now use this data structure only for class types. 690 691 In the past, it was thought that there would be relatively few 692 class types. However, in the presence of heavy use of templates, 693 many (i.e., thousands) of classes can easily be generated. 694 Therefore, we should endeavor to keep the size of this structure to 695 a minimum. */ 696struct lang_type 697{ 698 struct 699 { 700 unsigned has_type_conversion : 1; 701 unsigned has_init_ref : 1; 702 unsigned has_default_ctor : 1; 703 unsigned uses_multiple_inheritance : 1; 704 unsigned const_needs_init : 1; 705 unsigned ref_needs_init : 1; 706 unsigned has_const_assign_ref : 1; 707 unsigned anon_aggr : 1; 708 709 unsigned has_nonpublic_ctor : 2; 710 unsigned has_nonpublic_assign_ref : 2; 711 unsigned vtable_needs_writing : 1; 712 unsigned has_assign_ref : 1; 713 unsigned gets_new : 2; 714 715 unsigned gets_delete : 2; 716 unsigned has_call_overloaded : 1; 717 unsigned has_array_ref_overloaded : 1; 718 unsigned has_arrow_overloaded : 1; 719 unsigned interface_only : 1; 720 unsigned interface_unknown : 1; 721 unsigned needs_virtual_reinit : 1; 722 723 unsigned marks: 6; 724 unsigned vec_delete_takes_size : 1; 725 unsigned declared_class : 1; 726 727 unsigned being_defined : 1; 728 unsigned redefined : 1; 729 unsigned debug_requested : 1; 730 unsigned use_template : 2; 731 unsigned got_semicolon : 1; 732 unsigned ptrmemfunc_flag : 1; 733 unsigned is_signature : 1; 734 735 unsigned is_signature_pointer : 1; 736 unsigned is_signature_reference : 1; 737 unsigned has_opaque_typedecls : 1; 738 unsigned sigtable_has_been_generated : 1; 739 unsigned was_anonymous : 1; 740 unsigned has_real_assign_ref : 1; 741 unsigned has_const_init_ref : 1; 742 unsigned has_complex_init_ref : 1; 743 744 unsigned has_complex_assign_ref : 1; 745 unsigned has_abstract_assign_ref : 1; 746 unsigned non_aggregate : 1; 747 unsigned is_partial_instantiation : 1; 748 unsigned has_mutable : 1; 749 unsigned com_interface : 1; 750 /* When adding a flag here, consider whether or not it ought to 751 apply to a template instance if it applies to the template. 752 If so, make sure to copy it in instantiate_class_template! */ 753 754 /* The MIPS compiler gets it wrong if this struct also 755 does not fill out to a multiple of 4 bytes. Add a 756 member `dummy' with new bits if you go over the edge. */ 757 unsigned dummy : 10; 758 } type_flags; 759 760 int vsize; 761 int vfield_parent; 762 763 union tree_node *vfields; 764 union tree_node *vbases; 765 766 union tree_node *tags; 767 768 union tree_node *search_slot; 769 770 unsigned char align; 771 /* Room for another three unsigned chars. */ 772 773 union tree_node *size; 774 775 union tree_node *abstract_virtuals; 776 union tree_node *friend_classes; 777 778 union tree_node *rtti; 779 780 union tree_node *methods; 781 782 union tree_node *signature; 783 union tree_node *signature_pointer_to; 784 union tree_node *signature_reference_to; 785 union tree_node *template_info; 786 tree befriending_classes; 787}; 788 789/* Indicates whether or not (and how) a template was expanded for this class. 790 0=no information yet/non-template class 791 1=implicit template instantiation 792 2=explicit template specialization 793 3=explicit template instantiation */ 794#define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template) 795 796/* Fields used for storing information before the class is defined. 797 After the class is defined, these fields hold other information. */ 798 799/* List of friends which were defined inline in this class definition. */ 800#define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE)) 801 802/* Nonzero for _CLASSTYPE means that operator new and delete are defined, 803 respectively. */ 804#define TYPE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new) 805#define TYPE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete) 806#define TYPE_GETS_REG_DELETE(NODE) (TYPE_GETS_DELETE (NODE) & 1) 807 808/* Nonzero for _CLASSTYPE means that operator vec delete is defined and 809 takes the optional size_t argument. */ 810#define TYPE_VEC_DELETE_TAKES_SIZE(NODE) \ 811 (TYPE_LANG_SPECIFIC(NODE)->type_flags.vec_delete_takes_size) 812#define TYPE_VEC_NEW_USES_COOKIE(NODE) \ 813 (TYPE_NEEDS_DESTRUCTOR (NODE) \ 814 || (TYPE_LANG_SPECIFIC (NODE) && TYPE_VEC_DELETE_TAKES_SIZE (NODE))) 815 816/* Nonzero means that this _CLASSTYPE node defines ways of converting 817 itself to other types. */ 818#define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion) 819 820/* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */ 821#define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref) 822#define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref) 823 824/* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */ 825#define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref) 826#define TYPE_HAS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_init_ref) 827 828/* Nonzero means that this type is being defined. I.e., the left brace 829 starting the definition of this type has been seen. */ 830#define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined) 831/* Nonzero means that this type has been redefined. In this case, if 832 convenient, don't reprocess any methods that appear in its redefinition. */ 833#define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined) 834 835/* Nonzero means that this type is a signature. */ 836# define IS_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)?TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature:0) 837# define SET_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=1) 838# define CLEAR_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature=0) 839 840/* Nonzero means that this type is a signature pointer type. */ 841# define IS_SIGNATURE_POINTER(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_pointer) 842 843/* Nonzero means that this type is a signature reference type. */ 844# define IS_SIGNATURE_REFERENCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.is_signature_reference) 845 846/* Nonzero means that this signature contains opaque type declarations. */ 847#define SIGNATURE_HAS_OPAQUE_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_opaque_typedecls) 848 849/* Nonzero means that a signature table has been generated 850 for this signature. */ 851#define SIGTABLE_HAS_BEEN_GENERATED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.sigtable_has_been_generated) 852 853/* If NODE is a class, this is the signature type that contains NODE's 854 signature after it has been computed using sigof(). */ 855#define CLASSTYPE_SIGNATURE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature) 856 857/* If NODE is a signature pointer or signature reference, this is the 858 signature type the pointer/reference points to. */ 859#define SIGNATURE_TYPE(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature) 860 861/* If NODE is a signature, this is a vector of all methods defined 862 in the signature or in its base types together with their default 863 implementations. */ 864#define SIGNATURE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature) 865 866/* If NODE is a signature, this is the _TYPE node that contains NODE's 867 signature pointer type. */ 868#define SIGNATURE_POINTER_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_pointer_to) 869 870/* If NODE is a signature, this is the _TYPE node that contains NODE's 871 signature reference type. */ 872#define SIGNATURE_REFERENCE_TO(NODE) (TYPE_LANG_SPECIFIC(NODE)->signature_reference_to) 873 874/* The is the basetype that contains NODE's rtti. */ 875#define CLASSTYPE_RTTI(NODE) (TYPE_LANG_SPECIFIC(NODE)->rtti) 876 877/* Nonzero means that this _CLASSTYPE node overloads operator(). */ 878#define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded) 879 880/* Nonzero means that this _CLASSTYPE node overloads operator[]. */ 881#define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_array_ref_overloaded) 882 883/* Nonzero means that this _CLASSTYPE node overloads operator->. */ 884#define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_arrow_overloaded) 885 886/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses 887 multiple inheritance. If this is 0 for the root of a type 888 hierarchy, then we can use more efficient search techniques. */ 889#define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.uses_multiple_inheritance) 890 891/* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses 892 virtual base classes. If this is 0 for the root of a type 893 hierarchy, then we can use more efficient search techniques. */ 894#define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE)) 895 896/* Nonzero means that this _CLASSTYPE uses polymorphic virtual bases. 897 This flag is set only when we use vtable thunks. */ 898#define TYPE_USES_PVBASES(NODE) (TREE_LANG_FLAG_5(NODE)) 899 900/* Vector member functions defined in this class. Each element is 901 either a FUNCTION_DECL, a TEMPLATE_DECL, or an OVERLOAD. All 902 functions with the same name end up in the same slot. The first 903 two elements are for constructors, and destructors, respectively. 904 These are followed by ordinary member functions. There may be 905 empty entries at the end of the vector. */ 906#define CLASSTYPE_METHOD_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->methods) 907 908/* The first type conversion operator in the class (the others can be 909 searched with TREE_CHAIN), or the first non-constructor function if 910 there are no type conversion operators. */ 911#define CLASSTYPE_FIRST_CONVERSION(NODE) \ 912 TREE_VEC_LENGTH (CLASSTYPE_METHOD_VEC (NODE)) > 2 \ 913 ? TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (NODE), 2) \ 914 : NULL_TREE; 915 916/* Mark bits for depth-first and breath-first searches. */ 917 918/* Get the value of the Nth mark bit. */ 919#define CLASSTYPE_MARKED_N(NODE, N) \ 920 (((CLASS_TYPE_P (NODE) ? TYPE_LANG_SPECIFIC (NODE)->type_flags.marks \ 921 : TYPE_ALIAS_SET (NODE)) & (1 << N)) != 0) 922 923/* Set the Nth mark bit. */ 924#define SET_CLASSTYPE_MARKED_N(NODE, N) \ 925 (CLASS_TYPE_P (NODE) \ 926 ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks |= (1 << (N))) \ 927 : (TYPE_ALIAS_SET (NODE) |= (1 << (N)))) 928 929/* Clear the Nth mark bit. */ 930#define CLEAR_CLASSTYPE_MARKED_N(NODE, N) \ 931 (CLASS_TYPE_P (NODE) \ 932 ? (TYPE_LANG_SPECIFIC (NODE)->type_flags.marks &= ~(1 << (N))) \ 933 : (TYPE_ALIAS_SET (NODE) &= ~(1 << (N)))) 934 935/* Get the value of the mark bits. */ 936#define CLASSTYPE_MARKED(NODE) CLASSTYPE_MARKED_N(NODE, 0) 937#define CLASSTYPE_MARKED2(NODE) CLASSTYPE_MARKED_N(NODE, 1) 938#define CLASSTYPE_MARKED3(NODE) CLASSTYPE_MARKED_N(NODE, 2) 939#define CLASSTYPE_MARKED4(NODE) CLASSTYPE_MARKED_N(NODE, 3) 940#define CLASSTYPE_MARKED5(NODE) CLASSTYPE_MARKED_N(NODE, 4) 941#define CLASSTYPE_MARKED6(NODE) CLASSTYPE_MARKED_N(NODE, 5) 942 943/* Macros to modify the above flags */ 944#define SET_CLASSTYPE_MARKED(NODE) SET_CLASSTYPE_MARKED_N(NODE, 0) 945#define CLEAR_CLASSTYPE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 0) 946#define SET_CLASSTYPE_MARKED2(NODE) SET_CLASSTYPE_MARKED_N(NODE, 1) 947#define CLEAR_CLASSTYPE_MARKED2(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 1) 948#define SET_CLASSTYPE_MARKED3(NODE) SET_CLASSTYPE_MARKED_N(NODE, 2) 949#define CLEAR_CLASSTYPE_MARKED3(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 2) 950#define SET_CLASSTYPE_MARKED4(NODE) SET_CLASSTYPE_MARKED_N(NODE, 3) 951#define CLEAR_CLASSTYPE_MARKED4(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 3) 952#define SET_CLASSTYPE_MARKED5(NODE) SET_CLASSTYPE_MARKED_N(NODE, 4) 953#define CLEAR_CLASSTYPE_MARKED5(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 4) 954#define SET_CLASSTYPE_MARKED6(NODE) SET_CLASSTYPE_MARKED_N(NODE, 5) 955#define CLEAR_CLASSTYPE_MARKED6(NODE) CLEAR_CLASSTYPE_MARKED_N(NODE, 5) 956 957/* A list of the nested tag-types (class, struct, union, or enum) 958 found within this class. The TREE_PURPOSE of each node is the name 959 of the type; the TREE_VALUE is the type itself. This list includes 960 nested member class templates. */ 961#define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags) 962 963/* If this class has any bases, this is the number of the base class from 964 which our VFIELD is based, -1 otherwise. If this class has no base 965 classes, this is not used. 966 In D : B1, B2, PARENT would be 0, if D's vtable came from B1, 967 1, if D's vtable came from B2. */ 968#define CLASSTYPE_VFIELD_PARENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfield_parent) 969 970/* Remove when done merging. */ 971#define CLASSTYPE_VFIELD(NODE) TYPE_VFIELD(NODE) 972 973/* The number of virtual functions defined for this 974 _CLASSTYPE node. */ 975#define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vsize) 976/* The list of binfos of virtual base classes that this type uses. */ 977#define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbases) 978/* The virtual function pointer fields that this type contains. */ 979#define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfields) 980 981/* Number of baseclasses defined for this type. 982 0 means no base classes. */ 983#define CLASSTYPE_N_BASECLASSES(NODE) \ 984 (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0) 985 986/* Used for keeping search-specific information. Any search routine 987 which uses this must define what exactly this slot is used for. */ 988#define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot) 989 990/* These are the size, mode and alignment of the type without its 991 virtual base classes, for when we use this type as a base itself. */ 992#define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size) 993#define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align) 994 995/* A cons list of virtual functions which cannot be inherited by 996 derived classes. When deriving from this type, the derived 997 class must provide its own definition for each of these functions. */ 998#define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals) 999 1000/* Nonzero means that this aggr type has been `closed' by a semicolon. */ 1001#define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.got_semicolon) 1002 1003/* Nonzero means that the main virtual function table pointer needs to be 1004 set because base constructors have placed the wrong value there. 1005 If this is zero, it means that they placed the right value there, 1006 and there is no need to change it. */ 1007#define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_virtual_reinit) 1008 1009/* Nonzero means that if this type has virtual functions, that 1010 the virtual function table will be written out. */ 1011#define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.vtable_needs_writing) 1012 1013/* Nonzero means that this type has an X() constructor. */ 1014#define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_default_ctor) 1015 1016/* Nonzero means the type declared a ctor as private or protected. We 1017 use this to make sure we don't try to generate a copy ctor for a 1018 class that has a member of type NODE. */ 1019#define TYPE_HAS_NONPUBLIC_CTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_ctor) 1020 1021/* Ditto, for operator=. */ 1022#define TYPE_HAS_NONPUBLIC_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_nonpublic_assign_ref) 1023 1024/* Nonzero means that this type contains a mutable member */ 1025#define CLASSTYPE_HAS_MUTABLE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_mutable) 1026#define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE)) 1027 1028/* Nonzero means that this type is meant for communication via COM. */ 1029#define CLASSTYPE_COM_INTERFACE(NODE) \ 1030 (TYPE_LANG_SPECIFIC(NODE)->type_flags.com_interface) 1031 1032/* A list of class types of which this type is a friend. The 1033 TREE_VALUE is normally a TYPE, but will be a TEMPLATE_DECL in the 1034 case of a template friend. */ 1035#define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes) 1036 1037/* A list of the classes which grant friendship to this class. */ 1038#define CLASSTYPE_BEFRIENDING_CLASSES(NODE) \ 1039 (TYPE_LANG_SPECIFIC (NODE)->befriending_classes) 1040 1041/* Say whether this node was declared as a "class" or a "struct". */ 1042#define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class) 1043 1044/* Nonzero if this class has const members which have no specified initialization. */ 1045#define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.const_needs_init) 1046 1047/* Nonzero if this class has ref members which have no specified initialization. */ 1048#define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ref_needs_init) 1049 1050/* Nonzero if this class is included from a header file which employs 1051 `#pragma interface', and it is not included in its implementation file. */ 1052#define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_only) 1053 1054/* Same as above, but for classes whose purpose we do not know. */ 1055#define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown) 1056#define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown == 0) 1057#define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = !!(X)) 1058#define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 1) 1059#define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 0) 1060 1061/* Nonzero if a _DECL node requires us to output debug info for this class. */ 1062#define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.debug_requested) 1063 1064/* Additional macros for inheritance information. */ 1065 1066/* The BINFO_INHERITANCE_CHAIN is used opposite to the description in 1067 gcc/tree.h. In particular if D is derived from B then the BINFO 1068 for B (in D) will have a BINFO_INHERITANCE_CHAIN pointing to 1069 D. In tree.h, this pointer is described as pointing in other 1070 direction. There is a different BINFO for each path to a virtual 1071 base; BINFOs for virtual bases are not shared. In addition, shared 1072 versions of each of the virtual class BINFOs are stored in 1073 CLASSTYPE_VBASECLASSES. 1074 1075 We use TREE_VIA_PROTECTED and TREE_VIA_PUBLIC, but private 1076 inheritance is indicated by the absence of the other two flags, not 1077 by TREE_VIAR_PRIVATE, which is unused. 1078 1079 The TREE_CHAIN is for scratch space in search.c. */ 1080 1081/* Nonzero means marked by DFS or BFS search, including searches 1082 by `get_binfo' and `get_base_distance'. */ 1083#define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE)) 1084/* Macros needed because of C compilers that don't allow conditional 1085 expressions to be lvalues. Grr! */ 1086#define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1)) 1087#define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0)) 1088 1089/* Nonzero means marked in search through virtual inheritance hierarchy. */ 1090#define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 1091/* Modifier macros */ 1092#define SET_BINFO_VBASE_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 1093#define CLEAR_BINFO_VBASE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 1094 1095/* Nonzero means marked in search for members or member functions. */ 1096#define BINFO_FIELDS_MARKED(NODE) \ 1097 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)):TREE_LANG_FLAG_2(NODE)) 1098#define SET_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=1)) 1099#define CLEAR_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=0)) 1100 1101/* Nonzero means that this class is on a path leading to a new vtable. */ 1102#define BINFO_VTABLE_PATH_MARKED(NODE) \ 1103 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):TREE_LANG_FLAG_3(NODE)) 1104#define SET_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=1)) 1105#define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=0)) 1106 1107/* Nonzero means that this class has a new vtable. */ 1108#define BINFO_NEW_VTABLE_MARKED(NODE) \ 1109 (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):TREE_LANG_FLAG_4(NODE)) 1110#define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1)) 1111#define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0)) 1112 1113/* Nonzero means this class has done dfs_pushdecls. */ 1114#define BINFO_PUSHDECLS_MARKED(NODE) BINFO_VTABLE_PATH_MARKED (NODE) 1115#define SET_BINFO_PUSHDECLS_MARKED(NODE) SET_BINFO_VTABLE_PATH_MARKED (NODE) 1116#define CLEAR_BINFO_PUSHDECLS_MARKED(NODE) CLEAR_BINFO_VTABLE_PATH_MARKED (NODE) 1117 1118/* Used by various search routines. */ 1119#define IDENTIFIER_MARKED(NODE) TREE_LANG_FLAG_0 (NODE) 1120 1121/* Accessor macros for the vfield slots in structures. */ 1122 1123/* Get the assoc info that caused this vfield to exist. */ 1124#define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE) 1125 1126/* Get that same information as a _TYPE. */ 1127#define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE) 1128 1129/* Get the value of the top-most type dominating the non-`normal' vfields. */ 1130#define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE) 1131 1132/* Get the value of the top-most type that's `normal' for the vfield. */ 1133#define VF_NORMAL_VALUE(NODE) TREE_TYPE (NODE) 1134 1135/* Nonzero for TREE_LIST node means that this list of things 1136 is a list of parameters, as opposed to a list of expressions. */ 1137#define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */ 1138 1139/* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that 1140 this type can raise. Each TREE_VALUE is a _TYPE. The TREE_VALUE 1141 will be NULL_TREE to indicate a throw specification of `(...)', or, 1142 equivalently, no throw specification. */ 1143#define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE) 1144 1145/* For FUNCTION_TYPE or METHOD_TYPE, return 1 iff it is declared `throw()'. */ 1146#define TYPE_NOTHROW_P(NODE) \ 1147 (TYPE_RAISES_EXCEPTIONS (NODE) \ 1148 && TREE_VALUE (TYPE_RAISES_EXCEPTIONS (NODE)) == NULL_TREE) 1149 1150/* The binding level associated with the namespace. */ 1151#define NAMESPACE_LEVEL(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.level) 1152 1153 1154/* If a DECL has DECL_LANG_SPECIFIC, it is either a lang_decl_flags or 1155 a lang_decl (which has lang_decl_flags as its initial prefix). A 1156 FUNCTION_DECL, NAMESPACE_DECL, TYPE_DECL, or USING_DECL may have a 1157 full lang_decl. A FIELD_DECL, or a static data member VAR_DECL, 1158 will have only lang_decl_flags. Thus, one should only access the 1159 members of lang_decl that are not in lang_decl_flags for DECLs that 1160 are not FIELD_DECLs or VAR_DECLs. */ 1161 1162struct lang_decl_flags 1163{ 1164#ifdef ONLY_INT_FIELDS 1165 int language : 8; 1166#else 1167 enum languages language : 8; 1168#endif 1169 1170 unsigned operator_attr : 1; 1171 unsigned constructor_attr : 1; 1172 unsigned friend_attr : 1; 1173 unsigned static_function : 1; 1174 unsigned const_memfunc : 1; 1175 unsigned volatile_memfunc : 1; 1176 unsigned abstract_virtual : 1; 1177 unsigned permanent_attr : 1 ; 1178 1179 unsigned mutable_flag : 1; 1180 unsigned is_default_implementation : 1; 1181 unsigned saved_inline : 1; 1182 unsigned use_template : 2; 1183 unsigned nonconverting : 1; 1184 unsigned declared_inline : 1; 1185 unsigned not_really_extern : 1; 1186 unsigned needs_final_overrider : 1; 1187 unsigned bitfield : 1; 1188 unsigned defined_in_class : 1; 1189 unsigned constructor_for_vbase_attr : 2; 1190 unsigned dummy : 3; 1191 1192 tree access; 1193 tree context; 1194 tree memfunc_pointer_to; 1195 tree template_info; 1196 struct binding_level *level; 1197}; 1198 1199struct lang_decl 1200{ 1201 struct lang_decl_flags decl_flags; 1202 1203 tree main_decl_variant; 1204 tree befriending_classes; 1205 struct pending_inline *pending_inline_info; 1206}; 1207 1208/* Non-zero if NODE is a _DECL with TREE_READONLY set. */ 1209#define TREE_READONLY_DECL_P(NODE) \ 1210 (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd') 1211 1212/* Non-zero iff DECL is memory-based. The DECL_RTL of 1213 certain const variables might be a CONST_INT, or a REG 1214 in some cases. We cannot use `memory_operand' as a test 1215 here because on most RISC machines, a variable's address 1216 is not, by itself, a legitimate address. */ 1217#define DECL_IN_MEMORY_P(NODE) \ 1218 (DECL_RTL (NODE) != NULL_RTX && GET_CODE (DECL_RTL (NODE)) == MEM) 1219 1220/* For FUNCTION_DECLs: return the language in which this decl 1221 was declared. */ 1222#define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language) 1223 1224/* For FUNCTION_DECLs: nonzero means that this function is a constructor. */ 1225#define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr) 1226 1227/* There ought to be a better way to find out whether or not something is 1228 a destructor. */ 1229#define DECL_DESTRUCTOR_P(NODE) \ 1230 (DESTRUCTOR_NAME_P (DECL_ASSEMBLER_NAME (NODE)) \ 1231 && DECL_LANGUAGE (NODE) == lang_cplusplus) 1232 1233#define DECL_CONV_FN_P(NODE) \ 1234 (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)) && TREE_TYPE (DECL_NAME (NODE))) 1235 1236#define CONSTRUCTOR_FOR_VBASE 1 1237#define CONSTRUCTOR_FOR_PVBASE 2 1238#define DESTRUCTOR_FOR_PVBASE 3 1239 1240/* For FUNCTION_DECLs: nonzero means that this function is a con/destructor 1241 for an object with virtual baseclasses. */ 1242#define DECL_CONSTRUCTOR_FOR_VBASE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr) 1243 1244/* Nonzero means that this function is a constructor for an object 1245 with virtual baseclasses. */ 1246#define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) \ 1247 (DECL_CONSTRUCTOR_FOR_VBASE (NODE) == CONSTRUCTOR_FOR_VBASE) 1248 1249/* Nonzero means that this function is a constructor for an object 1250 with virtual baseclasses which have virtual functions. */ 1251#define DECL_CONSTRUCTOR_FOR_PVBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr == CONSTRUCTOR_FOR_PVBASE) 1252 1253/* Nonzero means that this function is a destructor for an object 1254 with virtual baseclasses which have virtual functions. */ 1255#define DECL_DESTRUCTOR_FOR_PVBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr == DESTRUCTOR_FOR_PVBASE) 1256 1257/* Nonzero means that this function is a wrapper around a PVBASE ctor. */ 1258#define DECL_VLIST_CTOR_WRAPPER_P(NODE) \ 1259 (DECL_CONSTRUCTOR_FOR_VBASE_P (NODE) && DECL_VLIST_CTOR_WRAPPED (NODE)\ 1260 && TREE_CODE (DECL_VLIST_CTOR_WRAPPED (NODE)) == FUNCTION_DECL \ 1261 && DECL_CONSTRUCTOR_FOR_PVBASE_P (DECL_VLIST_CTOR_WRAPPED (NODE))) 1262 1263/* Refers to original function that NODE wraps. */ 1264#define DECL_VLIST_CTOR_WRAPPED(NODE) DECL_MEMFUNC_POINTER_TO (NODE) 1265 1266/* Non-zero for a FUNCTION_DECL that declares a type-info function. */ 1267#define DECL_TINFO_FN_P(NODE) \ 1268 (TREE_CODE (NODE) == FUNCTION_DECL \ 1269 && DECL_ARTIFICIAL (NODE) \ 1270 && DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag) 1271 1272/* Mark NODE as a type-info function. */ 1273#define SET_DECL_TINFO_FN_P(NODE) \ 1274 (DECL_LANG_SPECIFIC((NODE))->decl_flags.mutable_flag = 1) 1275 1276/* For FUNCTION_DECLs: nonzero means that this function is a default 1277 implementation of a signature method. */ 1278#define IS_DEFAULT_IMPLEMENTATION(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.is_default_implementation) 1279 1280/* Nonzero for _DECL means that this decl appears in (or will appear 1281 in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for 1282 detecting circularity in case members are multiply defined. In the 1283 case of a VAR_DECL, it is also used to determine how program storage 1284 should be allocated. */ 1285#define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE)) 1286 1287/* Nonzero if the DECL was defined in the class definition itself, 1288 rather than outside the class. */ 1289#define DECL_DEFINED_IN_CLASS_P(DECL) \ 1290 (DECL_LANG_SPECIFIC (DECL)->decl_flags.defined_in_class) 1291 1292/* Nonzero for FUNCTION_DECL means that this decl is just a 1293 friend declaration, and should not be added to the list of 1294 member functions for this class. */ 1295#define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr) 1296 1297/* A TREE_LIST of the types which have befriended this FUNCTION_DECL. */ 1298#define DECL_BEFRIENDING_CLASSES(NODE) \ 1299 (DECL_LANG_SPECIFIC(NODE)->befriending_classes) 1300 1301/* Nonzero for FUNCTION_DECL means that this decl is a static 1302 member function. */ 1303#define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function) 1304 1305/* Nonzero for a class member means that it is shared between all objects 1306 of that class. */ 1307#define SHARED_MEMBER_P(NODE) \ 1308 (TREE_CODE (NODE) == VAR_DECL || TREE_CODE (NODE) == TYPE_DECL \ 1309 || TREE_CODE (NODE) == CONST_DECL) 1310 1311/* Nonzero for FUNCTION_DECL means that this decl is a non-static 1312 member function. */ 1313#define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \ 1314 (TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE) 1315 1316/* Nonzero for FUNCTION_DECL means that this decl is a member function 1317 (static or non-static). */ 1318#define DECL_FUNCTION_MEMBER_P(NODE) \ 1319 (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE)) 1320 1321/* Nonzero for FUNCTION_DECL means that this member function 1322 has `this' as const X *const. */ 1323#define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc) 1324 1325/* Nonzero for FUNCTION_DECL means that this member function 1326 has `this' as volatile X *const. */ 1327#define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc) 1328 1329/* Nonzero for a DECL means that this member is a non-static member. */ 1330#define DECL_NONSTATIC_MEMBER_P(NODE) \ 1331 ((TREE_CODE (NODE) == FUNCTION_DECL \ 1332 && DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE)) \ 1333 || TREE_CODE (NODE) == FIELD_DECL) 1334 1335/* Nonzero for _DECL means that this member object type 1336 is mutable. */ 1337#define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag) 1338 1339/* Nonzero for _DECL means that this constructor is a non-converting 1340 constructor. */ 1341#define DECL_NONCONVERTING_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.nonconverting) 1342 1343/* Nonzero for FUNCTION_DECL means that this member function 1344 exists as part of an abstract class's interface. */ 1345#define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual) 1346 1347/* Nonzero for FUNCTION_DECL means that this member function 1348 must be overridden by derived classes. */ 1349#define DECL_NEEDS_FINAL_OVERRIDER_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.needs_final_overrider) 1350 1351/* Nonzero if allocated on permanent_obstack. */ 1352#define LANG_DECL_PERMANENT(LANGDECL) ((LANGDECL)->decl_flags.permanent_attr) 1353 1354/* The _TYPE context in which this _DECL appears. This field holds the 1355 class where a virtual function instance is actually defined, and the 1356 lexical scope of a friend function defined in a class body. */ 1357#define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context) 1358#define DECL_REAL_CONTEXT(NODE) \ 1359 ((TREE_CODE (NODE) == FUNCTION_DECL && DECL_FUNCTION_MEMBER_P (NODE)) \ 1360 ? DECL_CLASS_CONTEXT (NODE) : CP_DECL_CONTEXT (NODE)) 1361 1362/* NULL_TREE in DECL_CONTEXT represents the global namespace. */ 1363#define CP_DECL_CONTEXT(NODE) \ 1364 (DECL_CONTEXT (NODE) ? DECL_CONTEXT (NODE) : global_namespace) 1365#define FROB_CONTEXT(NODE) ((NODE) == global_namespace ? NULL_TREE : (NODE)) 1366 1367/* For a virtual function, the base where we find its vtable entry. 1368 For a non-virtual function, the base where it is defined. */ 1369#define DECL_VIRTUAL_CONTEXT(NODE) DECL_CONTEXT (NODE) 1370 1371/* 1 iff NODE has namespace scope, including the global namespace. */ 1372#define DECL_NAMESPACE_SCOPE_P(NODE) \ 1373 (DECL_CONTEXT (NODE) == NULL_TREE \ 1374 || TREE_CODE (DECL_CONTEXT (NODE)) == NAMESPACE_DECL) 1375 1376/* 1 iff NODE is a class member. */ 1377#define DECL_CLASS_SCOPE_P(NODE) \ 1378 (DECL_CONTEXT (NODE) \ 1379 && TREE_CODE_CLASS (TREE_CODE (DECL_CONTEXT (NODE))) == 't') 1380 1381/* 1 iff NODE is function-local. */ 1382#define DECL_FUNCTION_SCOPE_P(NODE) \ 1383 (DECL_CONTEXT (NODE) \ 1384 && TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL) 1385 1386/* For a NAMESPACE_DECL: the list of using namespace directives 1387 The PURPOSE is the used namespace, the value is the namespace 1388 that is the common ancestor. */ 1389#define DECL_NAMESPACE_USING(NODE) DECL_VINDEX(NODE) 1390 1391/* In a NAMESPACE_DECL, the DECL_INITIAL is used to record all users 1392 of a namespace, to record the transitive closure of using namespace. */ 1393#define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NODE) 1394 1395/* In a NAMESPACE_DECL, points to the original namespace if this is 1396 a namespace alias. */ 1397#define DECL_NAMESPACE_ALIAS(NODE) DECL_ABSTRACT_ORIGIN (NODE) 1398#define ORIGINAL_NAMESPACE(NODE) \ 1399 (DECL_NAMESPACE_ALIAS (NODE) ? DECL_NAMESPACE_ALIAS (NODE) : (NODE)) 1400 1401/* In a non-local VAR_DECL with static storage duration, this is the 1402 initialization priority. If this value is zero, the NODE will be 1403 initialized at the DEFAULT_INIT_PRIORITY. */ 1404#define DECL_INIT_PRIORITY(NODE) (DECL_FIELD_SIZE ((NODE))) 1405 1406/* In a TREE_LIST concatenating using directives, indicate indirekt 1407 directives */ 1408#define TREE_INDIRECT_USING(NODE) ((NODE)->common.lang_flag_0) 1409 1410/* In a VAR_DECL for a variable declared in a for statement, 1411 this is the shadowed (local) variable. */ 1412#define DECL_SHADOWED_FOR_VAR(NODE) DECL_RESULT(NODE) 1413 1414/* Points back to the decl which caused this lang_decl to be allocated. */ 1415#define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant) 1416 1417/* For a FUNCTION_DECL: if this function was declared inline inside of 1418 a class declaration, this is where the text for the function is 1419 squirreled away. */ 1420#define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->pending_inline_info) 1421 1422/* True if on the saved_inlines (see decl2.c) list. */ 1423#define DECL_SAVED_INLINE(DECL) \ 1424 (DECL_LANG_SPECIFIC(DECL)->decl_flags.saved_inline) 1425 1426/* For a FUNCTION_DECL: if this function was declared inside a signature 1427 declaration, this is the corresponding member function pointer that was 1428 created for it. */ 1429#define DECL_MEMFUNC_POINTER_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to) 1430 1431/* For a FIELD_DECL: this points to the signature member function from 1432 which this signature member function pointer was created. */ 1433#define DECL_MEMFUNC_POINTING_TO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.memfunc_pointer_to) 1434 1435/* For a VAR_DECL or FUNCTION_DECL: template-specific information. */ 1436#define DECL_TEMPLATE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.template_info) 1437 1438/* Template information for a RECORD_TYPE or UNION_TYPE. */ 1439#define CLASSTYPE_TEMPLATE_INFO(NODE) (TYPE_LANG_SPECIFIC(NODE)->template_info) 1440 1441/* Template information for an ENUMERAL_TYPE. Although an enumeration may 1442 not be a primary template, it may be declared within the scope of a 1443 primary template and the enumeration constants may depend on 1444 non-type template parameters. */ 1445#define ENUM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE)) 1446 1447/* Template information for a template template parameter. */ 1448#define TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO(NODE) (TYPE_BINFO (NODE)) 1449 1450/* Template information for an ENUMERAL_, RECORD_, or UNION_TYPE. */ 1451#define TYPE_TEMPLATE_INFO(NODE) \ 1452 (TREE_CODE (NODE) == ENUMERAL_TYPE \ 1453 ? ENUM_TEMPLATE_INFO (NODE) : \ 1454 (TREE_CODE (NODE) == TEMPLATE_TEMPLATE_PARM \ 1455 ? TEMPLATE_TEMPLATE_PARM_TEMPLATE_INFO (NODE) \ 1456 : CLASSTYPE_TEMPLATE_INFO (NODE))) 1457 1458/* Set the template information for an ENUMERAL_, RECORD_, or 1459 UNION_TYPE to VAL. */ 1460#define SET_TYPE_TEMPLATE_INFO(NODE, VAL) \ 1461 (TREE_CODE (NODE) == ENUMERAL_TYPE \ 1462 ? (ENUM_TEMPLATE_INFO (NODE) = VAL) \ 1463 : (CLASSTYPE_TEMPLATE_INFO (NODE) = VAL)) 1464 1465#define TI_TEMPLATE(NODE) (TREE_PURPOSE (NODE)) 1466#define TI_ARGS(NODE) (TREE_VALUE (NODE)) 1467#define TI_SPEC_INFO(NODE) (TREE_CHAIN (NODE)) 1468#define TI_PENDING_TEMPLATE_FLAG(NODE) TREE_LANG_FLAG_1 (NODE) 1469 1470/* The TEMPLATE_DECL instantiated or specialized by NODE. This 1471 TEMPLATE_DECL will be the immediate parent, not the most general 1472 template. For example, in: 1473 1474 template <class T> struct S { template <class U> void f(U); } 1475 1476 the FUNCTION_DECL for S<int>::f<double> will have, as its 1477 DECL_TI_TEMPLATE, `template <class U> S<int>::f<U>'. 1478 1479 As a special case, for a member friend template of a template 1480 class, this value will not be a TEMPLATE_DECL, but rather a 1481 LOOKUP_EXPR or IDENTIFIER_NODE indicating the name of the template 1482 and any explicit template arguments provided. For example, in: 1483 1484 template <class T> struct S { friend void f<int>(int, double); } 1485 1486 the DECL_TI_TEMPLATE will be a LOOKUP_EXPR for `f' and the 1487 DECL_TI_ARGS will be {int}. */ 1488#define DECL_TI_TEMPLATE(NODE) TI_TEMPLATE (DECL_TEMPLATE_INFO (NODE)) 1489 1490/* The template arguments used to obtain this decl from the most 1491 general form of DECL_TI_TEMPLATE. For the example given for 1492 DECL_TI_TEMPLATE, the DECL_TI_ARGS will be {int, double}. These 1493 are always the full set of arguments required to instantiate this 1494 declaration from the most general template specialized here. */ 1495#define DECL_TI_ARGS(NODE) TI_ARGS (DECL_TEMPLATE_INFO (NODE)) 1496#define CLASSTYPE_TI_TEMPLATE(NODE) TI_TEMPLATE (CLASSTYPE_TEMPLATE_INFO (NODE)) 1497#define CLASSTYPE_TI_ARGS(NODE) TI_ARGS (CLASSTYPE_TEMPLATE_INFO (NODE)) 1498#define CLASSTYPE_TI_SPEC_INFO(NODE) TI_SPEC_INFO (CLASSTYPE_TEMPLATE_INFO (NODE)) 1499#define ENUM_TI_TEMPLATE(NODE) \ 1500 TI_TEMPLATE (ENUM_TEMPLATE_INFO (NODE)) 1501#define ENUM_TI_ARGS(NODE) \ 1502 TI_ARGS (ENUM_TEMPLATE_INFO (NODE)) 1503 1504/* Like DECL_TI_TEMPLATE, but for an ENUMERAL_, RECORD_, or UNION_TYPE. */ 1505#define TYPE_TI_TEMPLATE(NODE) \ 1506 (TI_TEMPLATE (TYPE_TEMPLATE_INFO (NODE))) 1507 1508/* Like DECL_TI_ARGS, , but for an ENUMERAL_, RECORD_, or UNION_TYPE. */ 1509#define TYPE_TI_ARGS(NODE) \ 1510 (TI_ARGS (TYPE_TEMPLATE_INFO (NODE))) 1511 1512#define INNERMOST_TEMPLATE_PARMS(NODE) TREE_VALUE(NODE) 1513 1514/* Nonzero if the NODE corresponds to the template parameters for a 1515 member template, whose inline definition is being processed after 1516 the class definition is complete. */ 1517#define TEMPLATE_PARMS_FOR_INLINE(NODE) TREE_LANG_FLAG_1 (NODE) 1518 1519#define DECL_SAVED_TREE(NODE) DECL_MEMFUNC_POINTER_TO (NODE) 1520#define COMPOUND_STMT_NO_SCOPE(NODE) TREE_LANG_FLAG_0 (NODE) 1521#define NEW_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE) 1522#define DELETE_EXPR_USE_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE) 1523#define DELETE_EXPR_USE_VEC(NODE) TREE_LANG_FLAG_1 (NODE) 1524#define LOOKUP_EXPR_GLOBAL(NODE) TREE_LANG_FLAG_0 (NODE) 1525 1526/* The TYPE_MAIN_DECL for a class template type is a TYPE_DECL, not a 1527 TEMPLATE_DECL. This macro determines whether or not a given class 1528 type is really a template type, as opposed to an instantiation or 1529 specialization of one. */ 1530#define CLASSTYPE_IS_TEMPLATE(NODE) \ 1531 (CLASSTYPE_TEMPLATE_INFO (NODE) \ 1532 && !CLASSTYPE_USE_TEMPLATE (NODE) \ 1533 && PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (NODE))) 1534 1535/* The name used by the user to name the typename type. Typically, 1536 this is an IDENTIFIER_NODE, and the same as the DECL_NAME on the 1537 corresponding TYPE_DECL. However, this may also be a 1538 TEMPLATE_ID_EXPR if we had something like `typename X::Y<T>'. */ 1539#define TYPENAME_TYPE_FULLNAME(NODE) TYPE_BINFO (NODE) 1540 1541/* Nonzero if NODE is an implicit typename. */ 1542#define IMPLICIT_TYPENAME_P(NODE) \ 1543 (TREE_CODE (NODE) == TYPENAME_TYPE && TREE_TYPE (NODE)) 1544 1545/* Nonzero in INTEGER_CST means that this int is negative by dint of 1546 using a twos-complement negated operand. */ 1547#define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE)) 1548 1549#if 0 /* UNUSED */ 1550/* Nonzero in any kind of _EXPR or _REF node means that it is a call 1551 to a storage allocation routine. If, later, alternate storage 1552 is found to hold the object, this call can be ignored. */ 1553#define TREE_CALLS_NEW(NODE) (TREE_LANG_FLAG_1 (NODE)) 1554#endif 1555 1556/* Nonzero in any kind of _TYPE that uses multiple inheritance 1557 or virtual baseclasses. */ 1558#define TYPE_USES_COMPLEX_INHERITANCE(NODE) (TREE_LANG_FLAG_1 (NODE)) 1559 1560#if 0 /* UNUSED */ 1561/* Nonzero in IDENTIFIER_NODE means that this name is not the name the user 1562 gave; it's a DECL_NESTED_TYPENAME. Someone may want to set this on 1563 mangled function names, too, but it isn't currently. */ 1564#define TREE_MANGLED(NODE) (FOO) 1565#endif 1566 1567#if 0 /* UNUSED */ 1568/* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and 1569 should be looked up in a non-standard way. */ 1570#define DECL_OVERLOADED(NODE) (FOO) 1571#endif 1572 1573/* Nonzero if this (non-TYPE)_DECL has its virtual attribute set. 1574 For a FUNCTION_DECL, this is when the function is a virtual function. 1575 For a VAR_DECL, this is when the variable is a virtual function table. 1576 For a FIELD_DECL, when the field is the field for the virtual function table. 1577 For an IDENTIFIER_NODE, nonzero if any function with this name 1578 has been declared virtual. 1579 1580 For a _TYPE if it uses virtual functions (or is derived from 1581 one that does). */ 1582#define TYPE_VIRTUAL_P(NODE) (TREE_LANG_FLAG_2 (NODE)) 1583 1584extern int flag_new_for_scope; 1585 1586/* This flag is true of a local VAR_DECL if it was declared in a for 1587 statement, but we are no longer in the scope of the for. */ 1588#define DECL_DEAD_FOR_LOCAL(NODE) DECL_LANG_FLAG_7 (NODE) 1589 1590/* This flag is set on a VAR_DECL that is a DECL_DEAD_FOR_LOCAL 1591 if we already emitted a warning about using it. */ 1592#define DECL_ERROR_REPORTED(NODE) DECL_LANG_FLAG_0 (NODE) 1593 1594/* This _DECL represents a compiler-generated entity. */ 1595#define SET_DECL_ARTIFICIAL(NODE) (DECL_ARTIFICIAL (NODE) = 1) 1596 1597/* Record whether a typedef for type `int' was actually `signed int'. */ 1598#define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp)) 1599 1600/* In a FIELD_DECL, nonzero if the decl was originally a bitfield. */ 1601#define DECL_C_BIT_FIELD(NODE) \ 1602 (DECL_LANG_SPECIFIC (NODE) && DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield) 1603#define SET_DECL_C_BIT_FIELD(NODE) \ 1604 (DECL_LANG_SPECIFIC (NODE)->decl_flags.bitfield = 1) 1605 1606/* Nonzero if the type T promotes to itself. 1607 ANSI C states explicitly the list of types that promote; 1608 in particular, short promotes to int even if they have the same width. */ 1609#define C_PROMOTING_INTEGER_TYPE_P(t) \ 1610 (TREE_CODE ((t)) == INTEGER_TYPE \ 1611 && (TYPE_MAIN_VARIANT (t) == char_type_node \ 1612 || TYPE_MAIN_VARIANT (t) == signed_char_type_node \ 1613 || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \ 1614 || TYPE_MAIN_VARIANT (t) == short_integer_type_node \ 1615 || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node)) 1616 1617#define INTEGRAL_CODE_P(CODE) \ 1618 (CODE == INTEGER_TYPE || CODE == ENUMERAL_TYPE || CODE == BOOLEAN_TYPE) 1619#define ARITHMETIC_TYPE_P(TYPE) (INTEGRAL_TYPE_P (TYPE) || FLOAT_TYPE_P (TYPE)) 1620 1621/* Mark which labels are explicitly declared. 1622 These may be shadowed, and may be referenced from nested functions. */ 1623#define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) 1624 1625/* Nonzero for _TYPE means that the _TYPE defines 1626 at least one constructor. */ 1627#define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE)) 1628 1629/* When appearing in an INDIRECT_REF, it means that the tree structure 1630 underneath is actually a call to a constructor. This is needed 1631 when the constructor must initialize local storage (which can 1632 be automatically destroyed), rather than allowing it to allocate 1633 space from the heap. 1634 1635 When appearing in a SAVE_EXPR, it means that underneath 1636 is a call to a constructor. 1637 1638 When appearing in a CONSTRUCTOR, it means that it was 1639 a GNU C constructor expression. 1640 1641 When appearing in a FIELD_DECL, it means that this field 1642 has been duly initialized in its constructor. */ 1643#define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE)) 1644 1645#define EMPTY_CONSTRUCTOR_P(NODE) (TREE_CODE (NODE) == CONSTRUCTOR \ 1646 && CONSTRUCTOR_ELTS (NODE) == NULL_TREE \ 1647 && ! TREE_HAS_CONSTRUCTOR (NODE)) 1648 1649#if 0 1650/* Indicates that a NON_LVALUE_EXPR came from a C++ reference. 1651 Used to generate more helpful error message in case somebody 1652 tries to take its address. */ 1653#define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE)) 1654#endif 1655 1656/* Nonzero for _TYPE means that the _TYPE defines a destructor. */ 1657#define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE)) 1658 1659#if 0 1660/* Nonzero for _TYPE node means that creating an object of this type 1661 will involve a call to a constructor. This can apply to objects 1662 of ARRAY_TYPE if the type of the elements needs a constructor. */ 1663#define TYPE_NEEDS_CONSTRUCTING(NODE) ... defined in ../tree.h ... 1664#endif 1665 1666/* Nonzero means that an object of this type can not be initialized using 1667 an initializer list. */ 1668#define CLASSTYPE_NON_AGGREGATE(NODE) \ 1669 (TYPE_LANG_SPECIFIC (NODE)->type_flags.non_aggregate) 1670#define TYPE_NON_AGGREGATE_CLASS(NODE) \ 1671 (IS_AGGR_TYPE (NODE) && CLASSTYPE_NON_AGGREGATE (NODE)) 1672 1673/* Nonzero if there is a user-defined X::op=(x&) for this class. */ 1674#define TYPE_HAS_REAL_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_real_assign_ref) 1675#define TYPE_HAS_COMPLEX_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_assign_ref) 1676#define TYPE_HAS_ABSTRACT_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_abstract_assign_ref) 1677#define TYPE_HAS_COMPLEX_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_complex_init_ref) 1678 1679/* Nonzero for _TYPE node means that destroying an object of this type 1680 will involve a call to a destructor. This can apply to objects 1681 of ARRAY_TYPE is the type of the elements needs a destructor. */ 1682#define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE)) 1683 1684/* Nonzero for class type means that initialization of this type can use 1685 a bitwise copy. */ 1686#define TYPE_HAS_TRIVIAL_INIT_REF(NODE) \ 1687 (TYPE_HAS_INIT_REF (NODE) && ! TYPE_HAS_COMPLEX_INIT_REF (NODE)) 1688 1689/* Nonzero for class type means that assignment of this type can use 1690 a bitwise copy. */ 1691#define TYPE_HAS_TRIVIAL_ASSIGN_REF(NODE) \ 1692 (TYPE_HAS_ASSIGN_REF (NODE) && ! TYPE_HAS_COMPLEX_ASSIGN_REF (NODE)) 1693 1694#define TYPE_PTRMEM_P(NODE) \ 1695 (TREE_CODE (NODE) == POINTER_TYPE \ 1696 && TREE_CODE (TREE_TYPE (NODE)) == OFFSET_TYPE) 1697#define TYPE_PTR_P(NODE) \ 1698 (TREE_CODE (NODE) == POINTER_TYPE \ 1699 && TREE_CODE (TREE_TYPE (NODE)) != OFFSET_TYPE) 1700#define TYPE_PTROB_P(NODE) \ 1701 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE \ 1702 && TREE_CODE (TREE_TYPE (NODE)) != VOID_TYPE) 1703#define TYPE_PTROBV_P(NODE) \ 1704 (TYPE_PTR_P (NODE) && TREE_CODE (TREE_TYPE (NODE)) != FUNCTION_TYPE) 1705#define TYPE_PTRFN_P(NODE) \ 1706 (TREE_CODE (NODE) == POINTER_TYPE \ 1707 && TREE_CODE (TREE_TYPE (NODE)) == FUNCTION_TYPE) 1708 1709/* Nonzero for _TYPE node means that this type is a pointer to member 1710 function type. */ 1711#define TYPE_PTRMEMFUNC_P(NODE) \ 1712 (TREE_CODE(NODE) == RECORD_TYPE && TYPE_PTRMEMFUNC_FLAG (NODE)) 1713#define TYPE_PTRMEMFUNC_FLAG(NODE) \ 1714 (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag) 1715 1716/* A pointer-to-function member type looks like: 1717 1718 struct { 1719 short __delta; 1720 short __index; 1721 union { 1722 P __pfn; 1723 short __delta2; 1724 } __pfn_or_delta2; 1725 }; 1726 1727 where P is a POINTER_TYPE to a METHOD_TYPE appropriate for the 1728 pointer to member. The fields are used as follows: 1729 1730 If __INDEX is -1, then the function to call is non-virtual, and 1731 is located at the address given by __PFN. 1732 1733 If __INDEX is zero, then this a NULL pointer-to-member. 1734 1735 Otherwise, the function to call is virtual. Then, __DELTA2 gives 1736 the offset from an instance of the object to the virtual function 1737 table, and __INDEX - 1 is the index into the vtable to use to 1738 find the function. 1739 1740 The value to use for the THIS parameter is the address of the 1741 object plus __DELTA. 1742 1743 For example, given: 1744 1745 struct B1 { 1746 int i; 1747 }; 1748 1749 struct B2 { 1750 double d; 1751 void f(); 1752 }; 1753 1754 struct S : public B1, B2 {}; 1755 1756 the pointer-to-member for `&S::f' looks like: 1757 1758 { 4, -1, { &f__2B2 } }; 1759 1760 The `4' means that given an `S*' you have to add 4 bytes to get to 1761 the address of the `B2*'. Then, the -1 indicates that this is a 1762 non-virtual function. Of course, `&f__2B2' is the name of that 1763 function. 1764 1765 (Of course, the exactl values may differ depending on the mangling 1766 scheme, sizes of types, and such.). */ 1767 1768/* Get the POINTER_TYPE to the METHOD_TYPE associated with this 1769 pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true, 1770 before using this macro. */ 1771#define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE))))))) 1772 1773/* Returns `A' for a type like `int (A::*)(double)' */ 1774#define TYPE_PTRMEMFUNC_OBJECT_TYPE(NODE) \ 1775 TYPE_METHOD_BASETYPE (TREE_TYPE (TYPE_PTRMEMFUNC_FN_TYPE (NODE))) 1776 1777/* These are use to manipulate the canonical RECORD_TYPE from the 1778 hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */ 1779#define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE)) 1780#define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE))) 1781/* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */ 1782#define DELTA2_FROM_PTRMEMFUNC(NODE) delta2_from_ptrmemfunc ((NODE)) 1783#define PFN_FROM_PTRMEMFUNC(NODE) pfn_from_ptrmemfunc ((NODE)) 1784 1785/* For a pointer-to-member constant `X::Y' this is the RECORD_TYPE for 1786 `X'. */ 1787#define PTRMEM_CST_CLASS(NODE) \ 1788 (TYPE_PTRMEM_P (TREE_TYPE (NODE)) \ 1789 ? TYPE_OFFSET_BASETYPE (TREE_TYPE (TREE_TYPE (NODE))) \ 1790 : TYPE_PTRMEMFUNC_OBJECT_TYPE (TREE_TYPE (NODE))) 1791 1792/* For a pointer-to-member constant `X::Y' this is the _DECL for 1793 `Y'. */ 1794#define PTRMEM_CST_MEMBER(NODE) (((ptrmem_cst_t) NODE)->member) 1795 1796/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `extern' was 1797 specified in its declaration. */ 1798#define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE)) 1799 1800/* Nonzero for VAR_DECL and FUNCTION_DECL node means that `static' was 1801 specified in its declaration. */ 1802#define DECL_THIS_STATIC(NODE) (DECL_LANG_FLAG_6(NODE)) 1803 1804/* Nonzero in FUNCTION_DECL means it is really an operator. 1805 Just used to communicate formatting information to dbxout.c. */ 1806#define DECL_OPERATOR(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.operator_attr) 1807 1808/* Nonzero if TYPE is an anonymous union or struct type. We have to use a 1809 flag for this because "A union for which objects or pointers are 1810 declared is not an anonymous union" [class.union]. */ 1811#define ANON_AGGR_TYPE_P(NODE) \ 1812 (TYPE_LANG_SPECIFIC (NODE) \ 1813 && TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr) 1814#define SET_ANON_AGGR_TYPE_P(NODE) \ 1815 (TYPE_LANG_SPECIFIC (NODE)->type_flags.anon_aggr = 1) 1816 1817#define UNKNOWN_TYPE LANG_TYPE 1818 1819/* Define fields and accessors for nodes representing declared names. */ 1820 1821#if 0 1822/* C++: A derived class may be able to directly use the virtual 1823 function table of a base class. When it does so, it may 1824 still have a decl node used to access the virtual function 1825 table (so that variables of this type can initialize their 1826 virtual function table pointers by name). When such thievery 1827 is committed, know exactly which base class's virtual function 1828 table is the one being stolen. This effectively computes the 1829 transitive closure. */ 1830#define DECL_VPARENT(NODE) ((NODE)->decl.arguments) 1831#endif 1832 1833#define TYPE_WAS_ANONYMOUS(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.was_anonymous) 1834 1835/* C++: all of these are overloaded! These apply only to TYPE_DECLs. */ 1836 1837/* The format of each node in the DECL_FRIENDLIST is as follows: 1838 1839 The TREE_PURPOSE will be the name of a function, i.e., an 1840 IDENTIFIER_NODE. The TREE_VALUE will be itself a TREE_LIST, the 1841 list of functions with that name which are friends. The 1842 TREE_PURPOSE of each node in this sublist will be error_mark_node, 1843 if the function was declared a friend individually, in which case 1844 the TREE_VALUE will be the function_decl. If, however, all 1845 functions with a given name in a class were declared to be friends, 1846 the TREE_PUROSE will be the class type, and the TREE_VALUE will be 1847 NULL_TREE. */ 1848#define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE)) 1849#define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST)) 1850#define FRIEND_DECLS(LIST) (TREE_VALUE (LIST)) 1851 1852/* The DECL_ACCESS, if non-NULL, is a TREE_LIST. The TREE_PURPOSE of 1853 each node is a type; the TREE_VALUE is the access granted for this 1854 DECL in that type. The DECL_ACCESS is set by access declarations. 1855 For example, if a member that would normally be public in a 1856 derived class is made protected, then the derived class and the 1857 protected_access_node will appear in the DECL_ACCESS for the node. */ 1858#define DECL_ACCESS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.access) 1859 1860/* C++: all of these are overloaded! 1861 These apply to PARM_DECLs and VAR_DECLs. */ 1862#define DECL_REFERENCE_SLOT(NODE) ((tree)(NODE)->decl.arguments) 1863#define SET_DECL_REFERENCE_SLOT(NODE,VAL) ((NODE)->decl.arguments=VAL) 1864 1865/* Accessor macros for C++ template decl nodes. */ 1866 1867/* The DECL_TEMPLATE_PARMS are a list. The TREE_PURPOSE of each node 1868 is a INT_CST whose TREE_INT_CST_HIGH indicates the level of the 1869 template parameters, with 1 being the outermost set of template 1870 parameters. The TREE_VALUE is a vector, whose elements are the 1871 template parameters at each level. Each element in the vector is a 1872 TREE_LIST, whose TREE_VALUE is a PARM_DECL (if the parameter is a 1873 non-type parameter), or a TYPE_DECL (if the parameter is a type 1874 parameter). The TREE_PURPOSE is the default value, if any. The 1875 TEMPLATE_PARM_INDEX for the parameter is avilable as the 1876 DECL_INITIAL (for a PARM_DECL) or as the TREE_TYPE (for a 1877 TYPE_DECL). */ 1878#define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE) 1879#define DECL_INNERMOST_TEMPLATE_PARMS(NODE) \ 1880 INNERMOST_TEMPLATE_PARMS (DECL_TEMPLATE_PARMS (NODE)) 1881#define DECL_NTPARMS(NODE) \ 1882 TREE_VEC_LENGTH (DECL_INNERMOST_TEMPLATE_PARMS (NODE)) 1883/* For function, method, class-data templates. */ 1884#define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE) 1885/* For a static member variable template, the 1886 DECL_TEMPLATE_INSTANTIATIONS list contains the explicitly and 1887 implicitly generated instantiations of the variable. There are no 1888 partial instantiations of static member variables, so all of these 1889 will be full instantiations. 1890 1891 For a class template the DECL_TEMPLATE_INSTANTIATIONS lists holds 1892 all instantiations and specializations of the class type, including 1893 partial instantiations and partial specializations. 1894 1895 In both cases, the TREE_PURPOSE of each node contains the arguments 1896 used; the TREE_VALUE contains the generated variable. The template 1897 arguments are always complete. For example, given: 1898 1899 template <class T> struct S1 { 1900 template <class U> struct S2 {}; 1901 template <class U> struct S2<U*> {}; 1902 }; 1903 1904 the record for the partial specialization will contain, as its 1905 argument list, { {T}, {U*} }, and will be on the 1906 DECL_TEMPLATE_INSTANTIATIONS list for `template <class T> template 1907 <class U> struct S1<T>::S2'. 1908 1909 This list is not used for function templates. */ 1910#define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE) 1911/* For a function template, the DECL_TEMPLATE_SPECIALIZATIONS lists 1912 contains all instantiations and specializations of the function, 1913 including partial instantiations. For a partial instantiation 1914 which is a specialization, this list holds only full 1915 specializations of the template that are instantiations of the 1916 partial instantiation. For example, given: 1917 1918 template <class T> struct S { 1919 template <class U> void f(U); 1920 template <> void f(T); 1921 }; 1922 1923 the `S<int>::f<int>(int)' function will appear on the 1924 DECL_TEMPLATE_SPECIALIZATIONS list for both `template <class T> 1925 template <class U> void S<T>::f(U)' and `template <class T> void 1926 S<int>::f(T)'. In the latter case, however, it will have only the 1927 innermost set of arguments (T, in this case). The DECL_TI_TEMPLATE 1928 for the function declaration will point at the specialization, not 1929 the fully general template. 1930 1931 For a class template, this list contains the partial 1932 specializations of this template. (Full specializations are not 1933 recorded on this list.) The TREE_PURPOSE holds the innermost 1934 arguments used in the partial specialization (e.g., for `template 1935 <class T> struct S<T*, int>' this will be `T*'.) The TREE_VALUE 1936 holds the innermost template parameters for the specialization 1937 (e.g., `T' in the example above.) The TREE_TYPE is the _TYPE node 1938 for the partial specialization. 1939 1940 This list is not used for static variable templates. */ 1941#define DECL_TEMPLATE_SPECIALIZATIONS(NODE) DECL_SIZE(NODE) 1942#define DECL_TEMPLATE_INJECT(NODE) DECL_INITIAL(NODE) 1943 1944/* Nonzero for a DECL which is actually a template parameter. */ 1945#define DECL_TEMPLATE_PARM_P(NODE) \ 1946 DECL_LANG_FLAG_0 (NODE) 1947 1948#define DECL_TEMPLATE_TEMPLATE_PARM_P(NODE) \ 1949 (TREE_CODE (NODE) == TEMPLATE_DECL && DECL_TEMPLATE_PARM_P (NODE)) 1950 1951#define DECL_FUNCTION_TEMPLATE_P(NODE) \ 1952 (TREE_CODE (NODE) == TEMPLATE_DECL \ 1953 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == FUNCTION_DECL) 1954 1955/* Nonzero for a DECL that represents a template class. */ 1956#define DECL_CLASS_TEMPLATE_P(NODE) \ 1957 (TREE_CODE (NODE) == TEMPLATE_DECL \ 1958 && TREE_CODE (DECL_TEMPLATE_RESULT (NODE)) == TYPE_DECL \ 1959 && !DECL_TEMPLATE_TEMPLATE_PARM_P (NODE)) 1960 1961/* Nonzero if NODE which declares a type. */ 1962#define DECL_DECLARES_TYPE_P(NODE) \ 1963 (TREE_CODE (NODE) == TYPE_DECL || DECL_CLASS_TEMPLATE_P (NODE)) 1964 1965/* A `primary' template is one that has its own template header. A 1966 member function of a class template is a template, but not primary. 1967 A member template is primary. Friend templates are primary, too. */ 1968 1969/* Returns the primary template corresponding to these parameters. */ 1970#define DECL_PRIMARY_TEMPLATE(NODE) \ 1971 (TREE_TYPE (DECL_INNERMOST_TEMPLATE_PARMS (NODE))) 1972 1973/* Returns non-zero if NODE is a primary template. */ 1974#define PRIMARY_TEMPLATE_P(NODE) (DECL_PRIMARY_TEMPLATE (NODE) == NODE) 1975 1976#define CLASSTYPE_TEMPLATE_LEVEL(NODE) \ 1977 (TREE_INT_CST_HIGH (TREE_PURPOSE (CLASSTYPE_TI_TEMPLATE (NODE)))) 1978 1979/* Indicates whether or not (and how) a template was expanded for this 1980 FUNCTION_DECL or VAR_DECL. 1981 0=normal declaration, e.g. int min (int, int); 1982 1=implicit template instantiation 1983 2=explicit template specialization, e.g. int min<int> (int, int); 1984 3=explicit template instantiation, e.g. template int min<int> (int, int); */ 1985#define DECL_USE_TEMPLATE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.use_template) 1986 1987#define DECL_TEMPLATE_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) & 1) 1988#define CLASSTYPE_TEMPLATE_INSTANTIATION(NODE) \ 1989 (CLASSTYPE_USE_TEMPLATE (NODE) & 1) 1990 1991#define DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) == 2) 1992#define SET_DECL_TEMPLATE_SPECIALIZATION(NODE) (DECL_USE_TEMPLATE (NODE) = 2) 1993#define CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ 1994 (CLASSTYPE_USE_TEMPLATE (NODE) == 2) 1995#define SET_CLASSTYPE_TEMPLATE_SPECIALIZATION(NODE) \ 1996 (CLASSTYPE_USE_TEMPLATE (NODE) = 2) 1997 1998#define DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 1) 1999#define SET_DECL_IMPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 1) 2000#define CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \ 2001 (CLASSTYPE_USE_TEMPLATE(NODE) == 1) 2002#define SET_CLASSTYPE_IMPLICIT_INSTANTIATION(NODE) \ 2003 (CLASSTYPE_USE_TEMPLATE(NODE) = 1) 2004 2005#define DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) == 3) 2006#define SET_DECL_EXPLICIT_INSTANTIATION(NODE) (DECL_USE_TEMPLATE (NODE) = 3) 2007#define CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \ 2008 (CLASSTYPE_USE_TEMPLATE(NODE) == 3) 2009#define SET_CLASSTYPE_EXPLICIT_INSTANTIATION(NODE) \ 2010 (CLASSTYPE_USE_TEMPLATE(NODE) = 3) 2011 2012/* Non-zero if DECL is a friend function which is an instantiation 2013 from the point of view of the compiler, but not from the point of 2014 view of the language. For example given: 2015 template <class T> struct S { friend void f(T) {}; }; 2016 the declaration of `void f(int)' generated when S<int> is 2017 instantiated will not be a DECL_TEMPLATE_INSTANTIATION, but will be 2018 a DECL_FRIEND_PSUEDO_TEMPLATE_INSTANTIATION. */ 2019#define DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION(DECL) \ 2020 (DECL_TEMPLATE_INFO (DECL) && !DECL_USE_TEMPLATE (DECL)) 2021 2022/* Non-zero if TYPE is a partial instantiation of a template class, 2023 i.e., an instantiation whose instantiation arguments involve 2024 template types. */ 2025#define PARTIAL_INSTANTIATION_P(TYPE) \ 2026 (TYPE_LANG_SPECIFIC (TYPE)->type_flags.is_partial_instantiation) 2027 2028/* Non-zero iff we are currently processing a declaration for an 2029 entity with its own template parameter list, and which is not a 2030 full specialization. */ 2031#define PROCESSING_REAL_TEMPLATE_DECL_P() \ 2032 (processing_template_decl > template_class_depth (current_class_type)) 2033 2034/* This function may be a guiding decl for a template. */ 2035#define DECL_MAYBE_TEMPLATE(NODE) DECL_LANG_FLAG_4 (NODE) 2036 2037/* Nonzero if this VAR_DECL or FUNCTION_DECL has already been 2038 instantiated, i.e. its definition has been generated from the 2039 pattern given in the the template. */ 2040#define DECL_TEMPLATE_INSTANTIATED(NODE) DECL_LANG_FLAG_1(NODE) 2041 2042/* We know what we're doing with this decl now. */ 2043#define DECL_INTERFACE_KNOWN(NODE) DECL_LANG_FLAG_5 (NODE) 2044 2045/* This function was declared inline. This flag controls the linkage 2046 semantics of 'inline'; whether or not the function is inlined is 2047 controlled by DECL_INLINE. */ 2048#define DECL_THIS_INLINE(NODE) \ 2049 (DECL_LANG_SPECIFIC (NODE)->decl_flags.declared_inline) 2050 2051/* DECL_EXTERNAL must be set on a decl until the decl is actually emitted, 2052 so that assemble_external will work properly. So we have this flag to 2053 tell us whether the decl is really not external. */ 2054#define DECL_NOT_REALLY_EXTERN(NODE) \ 2055 (DECL_LANG_SPECIFIC (NODE)->decl_flags.not_really_extern) 2056 2057#define DECL_REALLY_EXTERN(NODE) \ 2058 (DECL_EXTERNAL (NODE) && ! DECL_NOT_REALLY_EXTERN (NODE)) 2059 2060#define THUNK_DELTA(DECL) ((DECL)->decl.frame_size.i) 2061 2062/* ...and for unexpanded-parameterized-type nodes. */ 2063#define UPT_TEMPLATE(NODE) TREE_PURPOSE(TYPE_VALUES(NODE)) 2064#define UPT_PARMS(NODE) TREE_VALUE(TYPE_VALUES(NODE)) 2065 2066/* An un-parsed default argument looks like an identifier. */ 2067#define DEFARG_NODE_CHECK(t) TREE_CHECK(t, DEFAULT_ARG) 2068#define DEFARG_LENGTH(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.length) 2069#define DEFARG_POINTER(NODE) (DEFARG_NODE_CHECK(NODE)->identifier.pointer) 2070 2071#define builtin_function(NAME, TYPE, CODE, LIBNAME) \ 2072 define_function (NAME, TYPE, CODE, (void (*) PROTO((tree)))pushdecl, LIBNAME) 2073 2074/* These macros provide convenient access to the various _STMT nodes 2075 created when parsing template declarations. */ 2076#define IF_COND(NODE) TREE_OPERAND (NODE, 0) 2077#define THEN_CLAUSE(NODE) TREE_OPERAND (NODE, 1) 2078#define ELSE_CLAUSE(NODE) TREE_OPERAND (NODE, 2) 2079#define WHILE_COND(NODE) TREE_OPERAND (NODE, 0) 2080#define WHILE_BODY(NODE) TREE_OPERAND (NODE, 1) 2081#define DO_COND(NODE) TREE_OPERAND (NODE, 0) 2082#define DO_BODY(NODE) TREE_OPERAND (NODE, 1) 2083#define RETURN_EXPR(NODE) TREE_OPERAND (NODE, 0) 2084#define EXPR_STMT_EXPR(NODE) TREE_OPERAND (NODE, 0) 2085#define FOR_INIT_STMT(NODE) TREE_OPERAND (NODE, 0) 2086#define FOR_COND(NODE) TREE_OPERAND (NODE, 1) 2087#define FOR_EXPR(NODE) TREE_OPERAND (NODE, 2) 2088#define FOR_BODY(NODE) TREE_OPERAND (NODE, 3) 2089#define SWITCH_COND(NODE) TREE_OPERAND (NODE, 0) 2090#define SWITCH_BODY(NODE) TREE_OPERAND (NODE, 1) 2091#define CASE_LOW(NODE) TREE_OPERAND (NODE, 0) 2092#define CASE_HIGH(NODE) TREE_OPERAND (NODE, 1) 2093#define GOTO_DESTINATION(NODE) TREE_OPERAND (NODE, 0) 2094#define TRY_STMTS(NODE) TREE_OPERAND (NODE, 0) 2095#define TRY_HANDLERS(NODE) TREE_OPERAND (NODE, 1) 2096#define HANDLER_PARMS(NODE) TREE_OPERAND (NODE, 0) 2097#define HANDLER_BODY(NODE) TREE_OPERAND (NODE, 1) 2098#define COMPOUND_BODY(NODE) TREE_OPERAND (NODE, 0) 2099#define ASM_CV_QUAL(NODE) TREE_OPERAND (NODE, 0) 2100#define ASM_STRING(NODE) TREE_OPERAND (NODE, 1) 2101#define ASM_OUTPUTS(NODE) TREE_OPERAND (NODE, 2) 2102#define ASM_INPUTS(NODE) TREE_OPERAND (NODE, 3) 2103#define ASM_CLOBBERS(NODE) TREE_OPERAND (NODE, 4) 2104 2105/* An enumeration of the kind of tags that C++ accepts. */ 2106enum tag_types { record_type, class_type, union_type, enum_type, 2107 signature_type }; 2108 2109/* Zero means prototype weakly, as in ANSI C (no args means nothing). 2110 Each language context defines how this variable should be set. */ 2111extern int strict_prototype; 2112extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus; 2113 2114/* Non-zero means that if a label exists, and no other identifier 2115 applies, use the value of the label. */ 2116extern int flag_labels_ok; 2117 2118/* Non-zero means to collect statistics which might be expensive 2119 and to print them when we are done. */ 2120extern int flag_detailed_statistics; 2121 2122/* Non-zero means warn in function declared in derived class has the 2123 same name as a virtual in the base class, but fails to match the 2124 type signature of any virtual function in the base class. */ 2125extern int warn_overloaded_virtual; 2126 2127/* Nonzero means warn about use of multicharacter literals. */ 2128extern int warn_multichar; 2129 2130/* Non-zero means warn if a non-templatized friend function is 2131 declared in a templatized class. This behavior is warned about with 2132 flag_guiding_decls in do_friend. */ 2133extern int warn_nontemplate_friend; 2134 2135/* in c-common.c */ 2136extern void declare_function_name PROTO((void)); 2137extern void decl_attributes PROTO((tree, tree, tree)); 2138extern void init_function_format_info PROTO((void)); 2139extern void record_function_format PROTO((tree, tree, int, int, int)); 2140extern void check_function_format PROTO((tree, tree, tree)); 2141/* Print an error message for invalid operands to arith operation CODE. 2142 NOP_EXPR is used as a special case (see truthvalue_conversion). */ 2143extern void binary_op_error PROTO((enum tree_code)); 2144extern tree cp_build_qualified_type PROTO((tree, int)); 2145extern tree canonical_type_variant PROTO((tree)); 2146extern void c_expand_expr_stmt PROTO((tree)); 2147/* Validate the expression after `case' and apply default promotions. */ 2148extern tree check_case_value PROTO((tree)); 2149/* Concatenate a list of STRING_CST nodes into one STRING_CST. */ 2150extern tree combine_strings PROTO((tree)); 2151extern void constant_expression_warning PROTO((tree)); 2152extern tree convert_and_check PROTO((tree, tree)); 2153extern void overflow_warning PROTO((tree)); 2154extern void unsigned_conversion_warning PROTO((tree, tree)); 2155extern void c_apply_type_quals_to_decl PROTO((int, tree)); 2156 2157/* Read the rest of the current #-directive line. */ 2158#if USE_CPPLIB 2159extern char *get_directive_line PROTO((void)); 2160#define GET_DIRECTIVE_LINE() get_directive_line () 2161#else 2162extern char *get_directive_line PROTO((FILE *)); 2163#define GET_DIRECTIVE_LINE() get_directive_line (finput) 2164#endif 2165/* Subroutine of build_binary_op, used for comparison operations. 2166 See if the operands have both been converted from subword integer types 2167 and, if so, perhaps change them both back to their original type. */ 2168extern tree shorten_compare PROTO((tree *, tree *, tree *, enum tree_code *)); 2169/* Prepare expr to be an argument of a TRUTH_NOT_EXPR, 2170 or validate its data type for an `if' or `while' statement or ?..: exp. */ 2171extern tree truthvalue_conversion PROTO((tree)); 2172extern tree type_for_mode PROTO((enum machine_mode, int)); 2173extern tree type_for_size PROTO((unsigned, int)); 2174extern int c_get_alias_set PROTO((tree)); 2175 2176/* in decl{2}.c */ 2177extern tree void_list_node; 2178extern tree void_zero_node; 2179extern tree default_function_type; 2180extern tree vtable_entry_type; 2181extern tree sigtable_entry_type; 2182extern tree __t_desc_type_node; 2183#if 0 2184extern tree __tp_desc_type_node; 2185#endif 2186extern tree __access_mode_type_node; 2187extern tree __bltn_desc_type_node, __user_desc_type_node; 2188extern tree __class_desc_type_node, __attr_desc_type_node; 2189extern tree __ptr_desc_type_node, __func_desc_type_node; 2190extern tree __ptmf_desc_type_node, __ptmd_desc_type_node; 2191extern tree type_info_type_node; 2192extern tree class_star_type_node; 2193extern tree this_identifier; 2194extern tree ctor_identifier, dtor_identifier; 2195extern tree pfn_identifier; 2196extern tree index_identifier; 2197extern tree delta_identifier; 2198extern tree delta2_identifier; 2199extern tree pfn_or_delta2_identifier; 2200extern tree tag_identifier; 2201extern tree vt_off_identifier; 2202extern tree in_charge_identifier; 2203 2204/* A node that is a list (length 1) of error_mark_nodes. */ 2205extern tree error_mark_list; 2206 2207extern tree ptr_type_node; 2208extern tree class_type_node, record_type_node, union_type_node, enum_type_node; 2209extern tree unknown_type_node; 2210extern tree opaque_type_node, signature_type_node; 2211 2212extern tree vlist_identifier, vlist_type_node, vlist_zero_node; 2213 2214/* Node for "pointer to (virtual) function". 2215 This may be distinct from ptr_type_node so gdb can distinguish them. */ 2216#define vfunc_ptr_type_node \ 2217 (flag_vtable_thunks ? vtable_entry_type : ptr_type_node) 2218 2219/* The type of a vtbl, i.e., an array of vtable entries. */ 2220extern tree vtbl_type_node; 2221/* The type of a class vtbl pointer, i.e., a pointer to a vtable entry. */ 2222extern tree vtbl_ptr_type_node; 2223extern tree delta_type_node; 2224extern tree std_node; 2225 2226extern tree long_long_integer_type_node, long_long_unsigned_type_node; 2227/* For building calls to `delete'. */ 2228extern tree integer_two_node, integer_three_node; 2229extern tree boolean_type_node, boolean_true_node, boolean_false_node; 2230 2231extern tree null_node; 2232 2233extern tree anonymous_namespace_name; 2234 2235/* The FUNCTION_DECL for the default `::operator delete'. */ 2236 2237extern tree global_delete_fndecl; 2238 2239/* in pt.c */ 2240 2241/* These values are used for the `STRICT' parameter to type_unfication and 2242 fn_type_unification. Their meanings are described with the 2243 documentation for fn_type_unification. */ 2244 2245typedef enum unification_kind_t { 2246 DEDUCE_CALL, 2247 DEDUCE_CONV, 2248 DEDUCE_EXACT 2249} unification_kind_t; 2250 2251extern tree current_template_parms; 2252extern HOST_WIDE_INT processing_template_decl; 2253extern tree last_tree; 2254 2255/* The template currently being instantiated, and where the instantiation 2256 was triggered. */ 2257struct tinst_level 2258{ 2259 tree decl; 2260 int line; 2261 char *file; 2262 struct tinst_level *next; 2263}; 2264 2265extern int minimal_parse_mode; 2266 2267extern void maybe_print_template_context PROTO ((void)); 2268 2269/* in class.c */ 2270 2271/* When parsing a class definition, the access specifier most recently 2272 given by the user, or, if no access specifier was given, the 2273 default value appropriate for the kind of class (i.e., struct, 2274 class, or union). */ 2275extern tree current_access_specifier; 2276 2277extern tree current_class_name; 2278extern tree current_class_type; 2279extern tree current_class_ptr; 2280extern tree previous_class_type; 2281extern tree current_class_ref; 2282extern int current_class_depth; 2283 2284extern tree current_lang_name; 2285extern tree lang_name_cplusplus, lang_name_c, lang_name_java; 2286 2287/* The low-water mark on the class-cache obstack. */ 2288extern char *class_cache_firstobj; 2289 2290/* Points to the name of that function. May not be the DECL_NAME 2291 of CURRENT_FUNCTION_DECL due to overloading */ 2292extern tree original_function_name; 2293 2294/* in init.c */ 2295extern tree global_base_init_list; 2296extern tree current_base_init_list, current_member_init_list; 2297 2298extern int current_function_just_assigned_this; 2299extern int current_function_parms_stored; 2300 2301/* Here's where we control how name mangling takes place. */ 2302 2303#define OPERATOR_ASSIGN_FORMAT "__a%s" 2304#define OPERATOR_FORMAT "__%s" 2305#define OPERATOR_TYPENAME_FORMAT "__op" 2306 2307/* Cannot use '$' up front, because this confuses gdb 2308 (names beginning with '$' are gdb-local identifiers). 2309 2310 Note that all forms in which the '$' is significant are long enough 2311 for direct indexing (meaning that if we know there is a '$' 2312 at a particular location, we can index into the string at 2313 any other location that provides distinguishing characters). */ 2314 2315/* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler 2316 doesn't allow '$' in symbol names. */ 2317#ifndef NO_DOLLAR_IN_LABEL 2318 2319#define JOINER '$' 2320 2321#define VPTR_NAME "$v" 2322#define THROW_NAME "$eh_throw" 2323#define DESTRUCTOR_DECL_PREFIX "_$_" 2324#define AUTO_VTABLE_NAME "__vtbl$me__" 2325#define AUTO_TEMP_NAME "_$tmp_" 2326#define AUTO_TEMP_FORMAT "_$tmp_%d" 2327#define VTABLE_BASE "$vb" 2328#define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt$%s") 2329#define VCTABLE_NAME "__vc$" 2330#define VLIST_NAME_FORMAT "__vl$%s" 2331#define VFIELD_BASE "$vf" 2332#define VFIELD_NAME "_vptr$" 2333#define VFIELD_NAME_FORMAT "_vptr$%s" 2334#define VBASE_NAME "_vb$" 2335#define VBASE_NAME_FORMAT "_vb$%s" 2336#define STATIC_NAME_FORMAT "_%s$%s" 2337#define ANON_AGGRNAME_FORMAT "$_%d" 2338 2339#else /* NO_DOLLAR_IN_LABEL */ 2340 2341#ifndef NO_DOT_IN_LABEL 2342 2343#define JOINER '.' 2344 2345#define VPTR_NAME ".v" 2346#define THROW_NAME ".eh_throw" 2347#define DESTRUCTOR_DECL_PREFIX "_._" 2348#define AUTO_VTABLE_NAME "__vtbl.me__" 2349#define AUTO_TEMP_NAME "_.tmp_" 2350#define AUTO_TEMP_FORMAT "_.tmp_%d" 2351#define VTABLE_BASE ".vb" 2352#define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt.%s") 2353#define VCTABLE_NAME "__vc." 2354#define VLIST_NAME_FORMAT "__vl.%s" 2355#define VFIELD_BASE ".vf" 2356#define VFIELD_NAME "_vptr." 2357#define VFIELD_NAME_FORMAT "_vptr.%s" 2358#define VBASE_NAME "_vb." 2359#define VBASE_NAME_FORMAT "_vb.%s" 2360#define STATIC_NAME_FORMAT "_%s.%s" 2361 2362#define ANON_AGGRNAME_FORMAT "._%d" 2363 2364#else /* NO_DOT_IN_LABEL */ 2365 2366#define VPTR_NAME "__vptr" 2367#define VPTR_NAME_P(ID_NODE) \ 2368 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1)) 2369#define THROW_NAME "__eh_throw" 2370#define DESTRUCTOR_DECL_PREFIX "__destr_" 2371#define DESTRUCTOR_NAME_P(ID_NODE) \ 2372 (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \ 2373 sizeof (DESTRUCTOR_DECL_PREFIX) - 1)) 2374#define IN_CHARGE_NAME "__in_chrg" 2375#define AUTO_VTABLE_NAME "__vtbl_me__" 2376#define AUTO_TEMP_NAME "__tmp_" 2377#define TEMP_NAME_P(ID_NODE) \ 2378 (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \ 2379 sizeof (AUTO_TEMP_NAME) - 1)) 2380#define AUTO_TEMP_FORMAT "__tmp_%d" 2381#define VTABLE_BASE "__vtb" 2382#define VTABLE_NAME "__vt_" 2383#define VTABLE_NAME_FORMAT (flag_vtable_thunks ? "__vt_%s" : "_vt_%s") 2384#define VTABLE_NAME_P(ID_NODE) \ 2385 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \ 2386 sizeof (VTABLE_NAME) - 1)) 2387#define VCTABLE_NAME "__vc_" 2388#define VLIST_NAME_FORMAT "__vl_%s" 2389#define VFIELD_BASE "__vfb" 2390#define VFIELD_NAME "__vptr_" 2391#define VFIELD_NAME_P(ID_NODE) \ 2392 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \ 2393 sizeof (VFIELD_NAME) - 1)) 2394#define VFIELD_NAME_FORMAT "_vptr_%s" 2395#define VBASE_NAME "__vb_" 2396#define VBASE_NAME_P(ID_NODE) \ 2397 (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \ 2398 sizeof (VBASE_NAME) - 1)) 2399#define VBASE_NAME_FORMAT "__vb_%s" 2400#define STATIC_NAME_FORMAT "__static_%s_%s" 2401 2402#define ANON_AGGRNAME_PREFIX "__anon_" 2403#define ANON_AGGRNAME_P(ID_NODE) \ 2404 (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \ 2405 sizeof (ANON_AGGRNAME_PREFIX) - 1)) 2406#define ANON_AGGRNAME_FORMAT "__anon_%d" 2407#define ANON_PARMNAME_FORMAT "__%d" 2408#define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \ 2409 && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \ 2410 && IDENTIFIER_POINTER (ID_NODE)[2] <= '9') 2411 2412#endif /* NO_DOT_IN_LABEL */ 2413#endif /* NO_DOLLAR_IN_LABEL */ 2414 2415#define THIS_NAME "this" 2416#define DESTRUCTOR_NAME_FORMAT "~%s" 2417#define FILE_FUNCTION_PREFIX_LEN 9 2418#define CTOR_NAME "__ct" 2419#define DTOR_NAME "__dt" 2420 2421#define IN_CHARGE_NAME "__in_chrg" 2422#define VLIST_NAME "__vlist" 2423#define VLIST1_NAME "__vlist1" 2424#define VLIST_TYPE_NAME "6_Vlist" 2425 2426#define VTBL_PTR_TYPE "__vtbl_ptr_type" 2427#define VTABLE_DELTA_NAME "__delta" 2428#define VTABLE_INDEX_NAME "__index" 2429#define VTABLE_PFN_NAME "__pfn" 2430#define VTABLE_DELTA2_NAME "__delta2" 2431 2432#define SIGNATURE_FIELD_NAME "__s_" 2433#define SIGNATURE_FIELD_NAME_FORMAT "__s_%s" 2434#define SIGNATURE_OPTR_NAME "__optr" 2435#define SIGNATURE_SPTR_NAME "__sptr" 2436#define SIGNATURE_POINTER_NAME "__sp_" 2437#define SIGNATURE_POINTER_NAME_FORMAT "__%s%s%ssp_%s" 2438#define SIGNATURE_REFERENCE_NAME "__sr_" 2439#define SIGNATURE_REFERENCE_NAME_FORMAT "__%s%s%ssr_%s" 2440 2441#define SIGTABLE_PTR_TYPE "__sigtbl_ptr_type" 2442#define SIGTABLE_NAME_FORMAT "__st_%s_%s" 2443#define SIGTABLE_NAME_FORMAT_LONG "__st_%s_%s_%d" 2444#define SIGTABLE_TAG_NAME "__tag" 2445#define SIGTABLE_VB_OFF_NAME "__vb_off" 2446#define SIGTABLE_VT_OFF_NAME "__vt_off" 2447#define EXCEPTION_CLEANUP_NAME "exception cleanup" 2448 2449#define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0) 2450 2451#if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) 2452 2453#define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ 2454 && IDENTIFIER_POINTER (ID_NODE)[1] == 'v') 2455#define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER \ 2456 && IDENTIFIER_POINTER (ID_NODE)[2] == '_') 2457 2458#define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ 2459 && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \ 2460 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) 2461 2462#define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ 2463 && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \ 2464 && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) 2465 2466#define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1)) 2467#define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1)) 2468 2469/* For anonymous aggregate types, we need some sort of name to 2470 hold on to. In practice, this should not appear, but it should 2471 not be harmful if it does. */ 2472#define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ 2473 && IDENTIFIER_POINTER (ID_NODE)[1] == '_') 2474#define ANON_PARMNAME_FORMAT "_%d" 2475#define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \ 2476 && IDENTIFIER_POINTER (ID_NODE)[1] <= '9') 2477#endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */ 2478 2479/* Store the vbase pointer field name for type TYPE into pointer BUF. */ 2480#define FORMAT_VBASE_NAME(BUF,TYPE) do { \ 2481 char *wbuf = (char *) alloca (TYPE_ASSEMBLER_NAME_LENGTH (TYPE) \ 2482 + sizeof (VBASE_NAME) + 1); \ 2483 sprintf (wbuf, VBASE_NAME_FORMAT, TYPE_ASSEMBLER_NAME_STRING (TYPE)); \ 2484 (BUF) = wbuf; \ 2485} while (0) 2486 2487/* Returns non-zero iff ID_NODE is an IDENTIFIER_NODE whose name is 2488 `main'. */ 2489#define MAIN_NAME_P(ID_NODE) \ 2490 (strcmp (IDENTIFIER_POINTER (ID_NODE), "main") == 0) 2491 2492/* Returns non-zero iff NODE is a declaration for the global function 2493 `main'. */ 2494#define DECL_MAIN_P(NODE) \ 2495 (TREE_CODE (NODE) == FUNCTION_DECL \ 2496 && DECL_LANGUAGE (NODE) == lang_c \ 2497 && DECL_NAME (NODE) != NULL_TREE \ 2498 && MAIN_NAME_P (DECL_NAME (NODE))) 2499 2500 2501/* Define the sets of attributes that member functions and baseclasses 2502 can have. These are sensible combinations of {public,private,protected} 2503 cross {virtual,non-virtual}. */ 2504 2505/* in class.c. */ 2506extern tree access_default_node; /* 0 */ 2507extern tree access_public_node; /* 1 */ 2508extern tree access_protected_node; /* 2 */ 2509extern tree access_private_node; /* 3 */ 2510extern tree access_default_virtual_node; /* 4 */ 2511extern tree access_public_virtual_node; /* 5 */ 2512extern tree access_protected_virtual_node; /* 6 */ 2513extern tree access_private_virtual_node; /* 7 */ 2514 2515/* Things for handling inline functions. */ 2516 2517struct pending_inline 2518{ 2519 struct pending_inline *next; /* pointer to next in chain */ 2520 int lineno; /* line number we got the text from */ 2521 char *filename; /* name of file we were processing */ 2522 tree fndecl; /* FUNCTION_DECL that brought us here */ 2523 int token; /* token we were scanning */ 2524 int token_value; /* value of token we were scanning (YYSTYPE) */ 2525 2526 char *buf; /* pointer to character stream */ 2527 int len; /* length of stream */ 2528 unsigned int can_free : 1; /* free this after we're done with it? */ 2529 unsigned int deja_vu : 1; /* set iff we don't want to see it again. */ 2530 unsigned int interface : 2; /* 0=interface 1=unknown 2=implementation */ 2531}; 2532 2533/* in method.c */ 2534extern struct pending_inline *pending_inlines; 2535 2536/* Positive values means that we cannot make optimizing assumptions about 2537 `this'. Negative values means we know `this' to be of static type. */ 2538 2539extern int flag_this_is_variable; 2540 2541/* Nonzero means generate 'rtti' that give run-time type information. */ 2542 2543extern int flag_rtti; 2544 2545/* Nonzero means do emit exported implementations of functions even if 2546 they can be inlined. */ 2547 2548extern int flag_implement_inlines; 2549 2550/* Nonzero means templates obey #pragma interface and implementation. */ 2551 2552extern int flag_external_templates; 2553 2554/* Nonzero means templates are emitted where they are instantiated. */ 2555 2556extern int flag_alt_external_templates; 2557 2558/* Nonzero means implicit template instantiations are emitted. */ 2559 2560extern int flag_implicit_templates; 2561 2562/* Nonzero if we want to emit defined symbols with common-like linkage as 2563 weak symbols where possible, in order to conform to C++ semantics. 2564 Otherwise, emit them as local symbols. */ 2565 2566extern int flag_weak; 2567 2568/* Nonzero to enable experimental ABI changes. */ 2569 2570extern int flag_new_abi; 2571 2572/* Nonzero to not ignore namespace std. */ 2573 2574extern int flag_honor_std; 2575 2576/* Nonzero if we're done parsing and into end-of-file activities. */ 2577 2578extern int at_eof; 2579 2580enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; 2581 2582/* The following two can be derived from the previous one */ 2583extern tree current_class_name; /* IDENTIFIER_NODE: name of current class */ 2584 2585/* Some macros for char-based bitfields. */ 2586#define B_SET(a,x) (a[x>>3] |= (1 << (x&7))) 2587#define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7))) 2588#define B_TST(a,x) (a[x>>3] & (1 << (x&7))) 2589 2590/* These are uses as bits in flags passed to build_method_call 2591 to control its error reporting behavior. 2592 2593 LOOKUP_PROTECT means flag access violations. 2594 LOOKUP_COMPLAIN mean complain if no suitable member function 2595 matching the arguments is found. 2596 LOOKUP_NORMAL is just a combination of these two. 2597 LOOKUP_NONVIRTUAL means make a direct call to the member function found 2598 LOOKUP_GLOBAL means search through the space of overloaded functions, 2599 as well as the space of member functions. 2600 LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already 2601 in the parameter list. 2602 LOOKUP_HAS_VLIST means that the "vlist" variable is already in 2603 the parameter list. 2604 LOOKUP_ONLYCONVERTING means that non-conversion constructors are not tried. 2605 DIRECT_BIND means that if a temporary is created, it should be created so 2606 that it lives as long as the current variable bindings; otherwise it 2607 only lives until the end of the complete-expression. 2608 LOOKUP_SPECULATIVELY means return NULL_TREE if we cannot find what we are 2609 after. Note, LOOKUP_COMPLAIN is checked and error messages printed 2610 before LOOKUP_SPECULATIVELY is checked. 2611 LOOKUP_NO_CONVERSION means that user-defined conversions are not 2612 permitted. Built-in conversions are permitted. 2613 LOOKUP_DESTRUCTOR means explicit call to destructor. 2614 LOOKUP_NO_TEMP_BIND means temporaries will not be bound to references. 2615 2616 These are used in global lookup to support elaborated types and 2617 qualifiers. 2618 2619 LOOKUP_PREFER_TYPES means not to accept objects, and possibly namespaces. 2620 LOOKUP_PREFER_NAMESPACES means not to accept objects, and possibly types. 2621 LOOKUP_PREFER_BOTH means class-or-namespace-name. 2622 LOOKUP_TEMPLATES_EXPECTED means that class templates also count 2623 as types. */ 2624 2625#define LOOKUP_PROTECT (1) 2626#define LOOKUP_COMPLAIN (2) 2627#define LOOKUP_NORMAL (3) 2628/* #define LOOKUP_UNUSED (4) */ 2629#define LOOKUP_NONVIRTUAL (8) 2630#define LOOKUP_GLOBAL (16) 2631#define LOOKUP_HAS_IN_CHARGE (32) 2632#define LOOKUP_SPECULATIVELY (64) 2633#define LOOKUP_ONLYCONVERTING (128) 2634#define DIRECT_BIND (256) 2635#define LOOKUP_NO_CONVERSION (512) 2636#define LOOKUP_DESTRUCTOR (512) 2637#define LOOKUP_NO_TEMP_BIND (1024) 2638#define LOOKUP_PREFER_TYPES (2048) 2639#define LOOKUP_PREFER_NAMESPACES (4096) 2640#define LOOKUP_PREFER_BOTH (6144) 2641#define LOOKUP_TEMPLATES_EXPECTED (8192) 2642#define LOOKUP_HAS_VLIST (16384) 2643 2644#define LOOKUP_NAMESPACES_ONLY(f) \ 2645 (((f) & LOOKUP_PREFER_NAMESPACES) && !((f) & LOOKUP_PREFER_TYPES)) 2646#define LOOKUP_TYPES_ONLY(f) \ 2647 (!((f) & LOOKUP_PREFER_NAMESPACES) && ((f) & LOOKUP_PREFER_TYPES)) 2648#define LOOKUP_QUALIFIERS_ONLY(f) ((f) & LOOKUP_PREFER_BOTH) 2649 2650 2651/* These flags are used by the conversion code. 2652 CONV_IMPLICIT : Perform implicit conversions (standard and user-defined). 2653 CONV_STATIC : Perform the explicit conversions for static_cast. 2654 CONV_CONST : Perform the explicit conversions for const_cast. 2655 CONV_REINTERPRET: Perform the explicit conversions for reinterpret_cast. 2656 CONV_PRIVATE : Perform upcasts to private bases. 2657 CONV_FORCE_TEMP : Require a new temporary when converting to the same 2658 aggregate type. */ 2659 2660#define CONV_IMPLICIT 1 2661#define CONV_STATIC 2 2662#define CONV_CONST 4 2663#define CONV_REINTERPRET 8 2664#define CONV_PRIVATE 16 2665/* #define CONV_NONCONVERTING 32 */ 2666#define CONV_FORCE_TEMP 64 2667#define CONV_STATIC_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_FORCE_TEMP) 2668#define CONV_OLD_CONVERT (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ 2669 | CONV_REINTERPRET) 2670#define CONV_C_CAST (CONV_IMPLICIT | CONV_STATIC | CONV_CONST \ 2671 | CONV_REINTERPRET | CONV_PRIVATE | CONV_FORCE_TEMP) 2672 2673/* Used by build_expr_type_conversion to indicate which types are 2674 acceptable as arguments to the expression under consideration. */ 2675 2676#define WANT_INT 1 /* integer types, including bool */ 2677#define WANT_FLOAT 2 /* floating point types */ 2678#define WANT_ENUM 4 /* enumerated types */ 2679#define WANT_POINTER 8 /* pointer types */ 2680#define WANT_NULL 16 /* null pointer constant */ 2681#define WANT_ARITH (WANT_INT | WANT_FLOAT) 2682 2683/* Used with comptypes, and related functions, to guide type 2684 comparison. */ 2685 2686#define COMPARE_STRICT 0 /* Just check if the types are the 2687 same. */ 2688#define COMPARE_BASE 1 /* Check to see if the second type is 2689 derived from the first, or if both 2690 are pointers (or references) and 2691 the types pointed to by the second 2692 type is derived from the pointed to 2693 by the first. */ 2694#define COMPARE_RELAXED 2 /* Like COMPARE_DERIVED, but in 2695 reverse. Also treat enmeration 2696 types as the same as integer types 2697 of the same width. */ 2698#define COMPARE_REDECLARATION 4 /* The comparsion is being done when 2699 another declaration of an existing 2700 entity is seen. */ 2701#define COMPARE_NO_ATTRIBUTES 8 /* The comparison should ignore 2702 extra-linguistic type attributes. */ 2703 2704/* Used with push_overloaded_decl. */ 2705#define PUSH_GLOBAL 0 /* Push the DECL into namespace scope, 2706 regardless of the current scope. */ 2707#define PUSH_LOCAL 1 /* Push the DECL into the current 2708 scope. */ 2709#define PUSH_USING 2 /* We are pushing this DECL as the 2710 result of a using declaration. */ 2711 2712/* Returns nonzero iff TYPE1 and TYPE2 are the same type, in the usual 2713 sense of `same'. */ 2714#define same_type_p(type1, type2) \ 2715 comptypes ((type1), (type2), COMPARE_STRICT) 2716 2717/* Returns nonzero iff TYPE1 and TYPE2 are the same type, or if TYPE2 2718 is derived from TYPE1, or if TYPE2 is a pointer (reference) to a 2719 class derived from the type pointed to (referred to) by TYPE1. */ 2720#define same_or_base_type_p(type1, type2) \ 2721 comptypes ((type1), (type2), COMPARE_BASE) 2722 2723/* These macros are used to access a TEMPLATE_PARM_INDEX. */ 2724#define TEMPLATE_PARM_IDX(NODE) (((template_parm_index*) NODE)->index) 2725#define TEMPLATE_PARM_LEVEL(NODE) (((template_parm_index*) NODE)->level) 2726#define TEMPLATE_PARM_DESCENDANTS(NODE) (TREE_CHAIN (NODE)) 2727#define TEMPLATE_PARM_ORIG_LEVEL(NODE) (((template_parm_index*) NODE)->orig_level) 2728#define TEMPLATE_PARM_DECL(NODE) (((template_parm_index*) NODE)->decl) 2729 2730/* These macros are for accessing the fields of TEMPLATE_TYPE_PARM 2731 and TEMPLATE_TEMPLATE_PARM nodes. */ 2732#define TEMPLATE_TYPE_PARM_INDEX(NODE) (TYPE_FIELDS (NODE)) 2733#define TEMPLATE_TYPE_IDX(NODE) \ 2734 (TEMPLATE_PARM_IDX (TEMPLATE_TYPE_PARM_INDEX (NODE))) 2735#define TEMPLATE_TYPE_LEVEL(NODE) \ 2736 (TEMPLATE_PARM_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE))) 2737#define TEMPLATE_TYPE_ORIG_LEVEL(NODE) \ 2738 (TEMPLATE_PARM_ORIG_LEVEL (TEMPLATE_TYPE_PARM_INDEX (NODE))) 2739#define TEMPLATE_TYPE_DECL(NODE) \ 2740 (TEMPLATE_PARM_DECL (TEMPLATE_TYPE_PARM_INDEX (NODE))) 2741 2742/* in lex.c */ 2743/* Indexed by TREE_CODE, these tables give C-looking names to 2744 operators represented by TREE_CODES. For example, 2745 opname_tab[(int) MINUS_EXPR] == "-". */ 2746extern char **opname_tab, **assignop_tab; 2747 2748/* in call.c */ 2749extern int check_dtor_name PROTO((tree, tree)); 2750extern int get_arglist_len_in_bytes PROTO((tree)); 2751 2752extern tree build_vfield_ref PROTO((tree, tree)); 2753extern tree resolve_scope_to_name PROTO((tree, tree)); 2754extern tree build_scoped_method_call PROTO((tree, tree, tree, tree)); 2755extern tree build_addr_func PROTO((tree)); 2756extern tree build_call PROTO((tree, tree, tree)); 2757extern tree build_method_call PROTO((tree, tree, tree, tree, int)); 2758extern int null_ptr_cst_p PROTO((tree)); 2759extern tree type_decays_to PROTO((tree)); 2760extern tree build_user_type_conversion PROTO((tree, tree, int)); 2761extern tree build_new_function_call PROTO((tree, tree)); 2762extern tree build_new_op PROTO((enum tree_code, int, tree, tree, tree)); 2763extern tree build_op_new_call PROTO((enum tree_code, tree, tree, int)); 2764extern tree build_op_delete_call PROTO((enum tree_code, tree, tree, int, tree)); 2765extern int can_convert PROTO((tree, tree)); 2766extern int can_convert_arg PROTO((tree, tree, tree)); 2767extern int enforce_access PROTO((tree, tree)); 2768extern tree convert_default_arg PROTO((tree, tree, tree)); 2769extern tree convert_arg_to_ellipsis PROTO((tree)); 2770extern int is_properly_derived_from PROTO((tree, tree)); 2771 2772/* in class.c */ 2773extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int)); 2774extern tree build_vtbl_ref PROTO((tree, tree)); 2775extern tree build_vfn_ref PROTO((tree *, tree, tree)); 2776extern void add_method PROTO((tree, tree *, tree)); 2777extern int currently_open_class PROTO((tree)); 2778extern tree get_vfield_offset PROTO((tree)); 2779extern void duplicate_tag_error PROTO((tree)); 2780extern tree finish_struct PROTO((tree, tree, int)); 2781extern void finish_struct_1 PROTO((tree, int)); 2782extern int resolves_to_fixed_type_p PROTO((tree, int *)); 2783extern void init_class_processing PROTO((void)); 2784extern int is_empty_class PROTO((tree)); 2785extern void pushclass PROTO((tree, int)); 2786extern void popclass PROTO((void)); 2787extern void push_nested_class PROTO((tree, int)); 2788extern void pop_nested_class PROTO((void)); 2789extern void push_lang_context PROTO((tree)); 2790extern void pop_lang_context PROTO((void)); 2791extern tree instantiate_type PROTO((tree, tree, int)); 2792extern void print_class_statistics PROTO((void)); 2793extern void push_cache_obstack PROTO((void)); 2794extern unsigned HOST_WIDE_INT skip_rtti_stuff PROTO((tree *, tree)); 2795extern void build_self_reference PROTO((void)); 2796extern void warn_hidden PROTO((tree)); 2797extern tree get_enclosing_class PROTO((tree)); 2798int is_base_of_enclosing_class PROTO((tree, tree)); 2799extern void unreverse_member_declarations PROTO((tree)); 2800extern void invalidate_class_lookup_cache PROTO((void)); 2801extern void maybe_note_name_used_in_class PROTO((tree, tree)); 2802extern void note_name_declared_in_class PROTO((tree, tree)); 2803 2804/* in cvt.c */ 2805extern tree convert_to_reference PROTO((tree, tree, int, int, tree)); 2806extern tree convert_from_reference PROTO((tree)); 2807extern tree convert_pointer_to_real PROTO((tree, tree)); 2808extern tree convert_pointer_to PROTO((tree, tree)); 2809extern tree ocp_convert PROTO((tree, tree, int, int)); 2810extern tree cp_convert PROTO((tree, tree)); 2811extern tree convert PROTO((tree, tree)); 2812extern tree convert_force PROTO((tree, tree, int)); 2813extern tree build_type_conversion PROTO((tree, tree, int)); 2814extern tree build_expr_type_conversion PROTO((int, tree, int)); 2815extern tree type_promotes_to PROTO((tree)); 2816extern tree perform_qualification_conversions PROTO((tree, tree)); 2817 2818/* decl.c */ 2819/* resume_binding_level */ 2820extern void set_identifier_local_value PROTO((tree, tree)); 2821extern int global_bindings_p PROTO((void)); 2822extern int toplevel_bindings_p PROTO((void)); 2823extern int namespace_bindings_p PROTO((void)); 2824extern void keep_next_level PROTO((void)); 2825extern int kept_level_p PROTO((void)); 2826extern void declare_parm_level PROTO((void)); 2827extern void declare_pseudo_global_level PROTO((void)); 2828extern int pseudo_global_level_p PROTO((void)); 2829extern void set_class_shadows PROTO((tree)); 2830extern void pushlevel PROTO((int)); 2831extern void note_level_for_for PROTO((void)); 2832extern void pushlevel_temporary PROTO((int)); 2833extern tree poplevel PROTO((int, int, int)); 2834extern void resume_level PROTO((struct binding_level *)); 2835extern void delete_block PROTO((tree)); 2836extern void insert_block PROTO((tree)); 2837extern void add_block_current_level PROTO((tree)); 2838extern void set_block PROTO((tree)); 2839extern void pushlevel_class PROTO((void)); 2840extern void print_binding_stack PROTO((void)); 2841extern void print_binding_level PROTO((struct binding_level *)); 2842extern void push_namespace PROTO((tree)); 2843extern void pop_namespace PROTO((void)); 2844extern void maybe_push_to_top_level PROTO((int)); 2845extern void push_to_top_level PROTO((void)); 2846extern void pop_from_top_level PROTO((void)); 2847extern tree identifier_type_value PROTO((tree)); 2848extern void set_identifier_type_value PROTO((tree, tree)); 2849extern void pop_everything PROTO((void)); 2850extern void pushtag PROTO((tree, tree, int)); 2851extern tree make_anon_name PROTO((void)); 2852extern void clear_anon_tags PROTO((void)); 2853extern int decls_match PROTO((tree, tree)); 2854extern int duplicate_decls PROTO((tree, tree)); 2855extern tree pushdecl PROTO((tree)); 2856extern tree pushdecl_top_level PROTO((tree)); 2857extern void pushdecl_class_level PROTO((tree)); 2858#if 0 2859extern void pushdecl_nonclass_level PROTO((tree)); 2860#endif 2861extern tree pushdecl_namespace_level PROTO((tree)); 2862extern tree push_using_decl PROTO((tree, tree)); 2863extern tree push_using_directive PROTO((tree)); 2864extern void push_class_level_binding PROTO((tree, tree)); 2865extern tree implicitly_declare PROTO((tree)); 2866extern tree lookup_label PROTO((tree)); 2867extern tree shadow_label PROTO((tree)); 2868extern tree define_label PROTO((char *, int, tree)); 2869extern void push_switch PROTO((void)); 2870extern void pop_switch PROTO((void)); 2871extern void define_case_label PROTO((void)); 2872extern tree getdecls PROTO((void)); 2873extern tree gettags PROTO((void)); 2874#if 0 2875extern void set_current_level_tags_transparency PROTO((int)); 2876#endif 2877extern tree binding_for_name PROTO((tree, tree)); 2878extern tree namespace_binding PROTO((tree, tree)); 2879extern void set_namespace_binding PROTO((tree, tree, tree)); 2880extern tree lookup_namespace_name PROTO((tree, tree)); 2881extern tree build_typename_type PROTO((tree, tree, tree, tree)); 2882extern tree make_typename_type PROTO((tree, tree)); 2883extern tree lookup_name_nonclass PROTO((tree)); 2884extern tree lookup_function_nonclass PROTO((tree, tree)); 2885extern tree lookup_name PROTO((tree, int)); 2886extern tree lookup_name_current_level PROTO((tree)); 2887extern tree lookup_type_current_level PROTO((tree)); 2888extern tree lookup_name_namespace_only PROTO((tree)); 2889extern void begin_only_namespace_names PROTO((void)); 2890extern void end_only_namespace_names PROTO((void)); 2891extern tree namespace_ancestor PROTO((tree, tree)); 2892extern int lookup_using_namespace PROTO((tree,tree,tree,tree,int)); 2893extern int qualified_lookup_using_namespace PROTO((tree,tree,tree,int)); 2894extern tree auto_function PROTO((tree, tree, enum built_in_function)); 2895extern void init_decl_processing PROTO((void)); 2896extern int init_type_desc PROTO((void)); 2897extern tree define_function 2898 PROTO((const char *, tree, enum built_in_function, 2899 void (*) (tree), const char *)); 2900extern tree check_tag_decl PROTO((tree)); 2901extern void shadow_tag PROTO((tree)); 2902extern tree groktypename PROTO((tree)); 2903extern tree start_decl PROTO((tree, tree, int, tree, tree)); 2904extern void start_decl_1 PROTO((tree)); 2905extern void cp_finish_decl PROTO((tree, tree, tree, int, int)); 2906extern void finish_decl PROTO((tree, tree, tree)); 2907extern void expand_static_init PROTO((tree, tree)); 2908extern int complete_array_type PROTO((tree, tree, int)); 2909extern tree build_ptrmemfunc_type PROTO((tree)); 2910/* the grokdeclarator prototype is in decl.h */ 2911extern int parmlist_is_exprlist PROTO((tree)); 2912extern int copy_args_p PROTO((tree)); 2913extern int grok_ctor_properties PROTO((tree, tree)); 2914extern void grok_op_properties PROTO((tree, int, int)); 2915extern tree xref_tag PROTO((tree, tree, int)); 2916extern tree xref_tag_from_type PROTO((tree, tree, int)); 2917extern void xref_basetypes PROTO((tree, tree, tree, tree)); 2918extern tree start_enum PROTO((tree)); 2919extern tree finish_enum PROTO((tree)); 2920extern tree build_enumerator PROTO((tree, tree, tree)); 2921extern int start_function PROTO((tree, tree, tree, int)); 2922extern void expand_start_early_try_stmts PROTO((void)); 2923extern void store_parm_decls PROTO((void)); 2924extern void store_return_init PROTO((tree, tree)); 2925extern void finish_function PROTO((int, int, int)); 2926extern tree start_method PROTO((tree, tree, tree)); 2927extern tree finish_method PROTO((tree)); 2928extern void hack_incomplete_structures PROTO((tree)); 2929extern tree maybe_build_cleanup_and_delete PROTO((tree)); 2930extern tree maybe_build_cleanup PROTO((tree)); 2931extern void cplus_expand_expr_stmt PROTO((tree)); 2932extern void finish_stmt PROTO((void)); 2933extern void push_cp_function_context PROTO((tree)); 2934extern void pop_cp_function_context PROTO((tree)); 2935extern int in_function_p PROTO((void)); 2936extern void replace_defarg PROTO((tree, tree)); 2937extern void print_other_binding_stack PROTO((struct binding_level *)); 2938extern void revert_static_member_fn PROTO((tree*, tree*, tree*)); 2939extern void fixup_anonymous_aggr PROTO((tree)); 2940extern int check_static_variable_definition PROTO((tree, tree)); 2941extern void push_local_binding PROTO((tree, tree, int)); 2942extern int push_class_binding PROTO((tree, tree)); 2943extern tree check_default_argument PROTO((tree, tree)); 2944extern tree push_overloaded_decl PROTO((tree, int)); 2945extern void clear_identifier_class_values PROTO((void)); 2946extern void storetags PROTO((tree)); 2947extern int vtable_decl_p PROTO((tree, void *)); 2948extern int vtype_decl_p PROTO((tree, void *)); 2949extern int sigtable_decl_p PROTO((tree, void *)); 2950typedef int (*walk_globals_pred) PROTO((tree, void *)); 2951typedef int (*walk_globals_fn) PROTO((tree *, void *)); 2952extern int walk_globals PROTO((walk_globals_pred, 2953 walk_globals_fn, 2954 void *)); 2955typedef int (*walk_namespaces_fn) PROTO((tree, void *)); 2956extern int walk_namespaces PROTO((walk_namespaces_fn, 2957 void *)); 2958extern int wrapup_globals_for_namespace PROTO((tree, void *)); 2959 2960/* in decl2.c */ 2961extern int check_java_method PROTO((tree)); 2962extern int lang_decode_option PROTO((int, char **)); 2963extern tree grok_method_quals PROTO((tree, tree, tree)); 2964extern void warn_if_unknown_interface PROTO((tree)); 2965extern void grok_x_components PROTO((tree)); 2966extern void maybe_retrofit_in_chrg PROTO((tree)); 2967extern void maybe_make_one_only PROTO((tree)); 2968extern void grokclassfn PROTO((tree, tree, enum overload_flags, tree)); 2969extern tree grok_alignof PROTO((tree)); 2970extern tree grok_array_decl PROTO((tree, tree)); 2971extern tree delete_sanity PROTO((tree, tree, int, int)); 2972extern tree check_classfn PROTO((tree, tree)); 2973extern void check_member_template PROTO((tree)); 2974extern tree grokfield PROTO((tree, tree, tree, tree, tree)); 2975extern tree grokbitfield PROTO((tree, tree, tree)); 2976extern tree groktypefield PROTO((tree, tree)); 2977extern tree grokoptypename PROTO((tree, tree)); 2978extern int copy_assignment_arg_p PROTO((tree, int)); 2979extern void cplus_decl_attributes PROTO((tree, tree, tree)); 2980extern tree constructor_name_full PROTO((tree)); 2981extern tree constructor_name PROTO((tree)); 2982extern void setup_vtbl_ptr PROTO((void)); 2983extern void mark_inline_for_output PROTO((tree)); 2984extern void clear_temp_name PROTO((void)); 2985extern tree get_temp_name PROTO((tree, int)); 2986extern tree get_temp_regvar PROTO((tree, tree)); 2987extern void finish_anon_union PROTO((tree)); 2988extern tree finish_table PROTO((tree, tree, tree, int)); 2989extern void finish_builtin_type PROTO((tree, const char *, 2990 tree *, int, tree)); 2991extern tree coerce_new_type PROTO((tree)); 2992extern tree coerce_delete_type PROTO((tree)); 2993extern void comdat_linkage PROTO((tree)); 2994extern void import_export_class PROTO((tree)); 2995extern void import_export_vtable PROTO((tree, tree, int)); 2996extern void import_export_decl PROTO((tree)); 2997extern tree build_cleanup PROTO((tree)); 2998extern void finish_file PROTO((void)); 2999extern tree reparse_absdcl_as_expr PROTO((tree, tree)); 3000extern tree reparse_absdcl_as_casts PROTO((tree, tree)); 3001extern tree build_expr_from_tree PROTO((tree)); 3002extern tree reparse_decl_as_expr PROTO((tree, tree)); 3003extern tree finish_decl_parsing PROTO((tree)); 3004extern tree check_cp_case_value PROTO((tree)); 3005extern void set_decl_namespace PROTO((tree, tree, int)); 3006extern tree current_decl_namespace PROTO((void)); 3007extern void push_decl_namespace PROTO((tree)); 3008extern void pop_decl_namespace PROTO((void)); 3009extern void push_scope PROTO((tree)); 3010extern void pop_scope PROTO((tree)); 3011extern void do_namespace_alias PROTO((tree, tree)); 3012extern void do_toplevel_using_decl PROTO((tree)); 3013extern void do_local_using_decl PROTO((tree)); 3014extern tree do_class_using_decl PROTO((tree)); 3015extern void do_using_directive PROTO((tree)); 3016extern void check_default_args PROTO((tree)); 3017extern void mark_used PROTO((tree)); 3018extern tree handle_class_head PROTO((tree, tree, tree)); 3019extern tree lookup_arg_dependent PROTO((tree, tree, tree)); 3020extern void finish_static_data_member_decl PROTO((tree, tree, tree, int, int)); 3021 3022/* in errfn.c */ 3023/* The cp_* functions aren't suitable for ATTRIBUTE_PRINTF. */ 3024extern void cp_error PVPROTO((const char *, ...)); 3025extern void cp_error_at PVPROTO((const char *, ...)); 3026extern void cp_warning PVPROTO((const char *, ...)); 3027extern void cp_warning_at PVPROTO((const char *, ...)); 3028extern void cp_pedwarn PVPROTO((const char *, ...)); 3029extern void cp_pedwarn_at PVPROTO((const char *, ...)); 3030extern void cp_compiler_error PVPROTO((const char *, ...)); 3031extern void cp_sprintf PVPROTO((const char *, ...)); 3032extern void cp_deprecated PROTO((const char*)); 3033 3034/* in error.c */ 3035extern void init_error PROTO((void)); 3036extern char *fndecl_as_string PROTO((tree, int)); 3037extern char *type_as_string PROTO((tree, int)); 3038extern char *type_as_string_real PROTO((tree, int, int)); 3039extern char *args_as_string PROTO((tree, int)); 3040extern char *decl_as_string PROTO((tree, int)); 3041extern char *expr_as_string PROTO((tree, int)); 3042extern char *code_as_string PROTO((enum tree_code, int)); 3043extern char *language_as_string PROTO((enum languages, int)); 3044extern char *parm_as_string PROTO((int, int)); 3045extern char *op_as_string PROTO((enum tree_code, int)); 3046extern char *assop_as_string PROTO((enum tree_code, int)); 3047extern char *cv_as_string PROTO((tree, int)); 3048extern char *lang_decl_name PROTO((tree, int)); 3049extern char *cp_file_of PROTO((tree)); 3050extern int cp_line_of PROTO((tree)); 3051 3052/* in except.c */ 3053extern void init_exception_processing PROTO((void)); 3054extern void expand_start_catch_block PROTO((tree, tree)); 3055extern void expand_end_catch_block PROTO((void)); 3056extern void expand_builtin_throw PROTO((void)); 3057extern void expand_start_eh_spec PROTO((void)); 3058extern void expand_exception_blocks PROTO((void)); 3059extern tree start_anon_func PROTO((void)); 3060extern void end_anon_func PROTO((void)); 3061extern void expand_throw PROTO((tree)); 3062extern tree build_throw PROTO((tree)); 3063extern void mark_all_runtime_matches PROTO((void)); 3064 3065/* in expr.c */ 3066extern void init_cplus_expand PROTO((void)); 3067extern void fixup_result_decl PROTO((tree, struct rtx_def *)); 3068extern int extract_init PROTO((tree, tree)); 3069extern void do_case PROTO((tree, tree)); 3070 3071/* friend.c */ 3072extern int is_friend PROTO((tree, tree)); 3073extern void make_friend_class PROTO((tree, tree)); 3074extern void add_friend PROTO((tree, tree)); 3075extern void add_friends PROTO((tree, tree, tree)); 3076extern tree do_friend PROTO((tree, tree, tree, tree, tree, enum overload_flags, tree, int)); 3077 3078/* in init.c */ 3079extern void init_init_processing PROTO((void)); 3080extern void expand_direct_vtbls_init PROTO((tree, tree, int, int, tree)); 3081extern void emit_base_init PROTO((tree, int)); 3082extern void check_base_init PROTO((tree)); 3083extern void expand_member_init PROTO((tree, tree, tree)); 3084extern void expand_aggr_init PROTO((tree, tree, int)); 3085extern int is_aggr_typedef PROTO((tree, int)); 3086extern int is_aggr_type PROTO((tree, int)); 3087extern tree get_aggr_from_typedef PROTO((tree, int)); 3088extern tree get_type_value PROTO((tree)); 3089extern tree build_member_call PROTO((tree, tree, tree)); 3090extern tree build_offset_ref PROTO((tree, tree)); 3091extern tree resolve_offset_ref PROTO((tree)); 3092extern tree decl_constant_value PROTO((tree)); 3093extern tree build_new PROTO((tree, tree, tree, int)); 3094extern tree build_new_1 PROTO((tree)); 3095extern tree expand_vec_init PROTO((tree, tree, tree, tree, int)); 3096extern tree build_x_delete PROTO((tree, int, tree)); 3097extern tree build_delete PROTO((tree, tree, tree, int, int)); 3098extern tree build_vbase_delete PROTO((tree, tree)); 3099extern tree build_vec_delete PROTO((tree, tree, tree, tree, int)); 3100extern tree build_base_dtor_call PROTO((tree, tree, tree)); 3101extern void init_vlist PROTO((tree)); 3102 3103/* in input.c */ 3104 3105/* in lex.c */ 3106extern char *file_name_nondirectory PROTO((const char *)); 3107extern tree make_pointer_declarator PROTO((tree, tree)); 3108extern tree make_reference_declarator PROTO((tree, tree)); 3109extern tree make_call_declarator PROTO((tree, tree, tree, tree)); 3110extern void set_quals_and_spec PROTO((tree, tree, tree)); 3111extern char *operator_name_string PROTO((tree)); 3112extern void lang_init PROTO((void)); 3113extern void lang_finish PROTO((void)); 3114#if 0 3115extern void reinit_lang_specific PROTO((void)); 3116#endif 3117extern void reinit_parse_for_function PROTO((void)); 3118extern void print_parse_statistics PROTO((void)); 3119extern void extract_interface_info PROTO((void)); 3120extern void do_pending_inlines PROTO((void)); 3121extern void process_next_inline PROTO((tree)); 3122extern struct pending_input *save_pending_input PROTO((void)); 3123extern void restore_pending_input PROTO((struct pending_input *)); 3124extern void yyungetc PROTO((int, int)); 3125extern void reinit_parse_for_method PROTO((int, tree)); 3126extern void reinit_parse_for_block PROTO((int, struct obstack *)); 3127extern tree cons_up_default_function PROTO((tree, tree, int)); 3128extern void check_for_missing_semicolon PROTO((tree)); 3129extern void note_got_semicolon PROTO((tree)); 3130extern void note_list_got_semicolon PROTO((tree)); 3131extern void do_pending_lang_change PROTO((void)); 3132extern int identifier_type PROTO((tree)); 3133extern void see_typename PROTO((void)); 3134extern tree do_identifier PROTO((tree, int, tree)); 3135extern tree do_scoped_id PROTO((tree, int)); 3136extern tree identifier_typedecl_value PROTO((tree)); 3137extern int real_yylex PROTO((void)); 3138extern int is_rid PROTO((tree)); 3139extern tree build_lang_decl PROTO((enum tree_code, tree, tree)); 3140extern void retrofit_lang_decl PROTO((tree)); 3141extern tree build_lang_field_decl PROTO((enum tree_code, tree, tree)); 3142extern void copy_lang_decl PROTO((tree)); 3143extern tree make_lang_type PROTO((enum tree_code)); 3144extern void dump_time_statistics PROTO((void)); 3145extern void compiler_error PVPROTO((const char *, ...)) 3146 ATTRIBUTE_PRINTF_1; 3147extern void yyerror PROTO((const char *)); 3148extern void clear_inline_text_obstack PROTO((void)); 3149extern void maybe_snarf_defarg PROTO((void)); 3150extern tree snarf_defarg PROTO((void)); 3151extern void add_defarg_fn PROTO((tree)); 3152extern void do_pending_defargs PROTO((void)); 3153extern int identifier_type PROTO((tree)); 3154extern void yyhook PROTO((int)); 3155extern int cp_type_qual_from_rid PROTO((tree)); 3156 3157/* in method.c */ 3158extern void init_method PROTO((void)); 3159extern void do_inline_function_hair PROTO((tree, tree)); 3160extern char *build_overload_name PROTO((tree, int, int)); 3161extern tree build_static_name PROTO((tree, tree)); 3162extern tree build_decl_overload PROTO((tree, tree, int)); 3163extern tree build_decl_overload_real PROTO((tree, tree, tree, tree, 3164 tree, int)); 3165extern void set_mangled_name_for_decl PROTO((tree)); 3166extern tree build_typename_overload PROTO((tree)); 3167extern tree build_overload_with_type PROTO((tree, tree)); 3168extern tree build_destructor_name PROTO((tree, int)); 3169extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree)); 3170extern tree hack_identifier PROTO((tree, tree)); 3171extern tree make_thunk PROTO((tree, int)); 3172extern void emit_thunk PROTO((tree)); 3173extern void synthesize_method PROTO((tree)); 3174extern tree get_id_2 PROTO((char *, tree)); 3175extern tree get_vlist_vtable_id PROTO((tree, tree)); 3176 3177 3178/* in pt.c */ 3179extern void check_template_shadow PROTO ((tree)); 3180extern tree innermost_args PROTO ((tree)); 3181extern tree tsubst PROTO ((tree, tree, int, tree)); 3182extern tree tsubst_expr PROTO ((tree, tree, int, tree)); 3183extern tree tsubst_copy PROTO ((tree, tree, int, tree)); 3184extern void maybe_begin_member_template_processing PROTO((tree)); 3185extern void maybe_end_member_template_processing PROTO((void)); 3186extern tree finish_member_template_decl PROTO((tree)); 3187extern void begin_template_parm_list PROTO((void)); 3188extern void begin_specialization PROTO((void)); 3189extern void reset_specialization PROTO((void)); 3190extern void end_specialization PROTO((void)); 3191extern void begin_explicit_instantiation PROTO((void)); 3192extern void end_explicit_instantiation PROTO((void)); 3193extern tree check_explicit_specialization PROTO((tree, tree, int, int)); 3194extern tree process_template_parm PROTO((tree, tree)); 3195extern tree end_template_parm_list PROTO((tree)); 3196extern void end_template_decl PROTO((void)); 3197extern tree current_template_args PROTO((void)); 3198extern tree push_template_decl PROTO((tree)); 3199extern tree push_template_decl_real PROTO((tree, int)); 3200extern void redeclare_class_template PROTO((tree, tree)); 3201extern tree lookup_template_class PROTO((tree, tree, tree, tree, int)); 3202extern tree lookup_template_function PROTO((tree, tree)); 3203extern int uses_template_parms PROTO((tree)); 3204extern tree instantiate_class_template PROTO((tree)); 3205extern tree instantiate_template PROTO((tree, tree)); 3206extern void overload_template_name PROTO((tree)); 3207extern int fn_type_unification PROTO((tree, tree, tree, tree, tree, unification_kind_t)); 3208struct tinst_level *tinst_for_decl PROTO((void)); 3209extern void mark_decl_instantiated PROTO((tree, int)); 3210extern int more_specialized PROTO((tree, tree, tree)); 3211extern void mark_class_instantiated PROTO((tree, int)); 3212extern void do_decl_instantiation PROTO((tree, tree, tree)); 3213extern void do_type_instantiation PROTO((tree, tree)); 3214extern tree instantiate_decl PROTO((tree)); 3215extern tree do_poplevel PROTO((void)); 3216extern tree get_bindings PROTO((tree, tree, tree)); 3217/* CONT ... */ 3218extern void add_tree PROTO((tree)); 3219extern void begin_tree PROTO((void)); 3220extern void end_tree PROTO((void)); 3221extern void add_maybe_template PROTO((tree, tree)); 3222extern void pop_tinst_level PROTO((void)); 3223extern int more_specialized_class PROTO((tree, tree)); 3224extern void do_pushlevel PROTO((void)); 3225extern int is_member_template PROTO((tree)); 3226extern int template_parms_equal PROTO((tree, tree)); 3227extern int comp_template_parms PROTO((tree, tree)); 3228extern int template_class_depth PROTO((tree)); 3229extern int is_specialization_of PROTO((tree, tree)); 3230extern int comp_template_args PROTO((tree, tree)); 3231extern void maybe_process_partial_specialization PROTO((tree)); 3232extern void maybe_check_template_type PROTO((tree)); 3233extern tree most_specialized_instantiation PROTO((tree, tree)); 3234extern void print_candidates PROTO((tree)); 3235extern int instantiate_pending_templates PROTO((void)); 3236 3237extern int processing_specialization; 3238extern int processing_explicit_instantiation; 3239extern int processing_template_parmlist; 3240 3241/* in repo.c */ 3242extern void repo_template_used PROTO((tree)); 3243extern void repo_template_instantiated PROTO((tree, int)); 3244extern void init_repo PROTO((const char *)); 3245extern void finish_repo PROTO((void)); 3246 3247/* in rtti.c */ 3248extern void init_rtti_processing PROTO((void)); 3249extern tree get_tinfo_fn_dynamic PROTO((tree)); 3250extern tree build_typeid PROTO((tree)); 3251extern tree build_x_typeid PROTO((tree)); 3252extern tree get_tinfo_fn PROTO((tree)); 3253extern tree get_tinfo_fn_unused PROTO((tree)); 3254extern tree get_typeid PROTO((tree)); 3255extern tree get_typeid_1 PROTO((tree)); 3256extern tree build_dynamic_cast PROTO((tree, tree)); 3257extern void synthesize_tinfo_fn PROTO((tree)); 3258 3259/* in search.c */ 3260extern int types_overlap_p PROTO((tree, tree)); 3261extern tree get_vbase PROTO((tree, tree)); 3262extern tree get_binfo PROTO((tree, tree, int)); 3263extern int get_base_distance PROTO((tree, tree, int, tree *)); 3264extern int accessible_p PROTO((tree, tree)); 3265extern tree lookup_field PROTO((tree, tree, int, int)); 3266extern int lookup_fnfields_1 PROTO((tree, tree)); 3267extern tree lookup_fnfields PROTO((tree, tree, int)); 3268extern tree lookup_member PROTO((tree, tree, int, int)); 3269extern tree lookup_nested_tag PROTO((tree, tree)); 3270extern tree get_matching_virtual PROTO((tree, tree, int)); 3271extern tree get_abstract_virtuals PROTO((tree)); 3272extern tree init_vbase_pointers PROTO((tree, tree)); 3273extern void expand_indirect_vtbls_init PROTO((tree, tree, tree)); 3274extern void clear_search_slots PROTO((tree)); 3275extern tree get_vbase_types PROTO((tree)); 3276extern void note_debug_info_needed PROTO((tree)); 3277extern void push_class_decls PROTO((tree)); 3278extern void pop_class_decls PROTO((void)); 3279extern void unuse_fields PROTO((tree)); 3280extern void print_search_statistics PROTO((void)); 3281extern void init_search_processing PROTO((void)); 3282extern void reinit_search_statistics PROTO((void)); 3283extern tree current_scope PROTO((void)); 3284extern tree lookup_conversions PROTO((tree)); 3285extern tree binfo_for_vtable PROTO((tree)); 3286extern tree dfs_walk PROTO((tree, 3287 tree (*)(tree, void *), 3288 tree (*) (tree, void *), 3289 void *)); 3290extern tree dfs_unmark PROTO((tree, void *)); 3291extern tree markedp PROTO((tree, void *)); 3292 3293/* in semantics.c */ 3294extern void finish_expr_stmt PROTO((tree)); 3295extern tree begin_if_stmt PROTO((void)); 3296extern void finish_if_stmt_cond PROTO((tree, tree)); 3297extern tree finish_then_clause PROTO((tree)); 3298extern void begin_else_clause PROTO((void)); 3299extern void finish_else_clause PROTO((tree)); 3300extern void finish_if_stmt PROTO((void)); 3301extern tree begin_while_stmt PROTO((void)); 3302extern void finish_while_stmt_cond PROTO((tree, tree)); 3303extern void finish_while_stmt PROTO((tree)); 3304extern tree begin_do_stmt PROTO((void)); 3305extern void finish_do_body PROTO((tree)); 3306extern void finish_do_stmt PROTO((tree, tree)); 3307extern void finish_return_stmt PROTO((tree)); 3308extern tree begin_for_stmt PROTO((void)); 3309extern void finish_for_init_stmt PROTO((tree)); 3310extern void finish_for_cond PROTO((tree, tree)); 3311extern void finish_for_expr PROTO((tree, tree)); 3312extern void finish_for_stmt PROTO((tree, tree)); 3313extern void finish_break_stmt PROTO((void)); 3314extern void finish_continue_stmt PROTO((void)); 3315extern void begin_switch_stmt PROTO((void)); 3316extern tree finish_switch_cond PROTO((tree)); 3317extern void finish_switch_stmt PROTO((tree, tree)); 3318extern void finish_case_label PROTO((tree, tree)); 3319extern void finish_goto_stmt PROTO((tree)); 3320extern tree begin_try_block PROTO((void)); 3321extern void finish_try_block PROTO((tree)); 3322extern void finish_handler_sequence PROTO((tree)); 3323extern tree begin_handler PROTO((void)); 3324extern void finish_handler_parms PROTO((tree)); 3325extern void finish_handler PROTO((tree)); 3326extern tree begin_compound_stmt PROTO((int)); 3327extern tree finish_compound_stmt PROTO((int, tree)); 3328extern void finish_asm_stmt PROTO((tree, tree, tree, tree, tree)); 3329extern tree finish_parenthesized_expr PROTO((tree)); 3330extern tree begin_stmt_expr PROTO((void)); 3331extern tree finish_stmt_expr PROTO((tree, tree)); 3332extern tree finish_call_expr PROTO((tree, tree, int)); 3333extern tree finish_increment_expr PROTO((tree, enum tree_code)); 3334extern tree finish_this_expr PROTO((void)); 3335extern tree finish_object_call_expr PROTO((tree, tree, tree)); 3336extern tree finish_qualified_object_call_expr PROTO((tree, tree, tree)); 3337extern tree finish_pseudo_destructor_call_expr PROTO((tree, tree, tree)); 3338extern tree finish_qualified_call_expr PROTO ((tree, tree)); 3339extern tree finish_label_address_expr PROTO((tree)); 3340extern tree finish_unary_op_expr PROTO((enum tree_code, tree)); 3341extern tree finish_id_expr PROTO((tree)); 3342extern int begin_new_placement PROTO((void)); 3343extern tree finish_new_placement PROTO((tree, int)); 3344extern int begin_function_definition PROTO((tree, tree)); 3345extern tree begin_constructor_declarator PROTO((tree, tree)); 3346extern tree finish_declarator PROTO((tree, tree, tree, tree, int)); 3347extern void finish_translation_unit PROTO((void)); 3348extern tree finish_template_type_parm PROTO((tree, tree)); 3349extern tree finish_template_template_parm PROTO((tree, tree)); 3350extern tree finish_parmlist PROTO((tree, int)); 3351extern tree begin_class_definition PROTO((tree)); 3352extern tree finish_class_definition PROTO((tree, tree, int, int)); 3353extern void finish_default_args PROTO((void)); 3354extern void begin_inline_definitions PROTO((void)); 3355extern void finish_inline_definitions PROTO((void)); 3356extern tree finish_member_class_template PROTO((tree)); 3357extern void finish_template_decl PROTO((tree)); 3358extern tree finish_template_type PROTO((tree, tree, int)); 3359extern void enter_scope_of PROTO((tree)); 3360extern tree finish_base_specifier PROTO((tree, tree, int)); 3361extern void finish_member_declaration PROTO((tree)); 3362extern void check_multiple_declarators PROTO((void)); 3363extern tree finish_typeof PROTO((tree)); 3364 3365/* in sig.c */ 3366extern tree build_signature_pointer_type PROTO((tree)); 3367extern tree build_signature_reference_type PROTO((tree)); 3368extern tree build_signature_pointer_constructor PROTO((tree, tree)); 3369extern tree build_signature_method_call PROTO((tree, tree)); 3370extern tree build_optr_ref PROTO((tree)); 3371extern void append_signature_fields PROTO((tree)); 3372 3373/* in spew.c */ 3374extern void init_spew PROTO((void)); 3375extern int peekyylex PROTO((void)); 3376extern int yylex PROTO((void)); 3377extern tree arbitrate_lookup PROTO((tree, tree, tree)); 3378 3379/* in tree.c */ 3380extern int pod_type_p PROTO((tree)); 3381extern void unshare_base_binfos PROTO((tree)); 3382extern int member_p PROTO((tree)); 3383extern int real_lvalue_p PROTO((tree)); 3384extern tree build_min PVPROTO((enum tree_code, tree, ...)); 3385extern tree build_min_nt PVPROTO((enum tree_code, ...)); 3386extern tree min_tree_cons PROTO((tree, tree, tree)); 3387extern int lvalue_p PROTO((tree)); 3388extern int lvalue_or_else PROTO((tree, const char *)); 3389extern tree build_cplus_new PROTO((tree, tree)); 3390extern tree get_target_expr PROTO((tree)); 3391extern tree break_out_cleanups PROTO((tree)); 3392extern tree break_out_calls PROTO((tree)); 3393extern tree build_cplus_method_type PROTO((tree, tree, tree)); 3394extern tree build_cplus_staticfn_type PROTO((tree, tree, tree)); 3395extern tree build_cplus_array_type PROTO((tree, tree)); 3396extern int layout_basetypes PROTO((tree, int)); 3397extern tree build_vbase_pointer_fields PROTO((tree)); 3398extern tree build_base_fields PROTO((tree)); 3399extern tree hash_tree_cons PROTO((tree, tree, tree)); 3400extern tree hash_tree_chain PROTO((tree, tree)); 3401extern tree hash_chainon PROTO((tree, tree)); 3402extern tree make_binfo PROTO((tree, tree, tree, tree)); 3403extern tree binfo_value PROTO((tree, tree)); 3404extern tree reverse_path PROTO((tree)); 3405extern int count_functions PROTO((tree)); 3406extern int is_overloaded_fn PROTO((tree)); 3407extern tree get_first_fn PROTO((tree)); 3408extern tree binding_init PROTO((struct tree_binding*)); 3409extern int bound_pmf_p PROTO((tree)); 3410extern tree ovl_cons PROTO((tree, tree)); 3411extern tree scratch_ovl_cons PROTO((tree, tree)); 3412extern int ovl_member PROTO((tree, tree)); 3413extern tree build_overload PROTO((tree, tree)); 3414extern tree fnaddr_from_vtable_entry PROTO((tree)); 3415extern tree function_arg_chain PROTO((tree)); 3416extern int promotes_to_aggr_type PROTO((tree, enum tree_code)); 3417extern int is_aggr_type_2 PROTO((tree, tree)); 3418extern char *lang_printable_name PROTO((tree, int)); 3419extern tree build_exception_variant PROTO((tree, tree)); 3420extern tree copy_template_template_parm PROTO((tree)); 3421extern tree copy_to_permanent PROTO((tree)); 3422extern tree permanent_p PROTO((tree)); 3423extern void print_lang_statistics PROTO((void)); 3424extern void __eprintf 3425 PROTO((const char *, const char *, unsigned, const char *)); 3426extern tree array_type_nelts_total PROTO((tree)); 3427extern tree array_type_nelts_top PROTO((tree)); 3428extern tree break_out_target_exprs PROTO((tree)); 3429extern tree get_type_decl PROTO((tree)); 3430extern tree vec_binfo_member PROTO((tree, tree)); 3431extern tree hack_decl_function_context PROTO((tree)); 3432extern tree decl_namespace_context PROTO((tree)); 3433extern tree lvalue_type PROTO((tree)); 3434extern tree error_type PROTO((tree)); 3435extern tree make_temp_vec PROTO((int)); 3436extern tree build_ptr_wrapper PROTO((void *)); 3437extern tree build_expr_ptr_wrapper PROTO((void *)); 3438extern tree build_int_wrapper PROTO((int)); 3439extern tree build_srcloc_here PROTO((void)); 3440extern int varargs_function_p PROTO((tree)); 3441extern int really_overloaded_fn PROTO((tree)); 3442extern int cp_tree_equal PROTO((tree, tree)); 3443extern int can_free PROTO((struct obstack *, tree)); 3444extern tree mapcar PROTO((tree, tree (*) (tree))); 3445extern tree no_linkage_check PROTO((tree)); 3446extern void debug_binfo PROTO((tree)); 3447extern void push_expression_obstack PROTO((void)); 3448extern tree build_dummy_object PROTO((tree)); 3449extern tree maybe_dummy_object PROTO((tree, tree *)); 3450extern int is_dummy_object PROTO((tree)); 3451extern tree search_tree PROTO((tree, tree (*)(tree))); 3452extern int cp_valid_lang_attribute PROTO((tree, tree, tree, tree)); 3453extern tree make_ptrmem_cst PROTO((tree, tree)); 3454 3455#define scratchalloc expralloc 3456#define scratch_tree_cons expr_tree_cons 3457#define build_scratch_list build_expr_list 3458#define make_scratch_vec make_temp_vec 3459#define push_scratch_obstack push_expression_obstack 3460 3461/* in typeck.c */ 3462extern int string_conv_p PROTO((tree, tree, int)); 3463extern tree condition_conversion PROTO((tree)); 3464extern tree target_type PROTO((tree)); 3465extern tree require_complete_type PROTO((tree)); 3466extern tree require_complete_type_in_void PROTO((tree)); 3467extern tree complete_type PROTO((tree)); 3468extern tree complete_type_or_else PROTO((tree, tree)); 3469extern int type_unknown_p PROTO((tree)); 3470extern int fntype_p PROTO((tree)); 3471extern tree commonparms PROTO((tree, tree)); 3472extern tree original_type PROTO((tree)); 3473extern tree common_type PROTO((tree, tree)); 3474extern int compexcepttypes PROTO((tree, tree)); 3475extern int comptypes PROTO((tree, tree, int)); 3476extern int comp_target_types PROTO((tree, tree, int)); 3477extern int compparms PROTO((tree, tree)); 3478extern int comp_target_types PROTO((tree, tree, int)); 3479extern int comp_cv_qualification PROTO((tree, tree)); 3480extern int comp_cv_qual_signature PROTO((tree, tree)); 3481extern int self_promoting_args_p PROTO((tree)); 3482extern tree unsigned_type PROTO((tree)); 3483extern tree signed_type PROTO((tree)); 3484extern tree signed_or_unsigned_type PROTO((int, tree)); 3485extern tree expr_sizeof PROTO((tree)); 3486extern tree c_sizeof PROTO((tree)); 3487extern tree c_sizeof_nowarn PROTO((tree)); 3488extern tree c_alignof PROTO((tree)); 3489extern tree inline_conversion PROTO((tree)); 3490extern tree decay_conversion PROTO((tree)); 3491extern tree default_conversion PROTO((tree)); 3492extern tree build_object_ref PROTO((tree, tree, tree)); 3493extern tree build_component_ref_1 PROTO((tree, tree, int)); 3494extern tree build_component_ref PROTO((tree, tree, tree, int)); 3495extern tree build_x_component_ref PROTO((tree, tree, tree, int)); 3496extern tree build_x_indirect_ref PROTO((tree, const char *)); 3497extern tree build_indirect_ref PROTO((tree, const char *)); 3498extern tree build_array_ref PROTO((tree, tree)); 3499extern tree build_x_function_call PROTO((tree, tree, tree)); 3500extern tree get_member_function_from_ptrfunc PROTO((tree *, tree)); 3501extern tree build_function_call_real PROTO((tree, tree, int, int)); 3502extern tree build_function_call PROTO((tree, tree)); 3503extern tree build_function_call_maybe PROTO((tree, tree)); 3504extern tree convert_arguments PROTO((tree, tree, tree, int)); 3505extern tree build_x_binary_op PROTO((enum tree_code, tree, tree)); 3506extern tree build_binary_op PROTO((enum tree_code, tree, tree)); 3507extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code)); 3508extern tree build_x_unary_op PROTO((enum tree_code, tree)); 3509extern tree build_unary_op PROTO((enum tree_code, tree, int)); 3510extern tree unary_complex_lvalue PROTO((enum tree_code, tree)); 3511extern int mark_addressable PROTO((tree)); 3512extern tree build_x_conditional_expr PROTO((tree, tree, tree)); 3513extern tree build_conditional_expr PROTO((tree, tree, tree)); 3514extern tree build_x_compound_expr PROTO((tree)); 3515extern tree build_compound_expr PROTO((tree)); 3516extern tree build_static_cast PROTO((tree, tree)); 3517extern tree build_reinterpret_cast PROTO((tree, tree)); 3518extern tree build_const_cast PROTO((tree, tree)); 3519extern tree build_c_cast PROTO((tree, tree)); 3520extern tree build_x_modify_expr PROTO((tree, enum tree_code, tree)); 3521extern tree build_modify_expr PROTO((tree, enum tree_code, tree)); 3522extern tree convert_for_initialization PROTO((tree, tree, tree, int, const char *, tree, int)); 3523extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int)); 3524extern void c_expand_return PROTO((tree)); 3525extern tree c_expand_start_case PROTO((tree)); 3526extern int comp_ptr_ttypes PROTO((tree, tree)); 3527extern int ptr_reasonably_similar PROTO((tree, tree)); 3528extern tree build_ptrmemfunc PROTO((tree, tree, int)); 3529extern int cp_type_quals PROTO((tree)); 3530extern int cp_has_mutable_p PROTO((tree)); 3531extern int at_least_as_qualified_p PROTO((tree, tree)); 3532extern int more_qualified_p PROTO((tree, tree)); 3533extern tree build_ptrmemfunc1 PROTO((tree, tree, tree, tree, tree)); 3534extern void expand_ptrmemfunc_cst PROTO((tree, tree *, tree *, tree *, tree *)); 3535extern tree delta2_from_ptrmemfunc PROTO((tree)); 3536extern tree pfn_from_ptrmemfunc PROTO((tree)); 3537 3538/* in typeck2.c */ 3539extern tree error_not_base_type PROTO((tree, tree)); 3540extern tree binfo_or_else PROTO((tree, tree)); 3541extern void readonly_error PROTO((tree, const char *, int)); 3542extern void abstract_virtuals_error PROTO((tree, tree)); 3543extern void signature_error PROTO((tree, tree)); 3544extern void incomplete_type_error PROTO((tree, tree)); 3545extern void my_friendly_abort PROTO((int)) 3546 ATTRIBUTE_NORETURN; 3547extern void my_friendly_assert PROTO((int, int)); 3548extern tree store_init_value PROTO((tree, tree)); 3549extern tree digest_init PROTO((tree, tree, tree *)); 3550extern tree build_scoped_ref PROTO((tree, tree)); 3551extern tree build_x_arrow PROTO((tree)); 3552extern tree build_m_component_ref PROTO((tree, tree)); 3553extern tree build_functional_cast PROTO((tree, tree)); 3554extern char *enum_name_string PROTO((tree, tree)); 3555extern void report_case_error PROTO((int, tree, tree, tree)); 3556extern void check_for_new_type PROTO((const char *, flagged_type_tree)); 3557extern tree initializer_constant_valid_p PROTO((tree, tree)); 3558 3559/* in xref.c */ 3560extern void GNU_xref_begin PROTO((const char *)); 3561extern void GNU_xref_end PROTO((int)); 3562extern void GNU_xref_file PROTO((const char *)); 3563extern void GNU_xref_start_scope PROTO((HOST_WIDE_INT)); 3564extern void GNU_xref_end_scope PROTO((HOST_WIDE_INT, HOST_WIDE_INT, int, int)); 3565extern void GNU_xref_ref PROTO((tree, const char *)); 3566extern void GNU_xref_decl PROTO((tree, tree)); 3567extern void GNU_xref_call PROTO((tree, const char *)); 3568extern void GNU_xref_function PROTO((tree, tree)); 3569extern void GNU_xref_assign PROTO((tree)); 3570extern void GNU_xref_hier PROTO((tree, tree, int, int, int)); 3571extern void GNU_xref_member PROTO((tree, tree)); 3572 3573/* -- end of C++ */ 3574 3575#endif /* not _CP_TREE_H */ 3576