|
|
1.1 root 1: /* Definitions for C++ parsing and type checking. 1.1.1.5 root 2: Copyright (C) 1987, 1993 Free Software Foundation, Inc. 1.1 root 3: Hacked by Michael Tiemann ([email protected]) 4: 5: This file is part of GNU CC. 6: 7: GNU CC is free software; you can redistribute it and/or modify 8: it under the terms of the GNU General Public License as published by 9: the Free Software Foundation; either version 2, or (at your option) 10: any later version. 11: 12: GNU CC is distributed in the hope that it will be useful, 13: but WITHOUT ANY WARRANTY; without even the implied warranty of 14: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15: GNU General Public License for more details. 16: 17: You should have received a copy of the GNU General Public License 18: along with GNU CC; see the file COPYING. If not, write to 19: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 20: 21: /* Borrow everything that is C from c-tree.h, 22: but do so by copy, not by inclusion, since c-tree.h defines 23: lang_identifier. */ 24: 1.1.1.6 ! root 25: #ifndef NEW_CLASS_SCOPING ! 26: #define NEW_CLASS_SCOPING 1 1.1 root 27: #endif 28: 29: /* Language-dependent contents of an identifier. */ 30: 31: struct lang_identifier 32: { 33: struct tree_identifier ignore; 34: tree global_value, local_value; 35: tree class_value; 36: tree class_template_info; 37: struct lang_id2 *x; 38: }; 39: 40: struct lang_id2 41: { 42: tree label_value, implicit_decl; 43: tree type_desc, as_list, error_locus; 44: }; 45: 1.1.1.5 root 46: /* To identify to the debug emitters if it should pay attention to the 47: flag `-Wtemplate-debugging'. */ 48: #define HAVE_TEMPLATES 1 49: 1.1 root 50: /* Macros for access to language-specific slots in an identifier. */ 51: 52: #define IDENTIFIER_GLOBAL_VALUE(NODE) \ 53: (((struct lang_identifier *)(NODE))->global_value) 54: #define IDENTIFIER_CLASS_VALUE(NODE) \ 55: (((struct lang_identifier *)(NODE))->class_value) 56: #define IDENTIFIER_LOCAL_VALUE(NODE) \ 57: (((struct lang_identifier *)(NODE))->local_value) 58: #define IDENTIFIER_TEMPLATE(NODE) \ 59: (((struct lang_identifier *)(NODE))->class_template_info) 60: 61: #define IDENTIFIER_TYPE_VALUE(NODE) (TREE_TYPE (NODE)) 62: #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (TREE_TYPE (NODE) = TYPE) 63: #define IDENTIFIER_HAS_TYPE_VALUE(NODE) (TREE_TYPE (NODE) ? 1 : 0) 1.1.1.6 ! root 64: #define IDENTIFIER_HAS_CLASS_TYPE_VALUE(NODE) \ ! 65: (IDENTIFIER_CLASS_VALUE (NODE) && TREE_TYPE (IDENTIFIER_CLASS_VALUE (NODE))) ! 66: #define IDENTIFIER_CLASS_TYPE_VALUE(NODE) \ ! 67: TREE_TYPE (IDENTIFIER_CLASS_VALUE (NODE)) 1.1 root 68: 1.1.1.6 ! root 69: #define LANG_ID_FIELD(NAME,NODE) \ 1.1 root 70: (((struct lang_identifier *)(NODE))->x \ 1.1.1.6 ! root 71: ? ((struct lang_identifier *)(NODE))->x->NAME : 0) ! 72: #define SET_LANG_ID(NODE,VALUE,NAME) \ ! 73: (((struct lang_identifier *)(NODE))->x == 0 \ ! 74: ? ((struct lang_identifier *)(NODE))->x \ ! 75: = (struct lang_id2 *)perm_calloc (1, sizeof (struct lang_id2)) : 0, \ ! 76: ((struct lang_identifier *)(NODE))->x->NAME = (VALUE)) ! 77: ! 78: #define IDENTIFIER_LABEL_VALUE(NODE) LANG_ID_FIELD(label_value, NODE) ! 79: #define SET_IDENTIFIER_LABEL_VALUE(NODE,VALUE) \ ! 80: SET_LANG_ID(NODE, VALUE, label_value) ! 81: ! 82: #define IDENTIFIER_IMPLICIT_DECL(NODE) LANG_ID_FIELD(implicit_decl, NODE) ! 83: #define SET_IDENTIFIER_IMPLICIT_DECL(NODE,VALUE) \ ! 84: SET_LANG_ID(NODE, VALUE, implicit_decl) ! 85: ! 86: #define IDENTIFIER_AS_DESC(NODE) LANG_ID_FIELD(type_desc, NODE) 1.1 root 87: #define SET_IDENTIFIER_AS_DESC(NODE,DESC) \ 1.1.1.6 ! root 88: SET_LANG_ID(NODE, DESC, type_desc) ! 89: ! 90: #define IDENTIFIER_AS_LIST(NODE) LANG_ID_FIELD(as_list, NODE) 1.1 root 91: #define SET_IDENTIFIER_AS_LIST(NODE,LIST) \ 1.1.1.6 ! root 92: SET_LANG_ID(NODE, LIST, as_list) ! 93: ! 94: #define IDENTIFIER_ERROR_LOCUS(NODE) LANG_ID_FIELD(error_locus, NODE) 1.1 root 95: #define SET_IDENTIFIER_ERROR_LOCUS(NODE,VALUE) \ 1.1.1.6 ! root 96: SET_LANG_ID(NODE, VALUE, error_locus) ! 97: 1.1 root 98: 1.1.1.4 root 99: #define IDENTIFIER_VIRTUAL_P(NODE) TREE_LANG_FLAG_1(NODE) 100: 1.1 root 101: /* Nonzero if this identifier is the prefix for a mangled C++ operator name. */ 102: #define IDENTIFIER_OPNAME_P(NODE) TREE_LANG_FLAG_2(NODE) 103: 104: #define IDENTIFIER_TYPENAME_P(NODE) \ 105: (! strncmp (IDENTIFIER_POINTER (NODE), \ 1.1.1.2 root 106: IDENTIFIER_POINTER (ansi_opname[(int) TYPE_EXPR]), \ 107: IDENTIFIER_LENGTH (ansi_opname[(int) TYPE_EXPR]))) 1.1 root 108: 109: /* Nonzero means reject anything that ANSI standard C forbids. */ 110: extern int pedantic; 111: 112: /* In a RECORD_TYPE or UNION_TYPE, nonzero if any component is read-only. */ 113: #define C_TYPE_FIELDS_READONLY(type) TYPE_LANG_FLAG_0 (type) 1.1.1.5 root 114: 1.1 root 115: /* If non-zero, a VAR_DECL whose cleanup will cause a throw to the 116: next exception handler. */ 117: extern tree exception_throw_decl; 118: 119: extern tree double_type_node, long_double_type_node, float_type_node; 120: extern tree char_type_node, unsigned_char_type_node, signed_char_type_node; 121: extern tree ptrdiff_type_node; 122: 123: extern tree short_integer_type_node, short_unsigned_type_node; 124: extern tree long_integer_type_node, long_unsigned_type_node; 125: extern tree long_long_integer_type_node, long_long_unsigned_type_node; 126: extern tree unsigned_type_node; 127: extern tree string_type_node, char_array_type_node, int_array_type_node; 128: extern tree wchar_array_type_node; 129: extern tree wchar_type_node, signed_wchar_type_node, unsigned_wchar_type_node; 1.1.1.4 root 130: extern tree intQI_type_node, unsigned_intQI_type_node; 131: extern tree intHI_type_node, unsigned_intHI_type_node; 132: extern tree intSI_type_node, unsigned_intSI_type_node; 133: extern tree intDI_type_node, unsigned_intDI_type_node; 1.1 root 134: 135: extern int current_function_returns_value; 136: extern int current_function_returns_null; 137: extern tree current_function_return_value; 138: 139: extern tree ridpointers[]; 140: extern tree ansi_opname[]; 141: extern tree ansi_assopname[]; 142: 143: /* Nonzero means `$' can be in an identifier. */ 144: 145: extern int dollars_in_ident; 146: 147: /* Nonzero means allow type mismatches in conditional expressions; 148: just make their values `void'. */ 149: 150: extern int flag_cond_mismatch; 151: 152: /* Nonzero means don't recognize the keyword `asm'. */ 153: 154: extern int flag_no_asm; 155: 156: /* For cross referencing. */ 157: 158: extern int flag_gnu_xref; 159: 160: /* For environments where you can use GNU binutils (as, ld in particular). */ 161: 162: extern int flag_gnu_binutils; 163: 1.1.1.4 root 164: /* Nonzero means ignore `#ident' directives. */ 165: 166: extern int flag_no_ident; 167: 1.1 root 168: /* Nonzero means warn about implicit declarations. */ 169: 170: extern int warn_implicit; 171: 1.1.1.6 ! root 172: /* Nonzero means warn when all ctors or dtors are private, and the class ! 173: has no friends. */ ! 174: ! 175: extern int warn_ctor_dtor_privacy; ! 176: 1.1 root 177: /* Nonzero means warn about function definitions that default the return type 178: or that use a null return and have a return-type other than void. */ 179: 180: extern int warn_return_type, explicit_warn_return_type; 181: 182: /* Nonzero means give string constants the type `const char *' 183: to get extra warnings from them. These warnings will be too numerous 184: to be useful, except in thoroughly ANSIfied programs. */ 185: 186: extern int warn_write_strings; 187: 188: /* Nonzero means warn about sizeof(function) or addition/subtraction 189: of function pointers. */ 190: 191: extern int warn_pointer_arith; 192: 193: /* Nonzero means warn for all old-style non-prototype function decls. */ 194: 195: extern int warn_strict_prototypes; 196: 197: /* Nonzero means warn about suggesting putting in ()'s. */ 198: 199: extern int warn_parentheses; 200: 1.1.1.6 ! root 201: /* Nonzero means warn about multiple (redundant) decls for the same single ! 202: variable or function. */ ! 203: ! 204: extern int warn_redundant_decls; ! 205: ! 206: /* Warn if initializer is not completely bracketed. */ ! 207: ! 208: extern int warn_missing_braces; ! 209: 1.1.1.4 root 210: /* Warn about a subscript that has type char. */ 211: 212: extern int warn_char_subscripts; 213: 1.1 root 214: /* Nonzero means warn about pointer casts that can drop a type qualifier 215: from the pointer target type. */ 216: 217: extern int warn_cast_qual; 218: 1.1.1.4 root 219: /* Warn about traditional constructs whose meanings changed in ANSI C. */ 220: 221: extern int warn_traditional; 222: 223: /* Nonzero means warn about non virtual destructors in classes that have 224: virtual functions. */ 225: 226: extern int warn_nonvdtor; 227: 1.1 root 228: /* Nonzero means do some things the same way PCC does. */ 229: 230: extern int flag_traditional; 231: 232: /* Nonzero means to treat bitfields as unsigned unless they say `signed'. */ 233: 234: extern int flag_signed_bitfields; 235: 1.1.1.4 root 236: /* 3 means write out only virtuals function tables `defined' 237: in this implementation file. 238: 2 means write out only specific virtual function tables 1.1 root 239: and give them (C) public visibility. 240: 1 means write out virtual function tables and give them 241: (C) public visibility. 242: 0 means write out virtual function tables and give them 1.1.1.4 root 243: (C) static visibility (default). 1.1 root 244: -1 means declare virtual function tables extern. */ 245: 246: extern int write_virtuals; 247: 248: /* INTERFACE_ONLY nonzero means that we are in an "interface" 249: section of the compiler. INTERFACE_UNKNOWN nonzero means 250: we cannot trust the value of INTERFACE_ONLY. If INTERFACE_UNKNOWN 251: is zero and INTERFACE_ONLY is zero, it means that we are responsible 252: for exporting definitions that others might need. */ 253: extern int interface_only, interface_unknown; 254: 255: /* Nonzero means we should attempt to elide constructors when possible. */ 256: 257: extern int flag_elide_constructors; 258: 259: /* Nonzero means recognize and handle exception handling constructs. */ 260: 261: extern int flag_handle_exceptions; 262: 263: /* Nonzero means recognize and handle ansi-style exception handling constructs. */ 264: 265: extern int flag_ansi_exceptions; 266: 1.1.1.6 ! root 267: /* Nonzero means do argument matching for overloading according to the ! 268: ANSI rules, rather than what g++ used to believe to be correct. */ ! 269: ! 270: extern int flag_ansi_overloading; ! 271: 1.1 root 272: /* Nonzero means that member functions defined in class scope are 273: inline by default. */ 274: 275: extern int flag_default_inline; 276: 277: /* Nonzero means emit cadillac protocol. */ 278: 279: extern int flag_cadillac; 280: 281: /* C++ language-specific tree codes. */ 282: #define DEFTREECODE(SYM, NAME, TYPE, LENGTH) SYM, 283: enum cplus_tree_code { 284: __DUMMY = LAST_AND_UNUSED_TREE_CODE, 285: #include "cp-tree.def" 286: LAST_CPLUS_TREE_CODE 287: }; 288: #undef DEFTREECODE 289: 1.1.1.6 ! root 290: /* Override OFFSET_REFs from the back-end, as we want our very own. */ ! 291: /* Allow complex pointer to members to work correctly. */ ! 292: #define OFFSET_REF CP_OFFSET_REF ! 293: 1.1 root 294: enum languages { lang_c, lang_cplusplus }; 295: 296: /* Macros to make error reporting functions' lives easier. */ 297: #define TYPE_IDENTIFIER(NODE) (DECL_NAME (TYPE_NAME (NODE))) 1.1.1.3 root 298: #define TYPE_NAME_STRING(NODE) (IDENTIFIER_POINTER (TYPE_IDENTIFIER (NODE))) 299: #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE))) 1.1 root 300: 1.1.1.4 root 301: #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) 302: #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) 303: 1.1.1.6 ! root 304: #define IS_AGGR_TYPE(t) (TYPE_LANG_FLAG_5 (t)) ! 305: #define IS_AGGR_TYPE_CODE(t) (t == RECORD_TYPE || t == UNION_TYPE) 1.1 root 306: #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \ 307: (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \ 308: && IS_AGGR_TYPE (TYPE1)&IS_AGGR_TYPE (TYPE2)) 309: 1.1.1.6 ! root 310: /* In a *_TYPE, nonzero means a built-in type. */ ! 311: #define TYPE_BUILT_IN(NODE) TYPE_LANG_FLAG_6(NODE) ! 312: 1.1 root 313: /* Macros which might want to be replaced by function calls. */ 314: 315: #if 1 316: /* Virtual function addresses can be gotten from a virtual function 317: table entry using this macro. */ 318: #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) \ 319: TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) 320: #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \ 321: (TREE_VALUE (TREE_CHAIN (TREE_CHAIN (CONSTRUCTOR_ELTS (ENTRY)))) = (VALUE)) 322: 323: #define FUNCTION_ARG_CHAIN(NODE) (TREE_CHAIN (TYPE_ARG_TYPES (TREE_TYPE (NODE)))) 324: #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) \ 325: (((CODE) == TREE_CODE (NODE) \ 326: && IS_AGGR_TYPE (TREE_TYPE (NODE))) \ 327: || IS_AGGR_TYPE (NODE)) 328: 329: #else 330: #define FNADDR_FROM_VTABLE_ENTRY(ENTRY) (fnaddr_from_vtable_entry (ENTRY)) 331: #define SET_FNADDR_FROM_VTABLE_ENTRY(ENTRY,VALUE) \ 332: (set_fnaddr_from_vtable_entry (ENTRY, VALUE)) 333: /* #define TYPE_NAME_STRING(NODE) (type_name_string (NODE)) */ 334: #define FUNCTION_ARG_CHAIN(NODE) (function_arg_chain (NODE)) 335: #define PROMOTES_TO_AGGR_TYPE(NODE,CODE) (promotes_to_aggr_type (NODE, CODE)) 336: /* #define IS_AGGR_TYPE_2(TYPE1, TYPE2) (is_aggr_type_2 (TYPE1, TYPE2)) */ 337: #endif 1.1.1.4 root 338: /* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can be an 339: ambiguous base class of TYPE, and this macro will be false. */ 1.1.1.5 root 340: #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, (tree *)0) >= 0) 1.1 root 341: 1.1.1.6 ! root 342: enum conversion_type { ptr_conv, constptr_conv, int_conv, ! 343: real_conv, last_conversion_type }; 1.1 root 344: 345: /* Statistics show that while the GNU C++ compiler may generate 346: thousands of different types during a compilation run, it 347: generates relatively few (tens) of classtypes. Because of this, 348: it is not costly to store a generous amount of information 349: in classtype nodes. This struct must fill out to a multiple of 4 bytes. */ 350: struct lang_type 351: { 352: struct 353: { 354: unsigned has_type_conversion : 1; 355: unsigned has_int_conversion : 1; 356: unsigned has_float_conversion : 1; 357: unsigned has_init_ref : 1; 358: unsigned gets_init_ref : 1; 359: unsigned gets_init_aggr : 1; 360: unsigned has_assignment : 1; 361: unsigned gets_assignment : 1; 362: 363: unsigned needs_constructor : 1; 364: unsigned has_default_ctor : 1; 365: unsigned uses_multiple_inheritance : 1; 366: unsigned const_needs_init : 1; 367: unsigned ref_needs_init : 1; 368: unsigned gets_const_init_ref : 1; 369: unsigned has_const_assign_ref : 1; 370: unsigned gets_const_assign_ref : 1; 371: 372: unsigned vtable_needs_writing : 1; 373: unsigned has_assign_ref : 1; 374: unsigned gets_assign_ref : 1; 375: unsigned gets_new : 1; 376: unsigned gets_delete : 1; 377: unsigned has_call_overloaded : 1; 378: unsigned has_array_ref_overloaded : 1; 379: unsigned has_arrow_overloaded : 1; 380: 381: unsigned local_typedecls : 1; 382: unsigned interface_only : 1; 383: unsigned interface_unknown : 1; 384: unsigned needs_virtual_reinit : 1; 385: unsigned declared_exception : 1; 386: unsigned declared_class : 1; 387: unsigned being_defined : 1; 388: unsigned redefined : 1; 389: 390: unsigned marked : 1; 391: unsigned marked2 : 1; 392: unsigned marked3 : 1; 393: unsigned marked4 : 1; 394: unsigned marked5 : 1; 395: unsigned marked6 : 1; 396: unsigned use_template : 2; 397: 398: unsigned debug_requested : 1; 399: unsigned has_method_call_overloaded : 1; 400: unsigned private_attr : 1; 401: unsigned alters_visibilities : 1; 402: unsigned got_semicolon : 1; 1.1.1.6 ! root 403: unsigned ptrmemfunc_flag : 1; 1.1 root 404: 405: /* The MIPS compiler gets it wrong if this struct also 406: does not fill out to a multiple of 4 bytes. */ 1.1.1.6 ! root 407: unsigned dummy : 2; ! 408: 1.1 root 409: unsigned n_vancestors : 16; 410: } type_flags; 411: 412: int cid; 413: int n_ancestors; 414: int vsize; 415: int max_depth; 416: 417: union tree_node *vbinfo[2]; 418: union tree_node *baselink_vec; 419: union tree_node *vfields; 420: union tree_node *vbases; 421: union tree_node *vbase_size; 422: 423: union tree_node *tags; 424: char *memoized_table_entry; 425: 426: char *search_slot; 427: 428: #ifdef ONLY_INT_FIELDS 429: unsigned int mode : 8; 430: #else 431: enum machine_mode mode : 8; 432: #endif 433: 434: unsigned char size_unit; 435: unsigned char align; 436: unsigned char sep_unit; 437: 438: union tree_node *sep; 439: union tree_node *size; 440: 441: union tree_node *base_init_list; 442: union tree_node *abstract_virtuals; 443: union tree_node *as_list; 444: union tree_node *id_as_list; 445: union tree_node *binfo_as_list; 446: union tree_node *vtbl_ptr; 447: union tree_node *instance_variable; 448: union tree_node *friend_classes; 449: 450: char *mi_matrix; 451: union tree_node *conversions[last_conversion_type]; 452: 453: union tree_node *dossier; 454: }; 455: 456: /* Indicates whether a template should be (or has been) expanded for this 457: class definition. 0=do, 1=did, 2=don't, 3=didn't. */ 458: #define CLASSTYPE_USE_TEMPLATE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.use_template) 459: 460: /* Fields used for storing information before the class is defined. 461: After the class is defined, these fields hold other information. */ 462: 463: /* List of friends which were defined inline in this class definition. */ 464: #define CLASSTYPE_INLINE_FRIENDS(NODE) (TYPE_NONCOPIED_PARTS (NODE)) 465: 466: /* Nonzero for _CLASSTYPE means that the _CLASSTYPE either has 467: a special meaning for the assignment operator ("operator="), 468: or one of its fields (or base members) has a special meaning 469: defined. */ 470: #define TYPE_HAS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assignment) 471: #define TYPE_GETS_ASSIGNMENT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_assignment) 472: 473: /* Nonzero for _CLASSTYPE means that operator new and delete are defined, 474: respectively. */ 475: #define TREE_GETS_NEW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_new) 476: #define TREE_GETS_DELETE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_delete) 477: 478: /* Nonzero for TREE_LIST or _TYPE node means that this node is class-local. */ 479: #define TREE_NONLOCAL_FLAG(NODE) (TREE_LANG_FLAG_0 (NODE)) 480: 481: /* Nonzero for a _CLASSTYPE node which we know to be private. */ 482: #define TYPE_PRIVATE_P(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.private_attr) 483: 484: /* Nonzero means that this _CLASSTYPE node defines ways of converting 485: itself to other types. */ 486: #define TYPE_HAS_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_type_conversion) 487: 488: /* Nonzero means that this _CLASSTYPE node can convert itself to an 489: INTEGER_TYPE. */ 490: #define TYPE_HAS_INT_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_int_conversion) 491: 492: /* Nonzero means that this _CLASSTYPE node can convert itself to an 493: REAL_TYPE. */ 494: #define TYPE_HAS_REAL_CONVERSION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_float_conversion) 495: 496: /* Nonzero means that this _CLASSTYPE node overloads operator=(X&). */ 497: #define TYPE_HAS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_assign_ref) 498: #define TYPE_GETS_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_assign_ref) 499: #define TYPE_HAS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_const_assign_ref) 500: #define TYPE_GETS_CONST_ASSIGN_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_const_assign_ref) 501: 502: /* Nonzero means that this _CLASSTYPE node has an X(X&) constructor. */ 503: #define TYPE_HAS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_init_ref) 504: #define TYPE_GETS_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_init_ref) 505: #define TYPE_GETS_CONST_INIT_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_const_init_ref) 506: 507: /* Nonzero means that this _CLASSTYPE node has an X(X ...) constructor. 1.1.1.3 root 508: Note that there must be other arguments, or this constructor is flagged 1.1 root 509: as being erroneous. */ 510: #define TYPE_GETS_INIT_AGGR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.gets_init_aggr) 511: 512: /* Nonzero means that this type is being defined. I.e., the left brace 513: starting the definition of this type has been seen. */ 514: #define TYPE_BEING_DEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.being_defined) 515: /* Nonzero means that this type has been redefined. In this case, if 516: convenient, don't reprocess any methods that appear in its redefinition. */ 517: #define TYPE_REDEFINED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.redefined) 518: 519: /* Nonzero means that this _CLASSTYPE node overloads the method call 520: operator. In this case, all method calls go through `operator->()(...). */ 521: #define TYPE_OVERLOADS_METHOD_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_method_call_overloaded) 522: 523: /* The is the VAR_DECL that contains NODE's dossier. */ 524: #define CLASSTYPE_DOSSIER(NODE) (TYPE_LANG_SPECIFIC(NODE)->dossier) 525: 526: /* Nonzero means that this _CLASSTYPE node overloads operator(). */ 527: #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded) 528: 529: /* Nonzero means that this _CLASSTYPE node overloads operator[]. */ 530: #define TYPE_OVERLOADS_ARRAY_REF(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_array_ref_overloaded) 531: 532: /* Nonzero means that this _CLASSTYPE node overloads operator->. */ 533: #define TYPE_OVERLOADS_ARROW(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_arrow_overloaded) 534: 535: /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses 536: multiple inheritance. If this is 0 for the root of a type 537: hierarchy, then we can use more efficient search techniques. */ 538: #define TYPE_USES_MULTIPLE_INHERITANCE(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.uses_multiple_inheritance) 539: 540: /* Nonzero means that this _CLASSTYPE (or one of its ancestors) uses 541: virtual base classes. If this is 0 for the root of a type 542: hierarchy, then we can use more efficient search techniques. */ 543: #define TYPE_USES_VIRTUAL_BASECLASSES(NODE) (TREE_LANG_FLAG_3(NODE)) 544: 545: /* List of lists of member functions defined in this class. */ 546: #define CLASSTYPE_METHOD_VEC(NODE) TYPE_METHODS(NODE) 547: 548: /* Pointer from any member function to the head of the list of 549: member functions of the type that member function belongs to. */ 550: #define CLASSTYPE_BASELINK_VEC(NODE) (TYPE_LANG_SPECIFIC(NODE)->baselink_vec) 551: 552: /* Mark bits for depth-first and breath-first searches. */ 1.1.1.6 ! root 553: #define CLASSTYPE_MARKED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked) 1.1 root 554: #define CLASSTYPE_MARKED2(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2) 555: #define CLASSTYPE_MARKED3(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3) 556: #define CLASSTYPE_MARKED4(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4) 557: #define CLASSTYPE_MARKED5(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5) 558: #define CLASSTYPE_MARKED6(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6) 559: /* Macros to modify the above flags */ 1.1.1.6 ! root 560: #define SET_CLASSTYPE_MARKED(NODE) (CLASSTYPE_MARKED(NODE) = 1) ! 561: #define CLEAR_CLASSTYPE_MARKED(NODE) (CLASSTYPE_MARKED(NODE) = 0) ! 562: #define SET_CLASSTYPE_MARKED2(NODE) (CLASSTYPE_MARKED2(NODE) = 1) ! 563: #define CLEAR_CLASSTYPE_MARKED2(NODE) (CLASSTYPE_MARKED2(NODE) = 0) ! 564: #define SET_CLASSTYPE_MARKED3(NODE) (CLASSTYPE_MARKED3(NODE) = 1) ! 565: #define CLEAR_CLASSTYPE_MARKED3(NODE) (CLASSTYPE_MARKED3(NODE) = 0) ! 566: #define SET_CLASSTYPE_MARKED4(NODE) (CLASSTYPE_MARKED4(NODE) = 1) ! 567: #define CLEAR_CLASSTYPE_MARKED4(NODE) (CLASSTYPE_MARKED4(NODE) = 0) ! 568: #define SET_CLASSTYPE_MARKED5(NODE) (CLASSTYPE_MARKED5(NODE) = 1) ! 569: #define CLEAR_CLASSTYPE_MARKED5(NODE) (CLASSTYPE_MARKED5(NODE) = 0) ! 570: #define SET_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 1) ! 571: #define CLEAR_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 0) 1.1 root 572: 1.1.1.6 ! root 573: #define CLASSTYPE_TAGS(NODE) (TYPE_LANG_SPECIFIC(NODE)->tags) 1.1 root 574: 575: /* Remove when done merging. */ 576: #define CLASSTYPE_VFIELD(NODE) TYPE_VFIELD(NODE) 577: 578: /* The number of virtual functions defined for this 579: _CLASSTYPE node. */ 580: #define CLASSTYPE_VSIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vsize) 581: /* The virtual base classes that this type uses. */ 582: #define CLASSTYPE_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbases) 583: /* The virtual function pointer fields that this type contains. */ 584: #define CLASSTYPE_VFIELDS(NODE) (TYPE_LANG_SPECIFIC(NODE)->vfields) 585: 586: /* Number of baseclasses defined for this type. 587: 0 means no base classes. */ 588: #define CLASSTYPE_N_BASECLASSES(NODE) \ 589: (TYPE_BINFO_BASETYPES (NODE) ? TREE_VEC_LENGTH (TYPE_BINFO_BASETYPES(NODE)) : 0) 590: 591: /* Memoize the number of super classes (base classes) tha this node 592: has. That way we can know immediately (albeit conservatively how 593: large a multiple-inheritance matrix we need to build to find 594: derivation information. */ 595: #define CLASSTYPE_N_SUPERCLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->n_ancestors) 596: #define CLASSTYPE_N_VBASECLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.n_vancestors) 597: 598: /* Record how deep the inheritance is for this class so `void*' conversions 599: are less favorable than a conversion to the most base type. */ 600: #define CLASSTYPE_MAX_DEPTH(NODE) (TYPE_LANG_SPECIFIC(NODE)->max_depth) 601: 602: /* Used for keeping search-specific information. Any search routine 603: which uses this must define what exactly this slot is used for. */ 604: #define CLASSTYPE_SEARCH_SLOT(NODE) (TYPE_LANG_SPECIFIC(NODE)->search_slot) 605: 606: /* Entry for keeping memoization tables for this type to 607: hopefully speed up search routines. Since it is a pointer, 608: it can mean almost anything. */ 609: #define CLASSTYPE_MTABLE_ENTRY(NODE) (TYPE_LANG_SPECIFIC(NODE)->memoized_table_entry) 610: 611: /* This is the total size of the baseclasses defined for this type. 612: Needed because it is desirable to layout such information 1.1.1.2 root 613: before beginning to process the class itself, and we 1.1 root 614: don't want to compute it second time when actually laying 615: out the type for real. */ 616: #define CLASSTYPE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->size) 617: #define CLASSTYPE_SIZE_UNIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->size_unit) 618: #define CLASSTYPE_MODE(NODE) (TYPE_LANG_SPECIFIC(NODE)->mode) 619: #define CLASSTYPE_ALIGN(NODE) (TYPE_LANG_SPECIFIC(NODE)->align) 620: 621: /* This is the space needed for virtual base classes. NULL if 622: there are no virtual basetypes. */ 623: #define CLASSTYPE_VBASE_SIZE(NODE) (TYPE_LANG_SPECIFIC(NODE)->vbase_size) 624: 625: /* A cons list of structure elements which either have constructors 626: to be called, or virtual function table pointers which 627: need initializing. Depending on what is being initialized, 628: the TREE_PURPOSE and TREE_VALUE fields have different meanings: 629: 630: Member initialization: <FIELD_DECL, TYPE> 631: Base class construction: <NULL_TREE, BASETYPE> 1.1.1.2 root 632: Base class initialization: <BASE_INITIALIZATION, THESE_INITIALIZATIONS> 1.1 root 633: Whole type: <MEMBER_INIT, BASE_INIT>. */ 634: #define CLASSTYPE_BASE_INIT_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->base_init_list) 635: 636: /* A cons list of virtual functions which cannot be inherited by 637: derived classes. When deriving from this type, the derived 638: class must provide its own definition for each of these functions. */ 639: #define CLASSTYPE_ABSTRACT_VIRTUALS(NODE) (TYPE_LANG_SPECIFIC(NODE)->abstract_virtuals) 640: 641: #define CLASSTYPE_ALTERS_VISIBILITIES_P(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.alters_visibilities) 642: 643: /* Nonzero means that this aggr type has been `closed' by a semicolon. */ 644: #define CLASSTYPE_GOT_SEMICOLON(NODE) (TYPE_LANG_SPECIFIC (NODE)->type_flags.got_semicolon) 645: 646: /* Nonzero means that the main virtual function table pointer needs to be 647: set because base constructors have placed the wrong value there. 648: If this is zero, it means that they placed the right value there, 649: and there is no need to change it. */ 650: #define CLASSTYPE_NEEDS_VIRTUAL_REINIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_virtual_reinit) 651: 652: /* Nonzero means that if this type has virtual functions, that 653: the virtual function table will be written out. */ 654: #define CLASSTYPE_VTABLE_NEEDS_WRITING(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.vtable_needs_writing) 655: 656: /* Nonzero means that this type defines its own local type declarations. */ 657: #define CLASSTYPE_LOCAL_TYPEDECLS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.local_typedecls) 658: 659: /* Nonzero means that this type has an X() constructor. */ 660: #define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_default_ctor) 661: 662: /* Many routines need to cons up a list of basetypes for visibility 663: checking. This field contains a TREE_LIST node whose TREE_VALUE 664: is the main variant of the type, and whose TREE_VIA_PUBLIC 665: and TREE_VIA_VIRTUAL bits are correctly set. */ 666: #define CLASSTYPE_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->as_list) 667: /* Same, but cache a list whose value is the name of this type. */ 668: #define CLASSTYPE_ID_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->id_as_list) 669: /* Same, but cache a list whose value is the binfo of this type. */ 670: #define CLASSTYPE_BINFO_AS_LIST(NODE) (TYPE_LANG_SPECIFIC(NODE)->binfo_as_list) 671: 672: /* Slot in which to cache a copy of the local vtable pointer. */ 673: #define CLASSTYPE_VTBL_PTR(NODE) (TYPE_LANG_SPECIFIC(NODE)->vtbl_ptr) 674: 675: /* Hold the instance object associated with this method. */ 676: #define CLASSTYPE_INST_VAR(NODE) (TYPE_LANG_SPECIFIC(NODE)->instance_variable) 677: 678: /* A list of class types with which this type is a friend. */ 679: #define CLASSTYPE_FRIEND_CLASSES(NODE) (TYPE_LANG_SPECIFIC(NODE)->friend_classes) 680: 681: /* Keep an inheritance lattice around so we can quickly tell whether 682: a type is derived from another or not. */ 683: #define CLASSTYPE_MI_MATRIX(NODE) (TYPE_LANG_SPECIFIC(NODE)->mi_matrix) 684: 685: /* If there is exactly one conversion to a non-void, non-const pointer type, 686: remember that here. If there are more than one, put 687: `error_mark_node' here. If there are none, this holds NULL_TREE. */ 688: #define CLASSTYPE_CONVERSION(NODE,KIND) \ 689: (TYPE_LANG_SPECIFIC(NODE)->conversions[(int) KIND]) 690: 691: /* Say whether this node was declared as a "class" or a "struct". */ 692: #define CLASSTYPE_DECLARED_CLASS(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_class) 693: /* Say whether this node was declared as a "class" or a "struct". */ 694: #define CLASSTYPE_DECLARED_EXCEPTION(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.declared_exception) 695: 696: /* Nonzero if this class has const members which have no specified initialization. */ 697: #define CLASSTYPE_READONLY_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.const_needs_init) 698: 699: /* Nonzero if this class has ref members which have no specified initialization. */ 700: #define CLASSTYPE_REF_FIELDS_NEED_INIT(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ref_needs_init) 701: 702: /* Nonzero if this class is included from a header file which employs 703: `#pragma interface', and it is not included in its implementation file. */ 704: #define CLASSTYPE_INTERFACE_ONLY(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_only) 705: 706: /* Same as above, but for classes whose purpose we do not know. */ 707: #define CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown) 1.1.1.6 ! root 708: #define CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown == 0) ! 709: #define SET_CLASSTYPE_INTERFACE_UNKNOWN_X(NODE,X) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = !!(X)) ! 710: #define SET_CLASSTYPE_INTERFACE_UNKNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 1) ! 711: #define SET_CLASSTYPE_INTERFACE_KNOWN(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.interface_unknown = 0) 1.1 root 712: 713: /* Nonzero if a _DECL node requires us to output debug info for this class. */ 714: #define CLASSTYPE_DEBUG_REQUESTED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.debug_requested) 715: 716: /* Additional macros for inheritance information. */ 717: 718: #define CLASSTYPE_VBINFO(NODE,VIA_PUBLIC) \ 719: (TYPE_LANG_SPECIFIC (NODE)->vbinfo[VIA_PUBLIC]) 720: 721: /* When following an binfo-specific chain, this is the cumulative 722: via-public flag. */ 723: #define BINFO_VIA_PUBLIC(NODE) TREE_LANG_FLAG_5 (NODE) 724: 725: /* When building a matrix to determine by a single lookup 726: whether one class is derived from another or not, 727: this field is the index of the class in the table. */ 728: #define CLASSTYPE_CID(NODE) (TYPE_LANG_SPECIFIC(NODE)->cid) 729: #define BINFO_CID(NODE) CLASSTYPE_CID(BINFO_TYPE(NODE)) 730: 731: /* Nonzero means marked by DFS or BFS search, including searches 732: by `get_binfo' and `get_base_distance'. */ 733: #define BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED(BINFO_TYPE(NODE)):TREE_LANG_FLAG_0(NODE)) 734: /* Macros needed because of C compilers that don't allow conditional 735: expressions to be lvalues. Grr! */ 736: #define SET_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=1)) 737: #define CLEAR_BINFO_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_0(NODE)=0)) 738: 739: /* Nonzero means marked in building initialization list. */ 740: #define BINFO_BASEINIT_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 741: /* Modifier macros */ 742: #define SET_BINFO_BASEINIT_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 743: #define CLEAR_BINFO_BASEINIT_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 744: 745: /* Nonzero means marked in search through virtual inheritance hierarchy. */ 746: #define BINFO_VBASE_MARKED(NODE) CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 747: /* Modifier macros */ 748: #define SET_BINFO_VBASE_MARKED(NODE) SET_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 749: #define CLEAR_BINFO_VBASE_MARKED(NODE) CLEAR_CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)) 750: 751: /* Nonzero means marked in search for members or member functions. */ 752: #define BINFO_FIELDS_MARKED(NODE) \ 753: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED2 (BINFO_TYPE (NODE)):TREE_LANG_FLAG_2(NODE)) 754: #define SET_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=1)) 755: #define CLEAR_BINFO_FIELDS_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED2(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_2(NODE)=0)) 756: 757: /* Nonzero means that this class is on a path leading to a new vtable. */ 758: #define BINFO_VTABLE_PATH_MARKED(NODE) \ 759: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):TREE_LANG_FLAG_3(NODE)) 760: #define SET_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=1)) 761: #define CLEAR_BINFO_VTABLE_PATH_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED3(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_3(NODE)=0)) 762: 763: /* Nonzero means that this class has a new vtable. */ 764: #define BINFO_NEW_VTABLE_MARKED(NODE) \ 765: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):TREE_LANG_FLAG_4(NODE)) 766: #define SET_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=1)) 767: #define CLEAR_BINFO_NEW_VTABLE_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED4(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_4(NODE)=0)) 768: 769: /* Nonzero means this class has initialized its virtual baseclasses. */ 770: #define BINFO_VBASE_INIT_MARKED(NODE) \ 771: (TREE_VIA_VIRTUAL(NODE)?CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):TREE_LANG_FLAG_5(NODE)) 772: #define SET_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?SET_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=1)) 773: #define CLEAR_BINFO_VBASE_INIT_MARKED(NODE) (TREE_VIA_VIRTUAL(NODE)?CLEAR_CLASSTYPE_MARKED5(BINFO_TYPE(NODE)):(TREE_LANG_FLAG_5(NODE)=0)) 774: 775: /* Accessor macros for the vfield slots in structures. */ 776: 777: /* Get the assoc info that caused this vfield to exist. */ 778: #define VF_BINFO_VALUE(NODE) TREE_PURPOSE (NODE) 779: 780: /* Get that same information as a _TYPE. */ 781: #define VF_BASETYPE_VALUE(NODE) TREE_VALUE (NODE) 782: 783: /* Get the value of the top-most type dominating the non-`normal' vfields. */ 784: #define VF_DERIVED_VALUE(NODE) (VF_BINFO_VALUE (NODE) ? BINFO_TYPE (VF_BINFO_VALUE (NODE)) : NULL_TREE) 785: 786: /* Get the value of the top-most type that's `normal' for the vfield. */ 787: #define VF_NORMAL_VALUE(NODE) TREE_TYPE (NODE) 788: 789: /* Nonzero for TREE_LIST node means that this list of things 790: is a list of parameters, as opposed to a list of expressions. */ 791: #define TREE_PARMLIST(NODE) ((NODE)->common.unsigned_flag) /* overloaded! */ 792: 793: /* For FUNCTION_TYPE or METHOD_TYPE, a list of the exceptions that 794: this type can raise. */ 795: #define TYPE_RAISES_EXCEPTIONS(NODE) TYPE_NONCOPIED_PARTS (NODE) 796: 797: struct lang_decl_flags 798: { 799: #ifdef ONLY_INT_FIELDS 800: int language : 8; 801: #else 802: enum languages language : 8; 803: #endif 804: 805: unsigned operator_attr : 1; 806: unsigned constructor_attr : 1; 807: unsigned returns_first_arg : 1; 808: unsigned preserves_first_arg : 1; 809: unsigned friend_attr : 1; 810: unsigned static_function : 1; 811: unsigned const_memfunc : 1; 812: unsigned volatile_memfunc : 1; 813: 814: unsigned abstract_virtual : 1; 815: unsigned permanent_attr : 1 ; 816: unsigned constructor_for_vbase_attr : 1; 1.1.1.6 ! root 817: unsigned mutable_flag : 1; ! 818: unsigned dummy : 12; 1.1 root 819: 820: tree visibility; 821: tree context; 822: }; 823: 824: struct lang_decl 825: { 826: struct lang_decl_flags decl_flags; 827: 828: struct template_info *template_info; 829: tree main_decl_variant; 830: struct pending_inline *pending_inline_info; 831: tree vbase_init_list; 832: tree chain; 833: }; 834: 835: /* Non-zero if NODE is a _DECL with TREE_READONLY set. */ 836: #define TREE_READONLY_DECL_P(NODE) \ 837: (TREE_READONLY (NODE) && TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd') 838: 839: /* For FUNCTION_DECLs: return the language in which this decl 840: was declared. */ 841: #define DECL_LANGUAGE(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.language) 842: 843: /* For FUNCTION_DECLs: nonzero means that this function is a constructor. */ 844: #define DECL_CONSTRUCTOR_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_attr) 845: /* For FUNCTION_DECLs: nonzero means that this function is a constructor 846: for an object with virtual baseclasses. */ 847: #define DECL_CONSTRUCTOR_FOR_VBASE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.constructor_for_vbase_attr) 848: 849: /* For FUNCTION_DECLs: nonzero means that the constructor 850: is known to return a non-zero `this' unchanged. */ 851: #define DECL_RETURNS_FIRST_ARG(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.returns_first_arg) 852: 853: /* Nonzero for FUNCTION_DECL means that this constructor is known to 854: not make any assignment to `this', and therefore can be trusted 855: to return it unchanged. Otherwise, we must re-assign `current_class_decl' 856: after performing base initializations. */ 857: #define DECL_PRESERVES_THIS(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.preserves_first_arg) 858: 859: /* Nonzero for _DECL means that this decl appears in (or will appear 860: in) as a member in a RECORD_TYPE or UNION_TYPE node. It is also for 861: detecting circularity in case members are multiply defined. In the 1.1.1.2 root 862: case of a VAR_DECL, it is also used to determine how program storage 1.1 root 863: should be allocated. */ 864: #define DECL_IN_AGGR_P(NODE) (DECL_LANG_FLAG_3(NODE)) 865: 866: /* Nonzero for FUNCTION_DECL means that this decl is just a 867: friend declaration, and should not be added to the list of 868: member functions for this class. */ 869: #define DECL_FRIEND_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.friend_attr) 870: 871: /* Nonzero for FUNCTION_DECL means that this decl is a static 872: member function. */ 873: #define DECL_STATIC_FUNCTION_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.static_function) 874: 875: /* Nonzero for FUNCTION_DECL means that this member function 876: has `this' as const X *const. */ 877: #define DECL_CONST_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.const_memfunc) 878: 879: /* Nonzero for FUNCTION_DECL means that this member function 880: has `this' as volatile X *const. */ 881: #define DECL_VOLATILE_MEMFUNC_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.volatile_memfunc) 882: 1.1.1.6 ! root 883: /* Nonzero for _DECL means that this member object type ! 884: is mutable. */ ! 885: #define DECL_MUTABLE_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.mutable_flag) ! 886: 1.1 root 887: /* Nonzero for FUNCTION_DECL means that this member function 1.1.1.5 root 888: exists as part of an abstract class's interface. */ 1.1 root 889: #define DECL_ABSTRACT_VIRTUAL_P(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.abstract_virtual) 890: 891: /* Nonzero if allocated on permanent_obstack. */ 892: #define LANG_DECL_PERMANENT(LANGDECL) ((LANGDECL)->decl_flags.permanent_attr) 893: 894: /* The _TYPE context in which this _DECL appears. This field is used 895: only to compute visibility information. */ 896: #define DECL_CLASS_CONTEXT(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.context) 897: 898: /* For a FUNCTION_DECL: the chain through which the next method 899: in the method chain is found. We now use TREE_CHAIN to 900: link into the FIELD_DECL chain. */ 901: #if 1 902: #define DECL_CHAIN(NODE) (DECL_LANG_SPECIFIC(NODE)->chain) 903: #else 904: #define DECL_CHAIN(NODE) (TREE_CHAIN (NODE)) 905: #endif 906: 907: /* Points back to the decl which caused this lang_decl to be allocated. */ 908: #define DECL_MAIN_VARIANT(NODE) (DECL_LANG_SPECIFIC(NODE)->main_decl_variant) 909: 910: /* For a FUNCTION_DECL: if this function was declared inline inside of 911: a class declaration, this is where the text for the function is 912: squirreled away. */ 913: #define DECL_PENDING_INLINE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->pending_inline_info) 914: 915: /* Holds information about how virtual base classes should be initialized 916: by this constructor *if* this constructor is the one to perform 917: such initialization. */ 918: #define DECL_VBASE_INIT_LIST(NODE) (DECL_LANG_SPECIFIC(NODE)->vbase_init_list) 919: 920: /* For a TEMPLATE_DECL: template-specific information. */ 921: #define DECL_TEMPLATE_INFO(NODE) (DECL_LANG_SPECIFIC(NODE)->template_info) 922: 923: /* Nonzero in INT_CST means that this int is negative by dint of 924: using a twos-complement negated operand. */ 925: #define TREE_NEGATED_INT(NODE) (TREE_LANG_FLAG_0 (NODE)) 926: 927: /* Nonzero in any kind of _EXPR or _REF node means that it is a call 928: to a storage allocation routine. If, later, alternate storage 929: is found to hold the object, this call can be ignored. */ 930: #define TREE_CALLS_NEW(NODE) (TREE_LANG_FLAG_1 (NODE)) 931: 932: /* Nonzero in any kind of _TYPE that uses multiple inheritance 933: or virtual baseclasses. */ 934: #define TYPE_USES_COMPLEX_INHERITANCE(NODE) (TREE_LANG_FLAG_1 (NODE)) 935: 936: /* Nonzero in IDENTIFIER_NODE means that this name is overloaded, and 937: should be looked up in a non-standard way. */ 938: #define TREE_OVERLOADED(NODE) (TREE_LANG_FLAG_0 (NODE)) 939: #define DECL_OVERLOADED(NODE) (DECL_LANG_FLAG_4 (NODE)) 940: 941: /* Nonzero if this (non-TYPE)_DECL has its virtual attribute set. 942: For a FUNCTION_DECL, this is when the function is a virtual function. 943: For a VAR_DECL, this is when the variable is a virtual function table. 944: For a FIELD_DECL, when the field is the field for the virtual function table. 945: For an IDENTIFIER_NODE, nonzero if any function with this name 946: has been declared virtual. 947: 948: For a _TYPE if it uses virtual functions (or is derived from 949: one that does). */ 950: #define TYPE_VIRTUAL_P(NODE) (TREE_LANG_FLAG_2 (NODE)) 951: 952: /* Same, but tells if this field is private in current context. */ 953: #define DECL_PRIVATE(NODE) (DECL_LANG_FLAG_5 (NODE)) 954: 955: /* Same, but tells if this field is private in current context. */ 956: #define DECL_PROTECTED(NODE) (DECL_LANG_FLAG_6(NODE)) 957: 958: #define DECL_PUBLIC(NODE) (DECL_LANG_FLAG_7(NODE)) 959: 960: /* Record whether a typedef for type `int' was actually `signed int'. */ 961: #define C_TYPEDEF_EXPLICITLY_SIGNED(exp) DECL_LANG_FLAG_1 ((exp)) 962: 1.1.1.4 root 963: /* Nonzero if the type T promotes to itself. 964: ANSI C states explicitly the list of types that promote; 965: in particular, short promotes to int even if they have the same width. */ 966: #define C_PROMOTING_INTEGER_TYPE_P(t) \ 967: (TREE_CODE ((t)) == INTEGER_TYPE \ 968: && (TYPE_MAIN_VARIANT (t) == char_type_node \ 969: || TYPE_MAIN_VARIANT (t) == signed_char_type_node \ 970: || TYPE_MAIN_VARIANT (t) == unsigned_char_type_node \ 971: || TYPE_MAIN_VARIANT (t) == short_integer_type_node \ 972: || TYPE_MAIN_VARIANT (t) == short_unsigned_type_node)) 973: 1.1.1.2 root 974: /* Mark which labels are explicitly declared. 975: These may be shadowed, and may be referenced from nested functions. */ 976: #define C_DECLARED_LABEL_FLAG(label) TREE_LANG_FLAG_1 (label) 977: 1.1 root 978: /* Record whether a type or decl was written with nonconstant size. 979: Note that TYPE_SIZE may have simplified to a constant. */ 980: #define C_TYPE_VARIABLE_SIZE(type) TREE_LANG_FLAG_4 (type) 981: #define C_DECL_VARIABLE_SIZE(type) DECL_LANG_FLAG_8 (type) 982: 983: /* Nonzero for _TYPE means that the _TYPE defines 984: at least one constructor. */ 985: #define TYPE_HAS_CONSTRUCTOR(NODE) (TYPE_LANG_FLAG_1(NODE)) 986: 987: /* When appearing in an INDIRECT_REF, it means that the tree structure 988: underneath is actually a call to a constructor. This is needed 989: when the constructor must initialize local storage (which can 990: be automatically destroyed), rather than allowing it to allocate 991: space from the heap. 992: 993: When appearing in a SAVE_EXPR, it means that underneath 994: is a call to a constructor. 995: 996: When appearing in a CONSTRUCTOR, it means that it was 997: a GNU C constructor expression. 998: 999: When appearing in a FIELD_DECL, it means that this field 1000: has been duly initialized in its constructor. */ 1001: #define TREE_HAS_CONSTRUCTOR(NODE) (TREE_LANG_FLAG_4(NODE)) 1002: 1003: /* Indicates that a NON_LVALUE_EXPR came from a C++ reference. 1004: Used to generate more helpful error message in case somebody 1005: tries to take its address. */ 1006: #define TREE_REFERENCE_EXPR(NODE) (TREE_LANG_FLAG_3(NODE)) 1007: 1008: /* Nonzero for _TYPE means that the _TYPE defines a destructor. */ 1009: #define TYPE_HAS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_2(NODE)) 1010: 1011: /* Nonzero for _TYPE node means that creating an object of this type 1012: will involve a call to a constructor. This can apply to objects 1013: of ARRAY_TYPE if the type of the elements needs a constructor. */ 1014: #define TYPE_NEEDS_CONSTRUCTING(NODE) (TYPE_LANG_FLAG_3(NODE)) 1015: #define TYPE_NEEDS_CONSTRUCTOR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.needs_constructor) 1016: 1017: /* Nonzero for _TYPE node means that destroying an object of this type 1018: will involve a call to a destructor. This can apply to objects 1019: of ARRAY_TYPE is the type of the elements needs a destructor. */ 1020: #define TYPE_NEEDS_DESTRUCTOR(NODE) (TYPE_LANG_FLAG_4(NODE)) 1021: 1.1.1.6 ! root 1022: /* Nonzero for _TYPE node means that this type is a pointer to member ! 1023: function type. */ ! 1024: #define TYPE_PTRMEMFUNC_P(NODE) (TREE_CODE(NODE) == RECORD_TYPE && TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag) ! 1025: #define TYPE_PTRMEMFUNC_FLAG(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.ptrmemfunc_flag) ! 1026: /* Get the POINTER_TYPE to the METHOD_TYPE associated with this ! 1027: pointer to member function. TYPE_PTRMEMFUNC_P _must_ be true, ! 1028: before using this macro. */ ! 1029: #define TYPE_PTRMEMFUNC_FN_TYPE(NODE) (TREE_TYPE (TYPE_FIELDS (TREE_TYPE (TREE_CHAIN (TREE_CHAIN (TYPE_FIELDS (NODE))))))) ! 1030: /* These are use to manipulate the the canonical RECORD_TYPE from the ! 1031: hashed POINTER_TYPE, and can only be used on the POINTER_TYPE. */ ! 1032: #define TYPE_GET_PTRMEMFUNC_TYPE(NODE) ((tree)TYPE_LANG_SPECIFIC(NODE)) ! 1033: #define TYPE_SET_PTRMEMFUNC_TYPE(NODE, VALUE) (TYPE_LANG_SPECIFIC(NODE) = ((struct lang_type *)(void*)(VALUE))) ! 1034: /* These are to get the delta2 and pfn fields from a TYPE_PTRMEMFUNC_P. */ ! 1035: #define DELTA2_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, 0, 0), delta2_identifier, 0, 0)) ! 1036: #define PFN_FROM_PTRMEMFUNC(NODE) (build_component_ref (build_component_ref ((NODE), pfn_or_delta2_identifier, 0, 0), pfn_identifier, 0, 0)) ! 1037: 1.1 root 1038: /* Nonzero for VAR_DECL node means that `external' was specified in 1039: its declaration. */ 1.1.1.4 root 1040: #define DECL_THIS_EXTERN(NODE) (DECL_LANG_FLAG_2(NODE)) 1.1 root 1041: 1042: /* Nonzero for SAVE_EXPR if used to initialize a PARM_DECL. */ 1043: #define PARM_DECL_EXPR(NODE) (TREE_LANG_FLAG_2(NODE)) 1044: 1045: /* Nonzero in FUNCTION_DECL means it is really an operator. 1046: Just used to communicate formatting information to dbxout.c. */ 1047: #define DECL_OPERATOR(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.operator_attr) 1048: 1.1.1.6 ! root 1049: #define UNKNOWN_TYPE LANG_TYPE ! 1050: 1.1 root 1051: /* Define fields and accessors for nodes representing declared names. */ 1052: 1.1.1.5 root 1053: #if 0 1.1 root 1054: /* C++: A derived class may be able to directly use the virtual 1055: function table of a base class. When it does so, it may 1056: still have a decl node used to access the virtual function 1057: table (so that variables of this type can initialize their 1058: virtual function table pointers by name). When such thievery 1.1.1.2 root 1059: is committed, know exactly which base class's virtual function 1.1 root 1060: table is the one being stolen. This effectively computes the 1061: transitive closure. */ 1062: #define DECL_VPARENT(NODE) ((NODE)->decl.arguments) 1.1.1.5 root 1063: #endif 1.1 root 1064: 1065: /* Make a slot so we can implement nested types. This slot holds 1066: the IDENTIFIER_NODE that uniquely names the nested type. This 1067: is for TYPE_DECLs only. */ 1068: #define DECL_NESTED_TYPENAME(NODE) ((NODE)->decl.arguments) 1069: 1070: /* C++: all of these are overloaded! These apply only to TYPE_DECLs. */ 1.1.1.6 ! root 1071: #define DECL_FRIENDLIST(NODE) (DECL_INITIAL (NODE)) ! 1072: #define DECL_UNDEFINED_FRIENDS(NODE) ((NODE)->decl.result) ! 1073: #define DECL_WAITING_FRIENDS(NODE) ((tree)(NODE)->decl.rtl) ! 1074: #define SET_DECL_WAITING_FRIENDS(NODE,VALUE) \ ! 1075: ((NODE)->decl.rtl=(struct rtx_def*)VALUE) 1.1 root 1076: 1077: /* The DECL_VISIBILITY is used to record under which context 1078: special visibility rules apply. */ 1079: #define DECL_VISIBILITY(NODE) (DECL_LANG_SPECIFIC(NODE)->decl_flags.visibility) 1080: 1081: /* C++: all of these are overloaded! 1082: These apply to PARM_DECLs and VAR_DECLs. */ 1083: #define DECL_REFERENCE_SLOT(NODE) ((tree)(NODE)->decl.arguments) 1084: #define SET_DECL_REFERENCE_SLOT(NODE,VAL) ((NODE)->decl.arguments=VAL) 1085: 1086: /* For local VAR_DECLs, holds index into gc-protected obstack. */ 1087: #define DECL_GC_OFFSET(NODE) ((NODE)->decl.result) 1088: 1089: /* Accessor macros for C++ template decl nodes. */ 1090: #define DECL_TEMPLATE_IS_CLASS(NODE) (DECL_RESULT(NODE) == NULL_TREE) 1091: #define DECL_TEMPLATE_PARMS(NODE) DECL_ARGUMENTS(NODE) 1092: /* For class templates. */ 1093: #define DECL_TEMPLATE_MEMBERS(NODE) DECL_INITIAL(NODE) 1094: /* For function, method, class-data templates. */ 1095: #define DECL_TEMPLATE_RESULT(NODE) DECL_RESULT(NODE) 1096: #define DECL_TEMPLATE_INSTANTIATIONS(NODE) DECL_VINDEX(NODE) 1097: 1098: /* ...and for unexpanded-parameterized-type nodes. */ 1099: #define UPT_TEMPLATE(NODE) TREE_PURPOSE(TYPE_VALUES(NODE)) 1100: #define UPT_PARMS(NODE) TREE_VALUE(TYPE_VALUES(NODE)) 1101: 1102: /* An enumeration of the kind of tags that C++ accepts. */ 1103: enum tag_types { record_type, class_type, union_type, enum_type, exception_type }; 1104: 1105: /* Zero means prototype weakly, as in ANSI C (no args means nothing). 1106: Each language context defines how this variable should be set. */ 1107: extern int strict_prototype; 1108: extern int strict_prototypes_lang_c, strict_prototypes_lang_cplusplus; 1109: 1110: /* Non-zero means that if a label exists, and no other identifier 1111: applies, use the value of the label. */ 1112: extern int flag_labels_ok; 1113: 1114: /* Non-zero means to collect statistics which might be expensive 1115: and to print them when we are done. */ 1116: extern int flag_detailed_statistics; 1117: 1118: /* Non-zero means warn in function declared in derived class has the 1119: same name as a virtual in the base class, but fails to match the 1120: type signature of any virtual function in the base class. */ 1121: extern int warn_overloaded_virtual; 1122: 1123: /* in cp-decl{2}.c */ 1124: extern tree void_list_node; 1125: extern tree void_zero_node; 1126: extern tree default_function_type; 1127: extern tree vtable_entry_type; 1128: extern tree __t_desc_type_node, __i_desc_type_node, __m_desc_type_node; 1.1.1.6 ! root 1129: extern tree Type_info_type_node; 1.1 root 1130: extern tree class_star_type_node; 1.1.1.6 ! root 1131: extern tree this_identifier; ! 1132: extern tree pfn_identifier; ! 1133: extern tree index_identifier; ! 1134: extern tree delta_identifier; ! 1135: extern tree delta2_identifier; ! 1136: extern tree pfn_or_delta2_identifier; 1.1 root 1137: 1138: /* A node that is a list (length 1) of error_mark_nodes. */ 1139: extern tree error_mark_list; 1140: 1141: extern tree ptr_type_node; 1142: extern tree class_type_node, record_type_node, union_type_node, enum_type_node; 1143: extern tree exception_type_node, unknown_type_node; 1144: 1145: /* The largest size a virtual function table can be. 1146: Must be a (power of 2). */ 1147: #ifndef VINDEX_MAX 1148: #define VINDEX_MAX ((unsigned)128) 1149: /* This is the integer ~ (vindex_max - 1). */ 1150: #endif 1151: extern tree vtbl_mask; 1152: 1153: /* Array type `(void *)[]' */ 1154: extern tree vtbl_type_node; 1155: 1156: extern tree long_long_integer_type_node, long_long_unsigned_type_node; 1157: /* For building calls to `delete'. */ 1158: extern tree integer_two_node, integer_three_node; 1159: 1160: /* in cp-except.c */ 1161: extern tree current_exception_type; 1162: extern tree current_exception_decl; 1163: extern tree current_exception_object; 1.1.1.5 root 1164: 1165: /* in cp-pt.c */ 1166: /* PARM_VEC is a vector of template parameters, either IDENTIFIER_NODEs or 1167: PARM_DECLs. BINDINGS, if non-null, is a vector of bindings for those 1168: parameters. */ 1169: struct template_info { 1170: /* Vector of template parameters, either PARM_DECLs or IDENTIFIER_NODEs. */ 1171: tree parm_vec; 1172: /* If non-null, a vector of bindings for the template parms. */ 1173: tree bindings; 1174: 1175: /* Text of template, and length. */ 1176: char *text; 1177: int length; 1178: /* Where it came from. */ 1179: char *filename; 1180: int lineno; 1181: 1182: /* What kind of aggregate -- struct, class, or null. */ 1183: tree aggr; 1184: }; 1185: extern int processing_template_decl, processing_template_defn; 1186: 1.1.1.6 ! root 1187: /* The template currently being instantiated, and where the instantiation ! 1188: was triggered. */ ! 1189: struct tinst_level ! 1190: { ! 1191: tree classname; ! 1192: int line; ! 1193: char *file; ! 1194: struct tinst_level *next; ! 1195: }; 1.1.1.5 root 1196: 1.1.1.6 ! root 1197: extern struct tinst_level *current_tinst_level; 1.1 root 1198: 1199: /* in cp-class.c */ 1200: extern tree current_class_name; 1201: extern tree current_class_type; 1.1.1.6 ! root 1202: extern tree previous_class_type; 1.1 root 1203: 1204: extern tree current_lang_name, lang_name_cplusplus, lang_name_c; 1205: 1206: /* Points to the name of that function. May not be the DECL_NAME 1207: of CURRENT_FUNCTION_DECL due to overloading */ 1208: extern tree original_function_name; 1209: 1210: extern tree current_class_name, current_class_type, current_class_decl, C_C_D; 1211: extern tree current_vtable_decl; 1212: 1213: /* in cp-init.c */ 1214: extern tree global_base_init_list; 1215: extern tree current_base_init_list, current_member_init_list; 1216: 1217: extern int current_function_assigns_this; 1218: extern int current_function_just_assigned_this; 1219: extern int current_function_parms_stored; 1220: 1221: /* Here's where we control how name mangling takes place. */ 1222: 1223: #define OPERATOR_ASSIGN_FORMAT "__a%s" 1224: #define OPERATOR_FORMAT "__%s" 1225: #define OPERATOR_TYPENAME_FORMAT "__op" 1.1.1.6 ! root 1226: #define OPERATOR_TYPENAME_P(ID_NODE) \ ! 1227: (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \ ! 1228: && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \ ! 1229: && IDENTIFIER_POINTER (ID_NODE)[2] == 'o' \ ! 1230: && IDENTIFIER_POINTER (ID_NODE)[3] == 'p') ! 1231: 1.1 root 1232: 1.1.1.4 root 1233: /* Cannot use '$' up front, because this confuses gdb 1234: (names beginning with '$' are gdb-local identifiers). 1.1 root 1235: 1236: Note that all forms in which the '$' is significant are long enough 1.1.1.4 root 1237: for direct indexing (meaning that if we know there is a '$' 1238: at a particular location, we can index into the string at 1239: any other location that provides distinguishing characters). */ 1.1 root 1240: 1241: /* Define NO_DOLLAR_IN_LABEL in your favorite tm file if your assembler 1242: doesn't allow '$' in symbol names. */ 1243: #ifndef NO_DOLLAR_IN_LABEL 1244: 1245: #define JOINER '$' 1246: 1247: #define VPTR_NAME "$v" 1248: #define THROW_NAME "$eh_throw" 1249: #define DESTRUCTOR_DECL_PREFIX "_$_" 1250: #define AUTO_VTABLE_NAME "__vtbl$me__" 1251: #define AUTO_TEMP_NAME "_$tmp_" 1252: #define AUTO_TEMP_FORMAT "_$tmp_%d" 1.1.1.3 root 1253: #define VTABLE_BASE "$vb" 1.1 root 1254: #define VTABLE_NAME_FORMAT "_vt$%s" 1.1.1.3 root 1255: #define VFIELD_BASE "$vf" 1.1 root 1256: #define VFIELD_NAME "_vptr$" 1257: #define VFIELD_NAME_FORMAT "_vptr$%s" 1258: #define VBASE_NAME "_vb$" 1259: #define VBASE_NAME_FORMAT "_vb$%s" 1260: #define STATIC_NAME_FORMAT "_%s$%s" 1261: #define ANON_AGGRNAME_FORMAT "$_%d" 1262: 1.1.1.5 root 1263: #else /* NO_DOLLAR_IN_LABEL */ 1264: 1265: #ifndef NO_DOT_IN_LABEL 1.1 root 1266: 1267: #define JOINER '.' 1268: 1269: #define VPTR_NAME ".v" 1270: #define THROW_NAME ".eh_throw" 1271: #define DESTRUCTOR_DECL_PREFIX "_._" 1272: #define AUTO_VTABLE_NAME "__vtbl.me__" 1273: #define AUTO_TEMP_NAME "_.tmp_" 1274: #define AUTO_TEMP_FORMAT "_.tmp_%d" 1.1.1.3 root 1275: #define VTABLE_BASE ".vb" 1.1 root 1276: #define VTABLE_NAME_FORMAT "_vt.%s" 1.1.1.3 root 1277: #define VFIELD_BASE ".vf" 1.1 root 1278: #define VFIELD_NAME "_vptr." 1279: #define VFIELD_NAME_FORMAT "_vptr.%s" 1280: #define VBASE_NAME "_vb." 1281: #define VBASE_NAME_FORMAT "_vb.%s" 1282: #define STATIC_NAME_FORMAT "_%s.%s" 1283: 1284: #define ANON_AGGRNAME_FORMAT "._%d" 1285: 1.1.1.5 root 1286: #else /* NO_DOT_IN_LABEL */ 1287: 1288: #define VPTR_NAME "__vptr" 1289: #define VPTR_NAME_P(ID_NODE) \ 1290: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VPTR_NAME, sizeof (VPTR_NAME) - 1)) 1291: #define THROW_NAME "__eh_throw" 1292: #define DESTRUCTOR_DECL_PREFIX "__destr_" 1293: #define DESTRUCTOR_NAME_P(ID_NODE) \ 1294: (!strncmp (IDENTIFIER_POINTER (ID_NODE), DESTRUCTOR_DECL_PREFIX, \ 1295: sizeof (DESTRUCTOR_DECL_PREFIX) - 1)) 1296: #define IN_CHARGE_NAME "__in_chrg" 1297: #define AUTO_VTABLE_NAME "__vtbl_me__" 1298: #define AUTO_TEMP_NAME "__tmp_" 1299: #define TEMP_NAME_P(ID_NODE) \ 1300: (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, \ 1301: sizeof (AUTO_TEMP_NAME) - 1)) 1302: #define AUTO_TEMP_FORMAT "__tmp_%d" 1303: #define VTABLE_BASE "__vtb" 1.1.1.6 ! root 1304: #define VTABLE_NAME "__vt_" 1.1.1.5 root 1305: #define VTABLE_NAME_FORMAT "__vt_%s" 1.1.1.6 ! root 1306: #define VTABLE_NAME_P(ID_NODE) \ ! 1307: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VTABLE_NAME, \ ! 1308: sizeof (VTABLE_NAME_FORMAT) - 1)) 1.1.1.5 root 1309: #define VFIELD_BASE "__vfb" 1310: #define VFIELD_NAME "__vptr_" 1311: #define VFIELD_NAME_P(ID_NODE) \ 1312: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, \ 1313: sizeof (VFIELD_NAME) - 1)) 1314: #define VFIELD_NAME_FORMAT "_vptr_%s" 1315: #define VBASE_NAME "__vb_" 1316: #define VBASE_NAME_P(ID_NODE) \ 1317: (!strncmp (IDENTIFIER_POINTER (ID_NODE), VBASE_NAME, \ 1318: sizeof (VBASE_NAME) - 1)) 1319: #define VBASE_NAME_FORMAT "__vb_%s" 1320: #define STATIC_NAME_FORMAT "__static_%s_%s" 1321: 1322: #define ANON_AGGRNAME_PREFIX "__anon_" 1323: #define ANON_AGGRNAME_P(ID_NODE) \ 1324: (!strncmp (IDENTIFIER_POINTER (ID_NODE), ANON_AGGRNAME_PREFIX, \ 1325: sizeof (ANON_AGGRNAME_PREFIX) - 1)) 1326: #define ANON_AGGRNAME_FORMAT "__anon_%d" 1327: #define ANON_PARMNAME_FORMAT "__%d" 1328: #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \ 1329: && IDENTIFIER_POINTER (ID_NODE)[1] == '_' \ 1330: && IDENTIFIER_POINTER (ID_NODE)[2] <= '9') 1331: 1332: #endif /* NO_DOT_IN_LABEL */ 1.1 root 1333: #endif /* NO_DOLLAR_IN_LABEL */ 1334: 1.1.1.4 root 1335: #define THIS_NAME "this" 1.1 root 1336: #define DESTRUCTOR_NAME_FORMAT "~%s" 1337: #define FILE_FUNCTION_PREFIX_LEN 9 1.1.1.6 ! root 1338: ! 1339: #define IN_CHARGE_NAME "__in_chrg" ! 1340: ! 1341: #define VTBL_PTR_TYPE "__vtbl_ptr_type" ! 1342: #define VTABLE_DELTA_NAME "__delta" ! 1343: #define VTABLE_INDEX_NAME "__index" ! 1344: #define VTABLE_PFN_NAME "__pfn" ! 1345: #define VTABLE_DELTA2_NAME "__delta2" 1.1 root 1346: #define EXCEPTION_CLEANUP_NAME "exception cleanup" 1347: 1.1.1.4 root 1348: #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0) 1.1.1.5 root 1349: 1350: #if !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) 1351: 1.1 root 1352: #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ 1353: && IDENTIFIER_POINTER (ID_NODE)[1] == 'v') 1354: #define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER) 1355: 1.1.1.5 root 1356: #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ 1357: && IDENTIFIER_POINTER (ID_NODE)[2] == 't' \ 1358: && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) 1359: 1360: #define VBASE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == 'v' \ 1361: && IDENTIFIER_POINTER (ID_NODE)[2] == 'b' \ 1362: && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) 1.1 root 1363: 1364: #define TEMP_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), AUTO_TEMP_NAME, sizeof (AUTO_TEMP_NAME)-1)) 1365: #define VFIELD_NAME_P(ID_NODE) (!strncmp (IDENTIFIER_POINTER (ID_NODE), VFIELD_NAME, sizeof(VFIELD_NAME)-1)) 1366: 1367: /* For anonymous aggregate types, we need some sort of name to 1368: hold on to. In practice, this should not appear, but it should 1369: not be harmful if it does. */ 1.1.1.4 root 1370: #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ 1371: && IDENTIFIER_POINTER (ID_NODE)[1] == '_') 1.1 root 1372: #define ANON_PARMNAME_FORMAT "_%d" 1373: #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \ 1374: && IDENTIFIER_POINTER (ID_NODE)[1] <= '9') 1.1.1.5 root 1375: #endif /* !defined(NO_DOLLAR_IN_LABEL) || !defined(NO_DOT_IN_LABEL) */ 1.1 root 1376: 1377: /* Define the sets of attributes that member functions and baseclasses 1378: can have. These are sensible combinations of {public,private,protected} 1379: cross {virtual,non-virtual}. */ 1380: 1381: enum visibility_type { 1382: visibility_default, 1383: visibility_public, 1384: visibility_private, 1385: visibility_protected, 1386: visibility_default_virtual, 1387: visibility_public_virtual, 1388: visibility_private_virtual 1389: }; 1390: 1391: /* in cp-lex.c */ 1392: extern tree current_unit_name, current_unit_language; 1393: 1394: /* Things for handling inline functions. */ 1395: 1396: struct pending_inline 1397: { 1398: struct pending_inline *next; /* pointer to next in chain */ 1399: int lineno; /* line number we got the text from */ 1400: char *filename; /* name of file we were processing */ 1401: tree fndecl; /* FUNCTION_DECL that brought us here */ 1402: int token; /* token we were scanning */ 1403: int token_value; /* value of token we were scanning (YYSTYPE) */ 1404: 1405: char *buf; /* pointer to character stream */ 1406: int len; /* length of stream */ 1407: tree parm_vec, bindings; /* in case this is derived from a template */ 1408: unsigned int can_free : 1; /* free this after we're done with it? */ 1409: unsigned int deja_vu : 1; /* set iff we don't want to see it again. */ 1.1.1.4 root 1410: unsigned int interface : 2; /* 0=interface 1=unknown 2=implementation */ 1.1 root 1411: }; 1412: 1413: /* in cp-method.c */ 1414: extern struct pending_inline *pending_inlines; 1415: 1416: /* 1 for -fall-virtual: make every member function (except 1417: constructors) lay down in the virtual function table. 1418: Calls can then either go through the virtual function table or not, 1.1.1.5 root 1419: depending on whether we know what function will actually be called. */ 1.1 root 1420: 1421: extern int flag_all_virtual; 1422: 1.1.1.2 root 1423: /* Positive values means that we cannot make optimizing assumptions about 1424: `this'. Negative values means we know `this' to be of static type. */ 1.1 root 1425: 1426: extern int flag_this_is_variable; 1427: 1.1.1.4 root 1428: /* Controls whether enums and ints freely convert. 1429: 1 means with complete freedom. 1430: 0 means enums can convert to ints, but not vice-versa. */ 1431: 1432: extern int flag_int_enum_equivalence; 1433: 1.1 root 1434: /* Nonzero means layout structures so that we can do garbage collection. */ 1435: 1436: extern int flag_gc; 1437: 1438: /* Nonzero means generate 'dossiers' that give run-time type information. */ 1439: 1440: extern int flag_dossier; 1441: 1.1.1.6 ! root 1442: /* Nonzero means templates obey #pragma interface and implementation. */ ! 1443: ! 1444: extern int flag_external_templates; ! 1445: 1.1 root 1446: /* Current end of entries in the gc obstack for stack pointer variables. */ 1447: 1448: extern int current_function_obstack_index; 1449: 1450: /* Flag saying whether we have used the obstack in this function or not. */ 1451: 1452: extern int current_function_obstack_usage; 1453: 1.1.1.4 root 1454: enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; 1.1 root 1455: 1456: extern tree current_class_decl, C_C_D; /* PARM_DECL: the class instance variable */ 1457: 1458: /* The following two can be derived from the previous one */ 1459: extern tree current_class_name; /* IDENTIFIER_NODE: name of current class */ 1460: extern tree current_class_type; /* _TYPE: the type of the current class */ 1461: 1462: /* Some macros for char-based bitfields. */ 1463: #define B_SET(a,x) (a[x>>3] |= (1 << (x&7))) 1464: #define B_CLR(a,x) (a[x>>3] &= ~(1 << (x&7))) 1465: #define B_TST(a,x) (a[x>>3] & (1 << (x&7))) 1466: 1467: /* These are uses as bits in flags passed to build_method_call 1468: to control its error reporting behavior. 1469: 1470: LOOKUP_PROTECT means flag visibility violations. 1471: LOOKUP_COMPLAIN mean complain if no suitable member function 1472: matching the arguments is found. 1473: LOOKUP_NORMAL is just a combination of these two. 1474: LOOKUP_AGGR requires the instance to be of aggregate type. 1475: LOOKUP_NONVIRTUAL means make a direct call to the member function found 1476: LOOKUP_GLOBAL means search through the space of overloaded functions, 1477: rather than the space of member functions. 1478: LOOKUP_HAS_IN_CHARGE means that the "in charge" variable is already 1479: in the parameter list. 1480: LOOKUP_PROTECTED_OK means that even if the constructor we find appears 1.1.1.2 root 1481: to be non-visible to current scope, call it anyway. 1.1 root 1482: LOOKUP_NO_CONVERSION means that user-defined conversions are not 1483: permitted. Built-in conversions are permitted. 1484: LOOKUP_DESTRUCTOR means explicit call to destructor. */ 1485: 1486: #define LOOKUP_PROTECT (1) 1487: #define LOOKUP_COMPLAIN (2) 1488: #define LOOKUP_NORMAL (3) 1489: #define LOOKUP_AGGR (4) 1490: #define LOOKUP_NONVIRTUAL (8) 1491: #define LOOKUP_GLOBAL (16) 1492: #define LOOKUP_HAS_IN_CHARGE (32) 1493: #define LOOKUP_SPECULATIVELY (64) 1494: #define LOOKUP_PROTECTED_OK (128) 1.1.1.5 root 1495: /* 256 is free */ 1.1 root 1496: #define LOOKUP_NO_CONVERSION (512) 1497: #define LOOKUP_DESTRUCTOR (512) 1498: 1499: /* Anatomy of a DECL_FRIENDLIST (which is a TREE_LIST): 1500: purpose = friend name (IDENTIFIER_NODE); 1501: value = TREE_LIST of FUNCTION_DECLS; 1502: chain, type = EMPTY; */ 1503: #define FRIEND_NAME(LIST) (TREE_PURPOSE (LIST)) 1504: #define FRIEND_DECLS(LIST) (TREE_VALUE (LIST)) 1505: 1506: /* These macros are for accessing the fields of TEMPLATE...PARM nodes. */ 1507: #define TEMPLATE_TYPE_TPARMLIST(NODE) TREE_PURPOSE (TYPE_FIELDS (NODE)) 1508: #define TEMPLATE_TYPE_IDX(NODE) TREE_INT_CST_LOW (TREE_VALUE (TYPE_FIELDS (NODE))) 1509: #define TEMPLATE_TYPE_SET_INFO(NODE,P,I) \ 1510: (TYPE_FIELDS (NODE) = build_tree_list (P, build_int_2 (I, 0))) 1511: #define TEMPLATE_CONST_TPARMLIST(NODE) (*(tree*)&TREE_INT_CST_LOW(NODE)) 1512: #define TEMPLATE_CONST_IDX(NODE) (TREE_INT_CST_HIGH(NODE)) 1513: #define TEMPLATE_CONST_SET_INFO(NODE,P,I) \ 1514: (TEMPLATE_CONST_TPARMLIST (NODE) = saved_parmlist, \ 1515: TEMPLATE_CONST_IDX (NODE) = I) 1516: 1517: /* in cp-lex.c */ 1518: /* Indexed by TREE_CODE, these tables give C-looking names to 1519: operators represented by TREE_CODES. For example, 1520: opname_tab[(int) MINUS_EXPR] == "-". */ 1521: extern char **opname_tab, **assignop_tab; 1.1.1.5 root 1522: 1.1.1.6 ! root 1523: /* in c-common.c */ ! 1524: extern tree convert_and_check PROTO((tree, tree)); ! 1525: extern void overflow_warning PROTO((tree)); ! 1526: extern void unsigned_conversion_warning PROTO((tree, tree)); ! 1527: 1.1.1.5 root 1528: /* in cp-call.c */ 1.1.1.6 ! root 1529: extern struct candidate *ansi_c_bullshit; ! 1530: 1.1.1.5 root 1531: extern int rank_for_overload PROTO((struct candidate *, struct candidate *)); 1532: extern void compute_conversion_costs PROTO((tree, tree, struct candidate *, int)); 1533: extern int get_arglist_len_in_bytes PROTO((tree)); 1534: extern tree build_vfield_ref PROTO((tree, tree)); 1535: extern tree find_scoped_type PROTO((tree, tree, tree)); 1536: extern tree resolve_scope_to_name PROTO((tree, tree)); 1537: extern tree build_scoped_method_call PROTO((tree, tree, tree, tree)); 1538: extern tree build_method_call PROTO((tree, tree, tree, tree, int)); 1539: extern tree build_overload_call_real PROTO((tree, tree, int, struct candidate *, int)); 1540: extern tree build_overload_call PROTO((tree, tree, int, struct candidate *)); 1541: extern tree build_overload_call_maybe PROTO((tree, tree, int, struct candidate *)); 1.1 root 1542: 1.1.1.5 root 1543: /* in cp-class.c */ 1544: extern tree build_vbase_pointer PROTO((tree, tree)); 1545: extern tree build_vbase_path PROTO((enum tree_code, tree, tree, tree, int)); 1546: extern tree build_vtable_entry PROTO((tree, tree)); 1547: extern tree build_vfn_ref PROTO((tree *, tree, tree)); 1548: extern void add_method PROTO((tree, tree *, tree)); 1549: extern void duplicate_tag_error PROTO((tree)); 1550: extern tree finish_struct PROTO((tree, tree, int)); 1551: extern int resolves_to_fixed_type_p PROTO((tree, int *)); 1552: extern void init_class_processing PROTO((void)); 1553: extern void pushclass PROTO((tree, int)); 1554: extern void popclass PROTO((int)); 1.1.1.6 ! root 1555: #if NEW_CLASS_SCOPING ! 1556: extern void push_nested_class PROTO((tree, int)); ! 1557: extern void pop_nested_class PROTO((int)); ! 1558: #endif 1.1.1.5 root 1559: extern void push_lang_context PROTO((tree)); 1560: extern void pop_lang_context PROTO((void)); 1561: extern int root_lang_context_p PROTO((void)); 1562: extern tree instantiate_type PROTO((tree, tree, int)); 1563: extern void print_class_statistics PROTO((void)); 1.1.1.6 ! root 1564: extern void maybe_push_cache_obstack PROTO((void)); 1.1.1.5 root 1565: 1566: /* in cp-cvt.c */ 1567: extern tree convert_to_reference PROTO((tree, tree, tree, tree, int, char *, int, int)); 1568: extern tree convert_from_reference PROTO((tree)); 1569: extern tree convert_to_aggr PROTO((tree, tree, char **, int)); 1570: extern tree convert_pointer_to PROTO((tree, tree)); 1.1.1.6 ! root 1571: extern tree convert_pointer_to_real PROTO((tree, tree)); 1.1.1.5 root 1572: extern tree convert_pointer_to_vbase PROTO((tree, tree)); 1573: extern tree convert PROTO((tree, tree)); 1574: extern tree convert_force PROTO((tree, tree)); 1575: extern tree build_type_conversion PROTO((enum tree_code, tree, tree, int)); 1576: extern int build_default_binary_type_conversion PROTO((enum tree_code, tree *, tree *)); 1577: extern int build_default_unary_type_conversion PROTO((enum tree_code, tree *)); 1578: 1579: /* cp-decl.c */ 1580: extern int global_bindings_p PROTO((void)); 1581: extern void keep_next_level PROTO((void)); 1582: extern int kept_level_p PROTO((void)); 1583: extern void declare_parm_level PROTO((void)); 1584: extern void declare_implicit_exception PROTO((void)); 1585: extern int have_exceptions_p PROTO((void)); 1586: extern void declare_uninstantiated_type_level PROTO((void)); 1587: extern int uninstantiated_type_level_p PROTO((void)); 1588: extern void declare_pseudo_global_level PROTO((void)); 1589: extern int pseudo_global_level_p PROTO((void)); 1590: extern void pushlevel PROTO((int)); 1591: extern void pushlevel_temporary PROTO((int)); 1592: extern tree poplevel PROTO((int, int, int)); 1593: extern void delete_block PROTO((tree)); 1594: extern void insert_block PROTO((tree)); 1595: extern void add_block_current_level PROTO((tree)); 1596: extern void set_block PROTO((tree)); 1597: extern void pushlevel_class PROTO((void)); 1598: extern tree poplevel_class PROTO((void)); 1599: /* skip print_other_binding_stack and print_binding_level */ 1600: extern void print_binding_stack PROTO((void)); 1601: extern void push_to_top_level PROTO((void)); 1602: extern void pop_from_top_level PROTO((void)); 1603: extern void set_identifier_type_value PROTO((tree, tree)); 1604: extern void set_identifier_local_value PROTO((tree, tree)); 1605: extern tree make_type_decl PROTO((tree, tree)); 1606: extern void pushtag PROTO((tree, tree)); 1607: extern tree make_anon_name PROTO((void)); 1608: extern void clear_anon_tags PROTO((void)); 1.1.1.6 ! root 1609: #if !NEW_CLASS_SCOPING 1.1.1.5 root 1610: extern void adjust_type_value PROTO((tree)); 1.1.1.6 ! root 1611: #endif 1.1.1.5 root 1612: extern tree pushdecl PROTO((tree)); 1613: extern tree pushdecl_top_level PROTO((tree)); 1.1.1.6 ! root 1614: #if NEW_CLASS_SCOPING ! 1615: extern void push_class_level_binding PROTO((tree, tree)); ! 1616: #endif 1.1.1.5 root 1617: extern void push_overloaded_decl_top_level PROTO((tree, int)); 1618: extern tree pushdecl_class_level PROTO((tree)); 1619: extern int overloaded_globals_p PROTO((tree)); 1620: extern tree push_overloaded_decl PROTO((tree, int)); 1621: extern tree implicitly_declare PROTO((tree)); 1622: extern tree lookup_label PROTO((tree)); 1623: extern tree shadow_label PROTO((tree)); 1624: extern tree define_label PROTO((char *, int, tree)); 1625: extern void define_case_label PROTO((tree)); 1626: extern tree getdecls PROTO((void)); 1627: extern tree gettags PROTO((void)); 1628: extern void set_current_level_tags_transparency PROTO((int)); 1629: extern tree typedecl_for_tag PROTO((tree)); 1630: extern tree lookup_name PROTO((tree, int)); 1631: extern tree lookup_name_current_level PROTO((tree)); 1632: extern void init_decl_processing PROTO((void)); 1633: /* skipped define_function */ 1634: extern void shadow_tag PROTO((tree)); 1635: extern void grok_ctor_properties PROTO((tree, tree)); 1636: extern tree groktypename PROTO((tree)); 1637: extern tree start_decl PROTO((tree, tree, int, tree)); 1638: extern void finish_decl PROTO((tree, tree, tree, int)); 1639: extern int complete_array_type PROTO((tree, tree, int)); 1640: extern tree grokdeclarator (); /* PROTO((tree, tree, enum decl_context, int, tree)); */ 1641: extern tree xref_defn_tag PROTO((tree, tree, tree)); 1642: extern tree xref_tag PROTO((tree, tree, tree)); 1643: extern tree start_enum PROTO((tree)); 1644: extern tree finish_enum PROTO((tree, tree)); 1645: extern tree build_enumerator PROTO((tree, tree)); 1646: extern tree grok_enum_decls PROTO((tree, tree)); 1647: extern int start_function PROTO((tree, tree, tree, int)); 1648: extern void store_parm_decls PROTO((void)); 1649: extern void store_return_init PROTO((tree, tree)); 1650: extern void finish_function PROTO((int, int)); 1651: extern tree start_method PROTO((tree, tree, tree)); 1652: extern tree finish_method PROTO((tree)); 1653: extern void hack_incomplete_structures PROTO((tree)); 1654: extern tree maybe_build_cleanup PROTO((tree)); 1655: extern void cplus_expand_expr_stmt PROTO((tree)); 1656: extern void finish_stmt PROTO((void)); 1657: extern void pop_implicit_try_blocks PROTO((tree)); 1658: extern void push_exception_cleanup PROTO((tree)); 1659: extern void revert_static_member_fn PROTO((tree *, tree *, tree *)); 1.1.1.6 ! root 1660: extern tree get_unique_fn PROTO((tree)); ! 1661: extern tree get_first_fn PROTO((tree)); 1.1.1.5 root 1662: 1663: /* in cp-decl2.c */ 1664: extern int lang_decode_option PROTO((char *)); 1665: extern tree grok_method_quals PROTO((tree, tree, tree)); 1666: extern void grokclassfn PROTO((tree, tree, tree, enum overload_flags, tree)); 1.1.1.6 ! root 1667: extern tree grok_alignof PROTO((tree)); ! 1668: extern tree grok_array_decl PROTO((tree, tree)); ! 1669: extern tree delete_sanity PROTO((tree, tree, int)); 1.1.1.5 root 1670: extern void check_classfn PROTO((tree, tree, tree)); 1671: extern tree grokfield PROTO((tree, tree, tree, tree, tree)); 1672: extern tree grokbitfield PROTO((tree, tree, tree)); 1673: extern tree groktypefield PROTO((tree, tree)); 1674: extern tree grokoptypename PROTO((tree, int)); 1675: extern tree build_push_scope PROTO((tree, tree)); 1.1.1.6 ! root 1676: extern tree constructor_name_full PROTO((tree)); 1.1.1.5 root 1677: extern tree constructor_name PROTO((tree)); 1678: extern void setup_vtbl_ptr PROTO((void)); 1679: extern void mark_inline_for_output PROTO((tree)); 1680: extern void clear_temp_name PROTO((void)); 1681: extern tree get_temp_name PROTO((tree, int)); 1682: extern tree get_temp_regvar PROTO((tree, tree)); 1683: extern void finish_anon_union PROTO((tree)); 1684: extern tree finish_table PROTO((tree, tree, tree, int)); 1685: extern void finish_builtin_type PROTO((tree, char *, tree *, int, tree)); 1686: extern tree coerce_new_type PROTO((tree)); 1687: extern tree coerce_delete_type PROTO((tree)); 1688: extern void walk_vtables PROTO((void (*)(), void (*)())); 1689: extern void finish_file PROTO((void)); 1.1.1.6 ! root 1690: extern void warn_if_unknown_interface PROTO((void)); ! 1691: extern tree grok_x_components PROTO((tree, tree)); 1.1 root 1692: 1.1.1.5 root 1693: /* in cp-edsel.c */ 1.1 root 1694: 1.1.1.5 root 1695: /* in cp-except.c */ 1696: extern tree lookup_exception_cname PROTO((tree, tree, tree)); 1697: extern tree lookup_exception_tname PROTO((tree)); 1698: extern tree lookup_exception_object PROTO((tree, tree, int)); 1699: extern tree lookup_exception_type PROTO((tree, tree, tree)); 1700: extern tree finish_exception PROTO((tree, tree)); 1701: extern void finish_exception_decl PROTO((tree, tree)); 1702: extern void end_exception_decls PROTO((void)); 1703: extern void cplus_expand_start_try PROTO((int)); 1704: extern tree cplus_expand_end_try PROTO((int)); 1705: extern void cplus_expand_start_except PROTO((tree, tree)); 1706: extern void cplus_expand_end_except PROTO((tree)); 1707: extern void cplus_expand_raise PROTO((tree, tree, tree, int)); 1708: extern tree ansi_exception_object_lookup PROTO((tree)); 1709: extern void cplus_expand_throw PROTO((tree)); 1710: extern tree cplus_expand_start_catch PROTO((tree)); 1711: extern tree ansi_expand_start_catch PROTO((tree)); 1712: extern void cplus_expand_end_catch PROTO((int)); 1713: extern void cplus_expand_reraise PROTO((tree)); 1714: extern void setup_exception_throw_decl PROTO((void)); 1715: extern void init_exception_processing PROTO((void)); 1716: extern void init_exception_processing_1 PROTO((void)); 1717: 1718: /* in cp-expr.c */ 1719: /* skip cplus_expand_expr */ 1720: extern void init_cplus_expand PROTO((void)); 1721: extern void fixup_result_decl PROTO((tree, struct rtx_def *)); 1722: extern int decl_in_memory_p PROTO((tree)); 1723: 1724: /* in cp-gc.c */ 1725: extern int type_needs_gc_entry PROTO((tree)); 1726: extern int value_safe_from_gc PROTO((tree, tree)); 1727: extern void build_static_gc_entry PROTO((tree, tree)); 1728: extern tree protect_value_from_gc PROTO((tree, tree)); 1729: extern tree build_headof PROTO((tree)); 1730: extern tree build_classof PROTO((tree)); 1731: extern tree build_t_desc PROTO((tree, int)); 1732: extern tree build_i_desc PROTO((tree)); 1733: extern tree build_m_desc PROTO((tree)); 1734: extern void expand_gc_prologue_and_epilogue PROTO((void)); 1735: extern void lang_expand_end_bindings PROTO((struct rtx_def *, struct rtx_def *)); 1736: extern void init_gc_processing PROTO((void)); 1.1.1.6 ! root 1737: extern tree build_typeid PROTO((tree)); ! 1738: extern tree get_typeid PROTO((tree)); ! 1739: extern tree build_dynamic_cast PROTO((tree, tree)); 1.1 root 1740: 1.1.1.5 root 1741: /* in cp-init.c */ 1742: extern void emit_base_init PROTO((tree, int)); 1743: extern void check_base_init PROTO((tree)); 1744: extern tree build_virtual_init PROTO((tree, tree, tree)); 1745: extern void do_member_init PROTO((tree, tree, tree)); 1746: extern void expand_member_init PROTO((tree, tree, tree)); 1747: extern void expand_aggr_init PROTO((tree, tree, int)); 1748: extern int is_aggr_typedef PROTO((tree, int)); 1749: extern tree build_member_call PROTO((tree, tree, tree)); 1750: extern tree build_offset_ref PROTO((tree, tree)); 1751: extern tree get_member_function PROTO((tree *, tree, tree)); 1.1.1.6 ! root 1752: extern tree get_member_function_from_ptrfunc PROTO((tree *, tree, tree)); 1.1.1.5 root 1753: extern tree resolve_offset_ref PROTO((tree)); 1754: extern tree decl_constant_value PROTO((tree)); 1.1.1.6 ! root 1755: extern int is_friend_type PROTO((tree, tree)); 1.1.1.5 root 1756: extern int is_friend PROTO((tree, tree)); 1757: extern void make_friend_class PROTO((tree, tree)); 1758: extern tree do_friend PROTO((tree, tree, tree, tree, enum overload_flags, tree)); 1759: extern void embrace_waiting_friends PROTO((tree)); 1760: extern tree build_builtin_call PROTO((tree, tree, tree)); 1761: extern tree build_new PROTO((tree, tree, tree, int)); 1762: extern tree expand_vec_init PROTO((tree, tree, tree, tree, int)); 1763: extern tree build_x_delete PROTO((tree, tree, int, tree)); 1.1.1.6 ! root 1764: extern tree build_delete PROTO((tree, tree, tree, int, int)); 1.1.1.5 root 1765: extern tree build_vbase_delete PROTO((tree, tree)); 1766: extern tree build_vec_delete PROTO((tree, tree, tree, tree, tree, tree)); 1767: 1768: /* in cp-input.c */ 1769: 1770: /* in cp-lex.c */ 1771: extern tree make_pointer_declarator PROTO((tree, tree)); 1772: extern tree make_reference_declarator PROTO((tree, tree)); 1773: extern char *operator_name_string PROTO((tree)); 1774: extern void lang_init PROTO((void)); 1775: extern void lang_finish PROTO((void)); 1776: extern void init_filename_times PROTO((void)); 1777: extern void reinit_lang_specific PROTO((void)); 1778: extern void init_lex PROTO((void)); 1779: extern void reinit_parse_for_function PROTO((void)); 1780: extern int *init_parse PROTO((void)); 1781: extern void print_parse_statistics PROTO((void)); 1782: extern void extract_interface_info PROTO((void)); 1783: extern void set_vardecl_interface_info PROTO((tree, tree)); 1784: extern void do_pending_inlines PROTO((void)); 1785: extern void process_next_inline PROTO((tree)); 1786: /* skip restore_pending_input */ 1787: extern void yyungetc PROTO((int, int)); 1788: extern void reinit_parse_for_method PROTO((int, tree)); 1789: #if 0 1790: extern void reinit_parse_for_block PROTO((int, struct obstack *, int)); 1791: #endif 1.1.1.6 ! root 1792: extern tree cons_up_default_function PROTO((tree, tree, tree, int)); 1.1.1.5 root 1793: extern void check_for_missing_semicolon PROTO((tree)); 1794: extern void note_got_semicolon PROTO((tree)); 1795: extern void note_list_got_semicolon PROTO((tree)); 1796: extern int check_newline PROTO((void)); 1797: extern void dont_see_typename PROTO((void)); 1798: extern int identifier_type PROTO((tree)); 1799: extern void see_typename PROTO((void)); 1800: extern tree do_identifier PROTO((tree)); 1801: extern tree identifier_typedecl_value PROTO((tree)); 1802: extern int real_yylex PROTO((void)); 1803: extern tree build_lang_decl PROTO((enum tree_code, tree, tree)); 1804: extern tree build_lang_field_decl PROTO((enum tree_code, tree, tree)); 1805: extern void copy_lang_decl PROTO((tree)); 1806: extern tree make_lang_type PROTO((enum tree_code)); 1807: extern void copy_decl_lang_specific PROTO((tree)); 1808: extern void dump_time_statistics PROTO((void)); 1809: /* extern void compiler_error PROTO((char *, HOST_WIDE_INT, HOST_WIDE_INT)); */ 1810: extern void compiler_error_with_decl PROTO((tree, char *)); 1811: extern void yyerror PROTO((char *)); 1.1 root 1812: 1.1.1.6 ! root 1813: /* in cp-error.c */ ! 1814: extern void init_error PROTO((void)); ! 1815: extern char *fndecl_as_string PROTO((tree, tree, int)); ! 1816: extern char *type_as_string PROTO((tree, int)); ! 1817: extern char *decl_as_string PROTO((tree, int)); ! 1818: extern char *expr_as_string PROTO((tree, int)); ! 1819: extern char *code_as_string PROTO((enum tree_code, int)); ! 1820: extern char *language_as_string PROTO((enum languages, int)); ! 1821: 1.1.1.5 root 1822: /* in cp-method.c */ 1823: extern void init_method PROTO((void)); 1824: extern tree make_anon_parm_name PROTO((void)); 1825: extern void clear_anon_parm_name PROTO((void)); 1826: extern void do_inline_function_hair PROTO((tree, tree)); 1827: /* skip report_type_mismatch */ 1828: extern char *build_overload_name PROTO((tree, int, int)); 1829: extern tree cplus_exception_name PROTO((tree)); 1830: extern tree build_decl_overload PROTO((tree, tree, int)); 1831: extern tree build_typename_overload PROTO((tree)); 1832: extern tree build_t_desc_overload PROTO((tree)); 1833: extern void declare_overloaded PROTO((tree)); 1834: extern tree build_opfncall PROTO((enum tree_code, int, tree, tree, tree)); 1835: extern tree hack_identifier PROTO((tree, tree, int)); 1836: extern tree build_component_type_expr PROTO((tree, tree, tree, int)); 1837: 1838: /* in cp-pt.c */ 1839: extern void begin_template_parm_list PROTO((void)); 1840: extern tree process_template_parm PROTO((tree, tree)); 1841: extern tree end_template_parm_list PROTO((tree)); 1842: extern void end_template_decl PROTO((tree, tree, tree)); 1843: extern tree lookup_template_class PROTO((tree, tree, tree)); 1844: extern void push_template_decls PROTO((tree, tree, int)); 1845: extern void pop_template_decls PROTO((tree, tree, int)); 1846: extern int uses_template_parms PROTO((tree)); 1847: extern void instantiate_member_templates PROTO((tree)); 1848: extern tree instantiate_class_template PROTO((tree, int)); 1849: extern tree instantiate_template PROTO((tree, tree *)); 1850: extern void undo_template_name_overload PROTO((tree, int)); 1851: extern void overload_template_name PROTO((tree, int)); 1852: extern void end_template_instantiation PROTO((tree, tree)); 1853: extern void reinit_parse_for_template PROTO((int, tree, tree)); 1854: extern int type_unification PROTO((tree, tree *, tree, tree, int *)); 1855: extern int do_pending_expansions PROTO((void)); 1856: extern void do_pending_templates PROTO((void)); 1.1.1.6 ! root 1857: struct tinst_level *tinst_for_decl PROTO((void)); 1.1.1.5 root 1858: 1859: /* in cp-search.c */ 1860: extern tree make_memoized_table_entry PROTO((tree, tree, int)); 1861: extern void push_memoized_context PROTO((tree, int)); 1862: extern void pop_memoized_context PROTO((int)); 1863: extern tree get_binfo PROTO((tree, tree, int)); 1864: extern int get_base_distance PROTO((tree, tree, int, tree *)); 1865: extern enum visibility_type check_visibility PROTO((tree, tree)); 1866: extern tree lookup_field PROTO((tree, tree, int, int)); 1867: extern tree lookup_nested_field PROTO((tree, int)); 1868: extern tree lookup_fnfields PROTO((tree, tree, int)); 1869: extern HOST_WIDE_INT breadth_first_search PROTO((tree, int (*)(), int (*)())); 1870: extern int tree_needs_constructor_p PROTO((tree, int)); 1871: extern int tree_has_any_destructor_p PROTO((tree, int)); 1872: extern tree get_first_matching_virtual PROTO((tree, tree, int)); 1873: extern tree get_abstract_virtuals PROTO((tree)); 1874: extern tree get_baselinks PROTO((tree, tree, tree)); 1875: extern tree next_baselink PROTO((tree)); 1876: extern tree init_vbase_pointers PROTO((tree, tree)); 1877: extern tree build_vbase_vtables_init PROTO((tree, tree, tree, tree, int)); 1878: extern void clear_search_slots PROTO((tree)); 1879: extern tree get_vbase_types PROTO((tree)); 1880: extern void build_mi_matrix PROTO((tree)); 1881: extern void free_mi_matrix PROTO((void)); 1882: extern void build_mi_virtuals PROTO((int, int)); 1883: extern void add_mi_virtuals PROTO((int, tree)); 1884: extern void report_ambiguous_mi_virtuals PROTO((int, tree)); 1885: extern void note_debug_info_needed PROTO((tree)); 1886: extern void push_class_decls PROTO((tree)); 1887: extern void pop_class_decls PROTO((tree)); 1888: extern void unmark_finished_struct PROTO((tree)); 1889: extern void print_search_statistics PROTO((void)); 1890: extern void init_search_processing PROTO((void)); 1891: extern void reinit_search_statistics PROTO((void)); 1892: 1893: /* in cp-spew.c */ 1894: extern void init_spew PROTO((void)); 1895: extern int yylex PROTO((void)); 1896: extern tree arbitrate_lookup PROTO((tree, tree, tree)); 1.1 root 1897: 1.1.1.5 root 1898: /* in cp-tree.c */ 1899: extern int lvalue_p PROTO((tree)); 1900: extern int lvalue_or_else PROTO((tree, char *)); 1901: extern tree build_cplus_new PROTO((tree, tree, int)); 1902: extern tree break_out_cleanups PROTO((tree)); 1903: extern tree break_out_calls PROTO((tree)); 1904: extern tree build_cplus_method_type PROTO((tree, tree, tree)); 1905: extern tree build_cplus_staticfn_type PROTO((tree, tree, tree)); 1906: extern tree build_cplus_array_type PROTO((tree, tree)); 1907: extern void propagate_binfo_offsets PROTO((tree, tree)); 1908: extern int layout_vbasetypes PROTO((tree, int)); 1909: extern tree layout_basetypes PROTO((tree, tree)); 1910: extern int list_hash PROTO((tree)); 1911: extern tree list_hash_lookup PROTO((int, tree)); 1912: extern void list_hash_add PROTO((int, tree)); 1913: extern tree list_hash_canon PROTO((int, tree)); 1914: extern tree hash_tree_cons PROTO((int, int, int, tree, tree, tree)); 1915: extern tree hash_tree_chain PROTO((tree, tree)); 1916: extern tree hash_chainon PROTO((tree, tree)); 1917: extern tree get_decl_list PROTO((tree)); 1918: extern tree list_hash_lookup_or_cons PROTO((tree)); 1919: extern tree make_binfo PROTO((tree, tree, tree, tree, tree)); 1920: extern tree copy_binfo PROTO((tree)); 1921: extern tree binfo_value PROTO((tree, tree)); 1922: extern tree reverse_path PROTO((tree)); 1923: extern tree virtual_member PROTO((tree, tree)); 1924: extern tree virtual_offset PROTO((tree, tree, tree)); 1925: extern void debug_binfo PROTO((tree)); 1926: extern int decl_list_length PROTO((tree)); 1927: extern tree fnaddr_from_vtable_entry PROTO((tree)); 1928: extern void set_fnaddr_from_vtable_entry PROTO((tree, tree)); 1929: extern tree function_arg_chain PROTO((tree)); 1930: extern int promotes_to_aggr_type PROTO((tree, enum tree_code)); 1931: extern int is_aggr_type_2 PROTO((tree, tree)); 1932: extern void message_2_types PROTO((void (*)(), char *, tree, tree)); 1933: extern char *lang_printable_name PROTO((tree)); 1934: extern tree build_exception_variant PROTO((tree, tree, tree)); 1935: extern tree copy_to_permanent PROTO((tree)); 1936: extern void print_lang_statistics PROTO((void)); 1937: /* skip __eprintf */ 1938: extern tree array_type_nelts_total PROTO((tree)); 1939: extern tree array_type_nelts_top PROTO((tree)); 1940: 1941: /* in cp-typeck.c */ 1942: extern tree target_type PROTO((tree)); 1943: extern tree require_complete_type PROTO((tree)); 1944: extern int type_unknown_p PROTO((tree)); 1.1.1.6 ! root 1945: extern int fntype_p PROTO((tree)); 1.1.1.5 root 1946: extern tree require_instantiated_type PROTO((tree, tree, tree)); 1947: extern tree commonparms PROTO((tree, tree)); 1948: extern tree common_type PROTO((tree, tree)); 1949: extern int compexcepttypes PROTO((tree, tree, int)); 1950: extern int comptypes PROTO((tree, tree, int)); 1951: extern int comp_target_types PROTO((tree, tree, int)); 1952: extern tree common_base_types PROTO((tree, tree)); 1953: extern int compparms PROTO((tree, tree, int)); 1954: extern int comp_target_types PROTO((tree, tree, int)); 1955: extern tree unsigned_type PROTO((tree)); 1956: extern tree signed_type PROTO((tree)); 1957: extern tree signed_or_unsigned_type PROTO((int, tree)); 1958: extern tree c_sizeof PROTO((tree)); 1959: extern tree c_sizeof_nowarn PROTO((tree)); 1960: extern tree c_alignof PROTO((tree)); 1961: extern tree default_conversion PROTO((tree)); 1.1.1.6 ! root 1962: extern tree build_object_ref PROTO((tree, tree, tree)); 1.1.1.5 root 1963: extern tree build_component_ref_1 PROTO((tree, tree, int)); 1964: extern tree build_component_ref PROTO((tree, tree, tree, int)); 1965: extern tree build_x_indirect_ref PROTO((tree, char *)); 1966: extern tree build_indirect_ref PROTO((tree, char *)); 1967: extern tree build_x_array_ref PROTO((tree, tree)); 1968: extern tree build_array_ref PROTO((tree, tree)); 1969: extern tree build_x_function_call PROTO((tree, tree, tree)); 1970: extern tree build_function_call_real PROTO((tree, tree, int)); 1971: extern tree build_function_call PROTO((tree, tree)); 1972: extern tree build_function_call_maybe PROTO((tree, tree)); 1973: extern tree convert_arguments PROTO((tree, tree, tree, tree, int)); 1974: extern tree build_x_binary_op PROTO((enum tree_code, tree, tree)); 1975: extern tree build_binary_op PROTO((enum tree_code, tree, tree, int)); 1976: extern tree build_binary_op_nodefault PROTO((enum tree_code, tree, tree, enum tree_code)); 1977: extern tree build_component_addr PROTO((tree, tree, char *)); 1978: extern tree build_x_unary_op PROTO((enum tree_code, tree)); 1979: extern tree build_unary_op PROTO((enum tree_code, tree, int)); 1980: extern tree unary_complex_lvalue PROTO((enum tree_code, tree)); 1981: extern int mark_addressable PROTO((tree)); 1982: extern tree build_x_conditional_expr PROTO((tree, tree, tree)); 1983: extern tree build_conditional_expr PROTO((tree, tree, tree)); 1984: extern tree build_x_compound_expr PROTO((tree)); 1985: extern tree build_compound_expr PROTO((tree)); 1986: extern tree build_c_cast PROTO((tree, tree)); 1987: extern tree build_modify_expr PROTO((tree, enum tree_code, tree)); 1988: extern int language_lvalue_valid PROTO((tree)); 1989: extern void warn_for_assignment PROTO((char *, char *, char *, tree, int, int)); 1990: extern tree convert_for_initialization PROTO((tree, tree, tree, int, char *, tree, int)); 1991: extern void c_expand_asm_operands PROTO((tree, tree, tree, tree, int, char *, int)); 1992: extern void c_expand_return PROTO((tree)); 1993: extern tree c_expand_start_case PROTO((tree)); 1994: extern void record_format_info PROTO((tree, int, int, int)); 1995: extern tree build_component_ref PROTO((tree, tree, tree, int)); 1.1.1.6 ! root 1996: extern tree build_ptrmemfunc PROTO((tree, tree)); 1.1.1.5 root 1997: 1998: /* in cp-type2.c */ 1999: extern tree error_not_base_type PROTO((tree, tree)); 2000: extern tree binfo_or_else PROTO((tree, tree)); 2001: extern void error_with_aggr_type (); /* PROTO((tree, char *, HOST_WIDE_INT)); */ 2002: extern void readonly_error PROTO((tree, char *, int)); 2003: extern void abstract_virtuals_error PROTO((tree, tree)); 2004: extern void incomplete_type_error PROTO((tree, tree)); 2005: extern void my_friendly_abort PROTO((int)); 2006: extern void my_friendly_assert PROTO((int, int)); 2007: extern tree store_init_value PROTO((tree, tree)); 2008: extern tree digest_init PROTO((tree, tree, tree *)); 2009: extern tree build_scoped_ref PROTO((tree, tree)); 2010: extern tree build_x_arrow PROTO((tree)); 2011: extern tree build_m_component_ref PROTO((tree, tree)); 2012: extern tree build_functional_cast PROTO((tree, tree)); 2013: extern char *enum_name_string PROTO((tree, tree)); 2014: extern void report_case_error PROTO((int, tree, tree, tree)); 1.1 root 2015: 1.1.1.4 root 2016: /* in cp-xref.c */ 1.1.1.5 root 2017: extern void GNU_xref_begin PROTO((char *)); 2018: extern void GNU_xref_end PROTO((int)); 2019: extern void GNU_xref_file PROTO((char *)); 2020: extern void GNU_xref_start_scope PROTO((HOST_WIDE_INT)); 2021: extern void GNU_xref_end_scope PROTO((HOST_WIDE_INT, HOST_WIDE_INT, int, int, int)); 2022: extern void GNU_xref_def PROTO((tree, char *)); 2023: extern void GNU_xref_decl PROTO((tree, tree)); 2024: extern void GNU_xref_call PROTO((tree, char *)); 2025: extern void GNU_xref_function PROTO((tree, tree)); 2026: extern void GNU_xref_assign PROTO((tree)); 2027: extern void GNU_xref_hier PROTO((char *, char *, int, int, int)); 2028: extern void GNU_xref_member PROTO((tree, tree)); 1.1.1.4 root 2029: 1.1 root 2030: /* -- end of C++ */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.