00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "config.h"
00031 #include "system.h"
00032 #include "input.h"
00033 #include "tree.h"
00034 #include "cp-tree.h"
00035 #include "cpplib.h"
00036 #include "lex.h"
00037 #include "parse.h"
00038 #include "flags.h"
00039 #include "c-pragma.h"
00040 #include "toplev.h"
00041 #include "output.h"
00042 #include "ggc.h"
00043 #include "tm_p.h"
00044 #include "timevar.h"
00045 #include "diagnostic.h"
00046
00047 #ifdef MULTIBYTE_CHARS
00048 #include "mbchar.h"
00049 #include <locale.h>
00050 #endif
00051
00052 extern void yyprint PARAMS ((FILE *, int, YYSTYPE));
00053
00054 static int interface_strcmp PARAMS ((const char *));
00055 static int *init_cpp_parse PARAMS ((void));
00056 static void init_cp_pragma PARAMS ((void));
00057
00058 static tree parse_strconst_pragma PARAMS ((const char *, int));
00059 static void handle_pragma_vtable PARAMS ((cpp_reader *));
00060 static void handle_pragma_unit PARAMS ((cpp_reader *));
00061 static void handle_pragma_interface PARAMS ((cpp_reader *));
00062 static void handle_pragma_implementation PARAMS ((cpp_reader *));
00063 static void handle_pragma_java_exceptions PARAMS ((cpp_reader *));
00064
00065 #ifdef GATHER_STATISTICS
00066 #ifdef REDUCE_LENGTH
00067 static int reduce_cmp PARAMS ((int *, int *));
00068 static int token_cmp PARAMS ((int *, int *));
00069 #endif
00070 #endif
00071 static int is_global PARAMS ((tree));
00072 static void init_operators PARAMS ((void));
00073 static void copy_lang_type PARAMS ((tree));
00074
00075
00076 #ifdef __STDC__
00077 #define CONSTRAINT(name, expr) extern int constraint_##name [(expr) ? 1 : -1]
00078 #else
00079 #define CONSTRAINT(name, expr) extern int constraint_name [(expr) ? 1 : -1]
00080 #endif
00081
00082 #include "cpplib.h"
00083
00084 extern int yychar;
00085 extern YYSTYPE yylval;
00086
00087
00088
00089
00090
00091
00092
00093 tree lastiddecl;
00094
00095
00096 extern int *token_count;
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117 struct impl_files
00118 {
00119 const char *filename;
00120 struct impl_files *next;
00121 };
00122
00123 static struct impl_files *impl_file_chain;
00124
00125 #ifdef KEY
00126 bool pragma_implementation_seen = false, pragma_interface_seen = false;
00127 #endif
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 tree
00139 make_pointer_declarator (cv_qualifiers, target)
00140 tree cv_qualifiers, target;
00141 {
00142 if (target && TREE_CODE (target) == IDENTIFIER_NODE
00143 && ANON_AGGRNAME_P (target))
00144 error ("type name expected before `*'");
00145 target = build_nt (INDIRECT_REF, target);
00146 TREE_TYPE (target) = cv_qualifiers;
00147 return target;
00148 }
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158 tree
00159 make_reference_declarator (cv_qualifiers, target)
00160 tree cv_qualifiers, target;
00161 {
00162 if (target)
00163 {
00164 if (TREE_CODE (target) == ADDR_EXPR)
00165 {
00166 error ("cannot declare references to references");
00167 return target;
00168 }
00169 if (TREE_CODE (target) == INDIRECT_REF)
00170 {
00171 error ("cannot declare pointers to references");
00172 return target;
00173 }
00174 if (TREE_CODE (target) == IDENTIFIER_NODE && ANON_AGGRNAME_P (target))
00175 error ("type name expected before `&'");
00176 }
00177 target = build_nt (ADDR_EXPR, target);
00178 TREE_TYPE (target) = cv_qualifiers;
00179 return target;
00180 }
00181
00182 tree
00183 make_call_declarator (target, parms, cv_qualifiers, exception_specification)
00184 tree target, parms, cv_qualifiers, exception_specification;
00185 {
00186 target = build_nt (CALL_EXPR, target,
00187 tree_cons (parms, cv_qualifiers, NULL_TREE),
00188
00189
00190 NULL_TREE);
00191 CALL_DECLARATOR_EXCEPTION_SPEC (target) = exception_specification;
00192 return target;
00193 }
00194
00195 void
00196 set_quals_and_spec (call_declarator, cv_qualifiers, exception_specification)
00197 tree call_declarator, cv_qualifiers, exception_specification;
00198 {
00199 CALL_DECLARATOR_QUALS (call_declarator) = cv_qualifiers;
00200 CALL_DECLARATOR_EXCEPTION_SPEC (call_declarator) = exception_specification;
00201 }
00202
00203 int interface_only;
00204
00205 int interface_unknown;
00206
00207
00208
00209
00210 void
00211 cxx_init_options ()
00212 {
00213 c_common_init_options (clk_cplusplus);
00214
00215
00216 flag_exceptions = 1;
00217 #ifdef KEY
00218 key_exceptions = 1;
00219 opt_regions = 0;
00220 #endif
00221
00222
00223 diagnostic_line_cutoff (global_dc) = 80;
00224
00225
00226 diagnostic_prefixing_rule (global_dc) = DIAGNOSTICS_SHOW_PREFIX_ONCE;
00227 }
00228
00229 void
00230 cxx_finish ()
00231 {
00232 c_common_finish ();
00233 }
00234
00235 static int *
00236 init_cpp_parse ()
00237 {
00238 #ifdef GATHER_STATISTICS
00239 #ifdef REDUCE_LENGTH
00240 reduce_count = (int *) xcalloc (sizeof (int), (REDUCE_LENGTH + 1));
00241 reduce_count += 1;
00242 token_count = (int *) xcalloc (sizeof (int), (TOKEN_LENGTH + 1));
00243 token_count += 1;
00244 #endif
00245 #endif
00246 return token_count;
00247 }
00248
00249
00250 operator_name_info_t operator_name_info[(int) LAST_CPLUS_TREE_CODE];
00251
00252 operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE];
00253
00254
00255
00256 #define DEF_OPERATOR(NAME, C, M, AR, AP) \
00257 CONSTRAINT (C, sizeof "operator " + sizeof NAME <= 256);
00258 #include "operators.def"
00259 #undef DEF_OPERATOR
00260
00261 static void
00262 init_operators ()
00263 {
00264 tree identifier;
00265 char buffer[256];
00266 struct operator_name_info_t *oni;
00267
00268 #define DEF_OPERATOR(NAME, CODE, MANGLING, ARITY, ASSN_P) \
00269 sprintf (buffer, ISALPHA (NAME[0]) ? "operator %s" : "operator%s", NAME); \
00270 identifier = get_identifier (buffer); \
00271 IDENTIFIER_OPNAME_P (identifier) = 1; \
00272 \
00273 oni = (ASSN_P \
00274 ? &assignment_operator_name_info[(int) CODE] \
00275 : &operator_name_info[(int) CODE]); \
00276 oni->identifier = identifier; \
00277 oni->name = NAME; \
00278 oni->mangled_name = MANGLING; \
00279 oni->arity = ARITY;
00280
00281 #include "operators.def"
00282 #undef DEF_OPERATOR
00283
00284 operator_name_info[(int) ERROR_MARK].identifier
00285 = get_identifier ("<invalid operator>");
00286
00287
00288
00289
00290
00291
00292
00293 operator_name_info [(int) INIT_EXPR].name
00294 = operator_name_info [(int) MODIFY_EXPR].name;
00295 operator_name_info [(int) EXACT_DIV_EXPR].name = "(ceiling /)";
00296 operator_name_info [(int) CEIL_DIV_EXPR].name = "(ceiling /)";
00297 operator_name_info [(int) FLOOR_DIV_EXPR].name = "(floor /)";
00298 operator_name_info [(int) ROUND_DIV_EXPR].name = "(round /)";
00299 operator_name_info [(int) CEIL_MOD_EXPR].name = "(ceiling %)";
00300 operator_name_info [(int) FLOOR_MOD_EXPR].name = "(floor %)";
00301 operator_name_info [(int) ROUND_MOD_EXPR].name = "(round %)";
00302 operator_name_info [(int) ABS_EXPR].name = "abs";
00303 operator_name_info [(int) FFS_EXPR].name = "ffs";
00304 operator_name_info [(int) BIT_ANDTC_EXPR].name = "&~";
00305 operator_name_info [(int) TRUTH_AND_EXPR].name = "strict &&";
00306 operator_name_info [(int) TRUTH_OR_EXPR].name = "strict ||";
00307 operator_name_info [(int) IN_EXPR].name = "in";
00308 operator_name_info [(int) RANGE_EXPR].name = "...";
00309 operator_name_info [(int) CONVERT_EXPR].name = "+";
00310
00311 assignment_operator_name_info [(int) EXACT_DIV_EXPR].name
00312 = "(exact /=)";
00313 assignment_operator_name_info [(int) CEIL_DIV_EXPR].name
00314 = "(ceiling /=)";
00315 assignment_operator_name_info [(int) FLOOR_DIV_EXPR].name
00316 = "(floor /=)";
00317 assignment_operator_name_info [(int) ROUND_DIV_EXPR].name
00318 = "(round /=)";
00319 assignment_operator_name_info [(int) CEIL_MOD_EXPR].name
00320 = "(ceiling %=)";
00321 assignment_operator_name_info [(int) FLOOR_MOD_EXPR].name
00322 = "(floor %=)";
00323 assignment_operator_name_info [(int) ROUND_MOD_EXPR].name
00324 = "(round %=)";
00325 }
00326
00327
00328 struct resword
00329 {
00330 const char *const word;
00331 const ENUM_BITFIELD(rid) rid : 16;
00332 const unsigned int disable : 16;
00333 };
00334
00335
00336
00337 #define D_EXT 0x01
00338 #define D_ASM 0x02
00339
00340 #if defined(TARG_SL2)
00341
00342
00343 CONSTRAINT(ridbits_fit, RID_LAST_MODIFIER < sizeof(unsigned long long) * CHAR_BIT);
00344 #else
00345 CONSTRAINT(ridbits_fit, RID_LAST_MODIFIER < sizeof(unsigned long) * CHAR_BIT);
00346 #endif
00347
00348 static const struct resword reswords[] =
00349 {
00350 { "_Complex", RID_COMPLEX, 0 },
00351 { "__FUNCTION__", RID_FUNCTION_NAME, 0 },
00352 { "__PRETTY_FUNCTION__", RID_PRETTY_FUNCTION_NAME, 0 },
00353 { "__alignof", RID_ALIGNOF, 0 },
00354 { "__alignof__", RID_ALIGNOF, 0 },
00355 { "__asm", RID_ASM, 0 },
00356 { "__asm__", RID_ASM, 0 },
00357 { "__attribute", RID_ATTRIBUTE, 0 },
00358 { "__attribute__", RID_ATTRIBUTE, 0 },
00359 { "__builtin_va_arg", RID_VA_ARG, 0 },
00360 { "__complex", RID_COMPLEX, 0 },
00361 { "__complex__", RID_COMPLEX, 0 },
00362 { "__const", RID_CONST, 0 },
00363 { "__const__", RID_CONST, 0 },
00364 { "__extension__", RID_EXTENSION, 0 },
00365 { "__func__", RID_C99_FUNCTION_NAME, 0 },
00366 { "__imag", RID_IMAGPART, 0 },
00367 { "__imag__", RID_IMAGPART, 0 },
00368 { "__inline", RID_INLINE, 0 },
00369 { "__inline__", RID_INLINE, 0 },
00370 { "__label__", RID_LABEL, 0 },
00371 { "__null", RID_NULL, 0 },
00372 { "__offsetof", RID_OFFSETOF, 0 },
00373 { "__offsetof__", RID_OFFSETOF, 0 },
00374 { "__real", RID_REALPART, 0 },
00375 { "__real__", RID_REALPART, 0 },
00376 { "__restrict", RID_RESTRICT, 0 },
00377 { "__restrict__", RID_RESTRICT, 0 },
00378 #ifdef TARG_SL
00379 { "__sbuf", RID_SBUF, 0 },
00380 #endif
00381 { "__signed", RID_SIGNED, 0 },
00382 { "__signed__", RID_SIGNED, 0 },
00383 { "__thread", RID_THREAD, 0 },
00384 { "__typeof", RID_TYPEOF, 0 },
00385 { "__typeof__", RID_TYPEOF, 0 },
00386 #ifdef TARG_SL
00387 { "__v1buf", RID_V1BUF, 0 },
00388 { "__v2buf", RID_V2BUF, 0 },
00389 { "__v4buf", RID_V4BUF, 0 },
00390 #endif
00391 { "__volatile", RID_VOLATILE, 0 },
00392 { "__volatile__", RID_VOLATILE, 0 },
00393 { "asm", RID_ASM, D_ASM },
00394 { "auto", RID_AUTO, 0 },
00395 { "bool", RID_BOOL, 0 },
00396 { "break", RID_BREAK, 0 },
00397 { "case", RID_CASE, 0 },
00398 { "catch", RID_CATCH, 0 },
00399 { "char", RID_CHAR, 0 },
00400 { "class", RID_CLASS, 0 },
00401 { "const", RID_CONST, 0 },
00402 { "const_cast", RID_CONSTCAST, 0 },
00403 { "continue", RID_CONTINUE, 0 },
00404 { "default", RID_DEFAULT, 0 },
00405 { "delete", RID_DELETE, 0 },
00406 { "do", RID_DO, 0 },
00407 { "double", RID_DOUBLE, 0 },
00408 { "dynamic_cast", RID_DYNCAST, 0 },
00409 { "else", RID_ELSE, 0 },
00410 { "enum", RID_ENUM, 0 },
00411 { "explicit", RID_EXPLICIT, 0 },
00412 { "export", RID_EXPORT, 0 },
00413 { "extern", RID_EXTERN, 0 },
00414 { "false", RID_FALSE, 0 },
00415 { "float", RID_FLOAT, 0 },
00416 { "for", RID_FOR, 0 },
00417 { "friend", RID_FRIEND, 0 },
00418 { "goto", RID_GOTO, 0 },
00419 { "if", RID_IF, 0 },
00420 { "inline", RID_INLINE, 0 },
00421 { "int", RID_INT, 0 },
00422 { "long", RID_LONG, 0 },
00423 { "mutable", RID_MUTABLE, 0 },
00424 { "namespace", RID_NAMESPACE, 0 },
00425 { "new", RID_NEW, 0 },
00426 { "operator", RID_OPERATOR, 0 },
00427 { "private", RID_PRIVATE, 0 },
00428 { "protected", RID_PROTECTED, 0 },
00429 { "public", RID_PUBLIC, 0 },
00430 { "register", RID_REGISTER, 0 },
00431 { "reinterpret_cast", RID_REINTCAST, 0 },
00432 { "return", RID_RETURN, 0 },
00433 { "short", RID_SHORT, 0 },
00434 { "signed", RID_SIGNED, 0 },
00435 { "sizeof", RID_SIZEOF, 0 },
00436 { "static", RID_STATIC, 0 },
00437 { "static_cast", RID_STATCAST, 0 },
00438 { "struct", RID_STRUCT, 0 },
00439 { "switch", RID_SWITCH, 0 },
00440 { "template", RID_TEMPLATE, 0 },
00441 { "this", RID_THIS, 0 },
00442 { "throw", RID_THROW, 0 },
00443 { "true", RID_TRUE, 0 },
00444 { "try", RID_TRY, 0 },
00445 { "typedef", RID_TYPEDEF, 0 },
00446 { "typename", RID_TYPENAME, 0 },
00447 { "typeid", RID_TYPEID, 0 },
00448 { "typeof", RID_TYPEOF, D_ASM|D_EXT },
00449 { "union", RID_UNION, 0 },
00450 { "unsigned", RID_UNSIGNED, 0 },
00451 { "using", RID_USING, 0 },
00452 { "virtual", RID_VIRTUAL, 0 },
00453 { "void", RID_VOID, 0 },
00454 { "volatile", RID_VOLATILE, 0 },
00455 { "wchar_t", RID_WCHAR, 0 },
00456 { "while", RID_WHILE, 0 },
00457
00458 };
00459
00460
00461
00462
00463 const short rid_to_yy[RID_MAX] =
00464 {
00465 SCSPEC,
00466 TYPESPEC,
00467 TYPESPEC,
00468 CV_QUALIFIER,
00469 SCSPEC,
00470 SCSPEC,
00471 SCSPEC,
00472 TYPESPEC,
00473 SCSPEC,
00474 CV_QUALIFIER,
00475 TYPESPEC,
00476 SCSPEC,
00477 CV_QUALIFIER,
00478
00479 #if defined(TARG_SL)
00480 CV_QUALIFIER,
00481 CV_QUALIFIER,
00482 CV_QUALIFIER,
00483 CV_QUALIFIER,
00484 #endif
00485
00486 0,
00487 0,
00488 TYPESPEC,
00489 SCSPEC,
00490
00491 SCSPEC,
00492 SCSPEC,
00493 SCSPEC,
00494 EXPORT,
00495 SCSPEC,
00496
00497
00498 0,
00499 0,
00500 0,
00501 0,
00502 0,
00503 0,
00504
00505
00506 TYPESPEC,
00507 TYPESPEC,
00508 TYPESPEC,
00509 TYPESPEC,
00510 TYPESPEC,
00511 ENUM,
00512 AGGR,
00513 AGGR,
00514 IF,
00515 ELSE,
00516 WHILE,
00517 DO,
00518 FOR,
00519 SWITCH,
00520 CASE,
00521 DEFAULT,
00522 BREAK,
00523 CONTINUE,
00524 RETURN_KEYWORD,
00525 GOTO,
00526 SIZEOF,
00527
00528
00529 ASM_KEYWORD,
00530 TYPEOF,
00531 ALIGNOF,
00532 ATTRIBUTE,
00533 VA_ARG,
00534 EXTENSION,
00535 IMAGPART,
00536 REALPART,
00537 LABEL,
00538 0,
00539 0,
00540 0,
00541 0,
00542 0,
00543
00544 VAR_FUNC_NAME,
00545 VAR_FUNC_NAME,
00546 VAR_FUNC_NAME,
00547
00548
00549 TYPESPEC,
00550 TYPESPEC,
00551 AGGR,
00552 VISSPEC,
00553 VISSPEC,
00554 VISSPEC,
00555 TEMPLATE,
00556 CONSTANT,
00557 CATCH,
00558 DELETE,
00559 CXX_FALSE,
00560 NAMESPACE,
00561 NEW,
00562 OFFSETOF,
00563 OPERATOR,
00564 THIS,
00565 THROW,
00566 CXX_TRUE,
00567 TRY,
00568 TYPENAME_KEYWORD,
00569 TYPEID,
00570 USING,
00571
00572
00573 CONST_CAST,
00574 DYNAMIC_CAST,
00575 REINTERPRET_CAST,
00576 STATIC_CAST,
00577
00578
00579 0,
00580 0,
00581 0,
00582 0,
00583 0,
00584 0,
00585 0,
00586 0,
00587 0,
00588 0,
00589 0,
00590 0,
00591 0
00592 };
00593
00594 void
00595 init_reswords ()
00596 {
00597 unsigned int i;
00598 tree id;
00599 int mask = ((flag_no_asm ? D_ASM : 0)
00600 | (flag_no_gnu_keywords ? D_EXT : 0));
00601
00602
00603
00604
00605 ridpointers = (tree *) xcalloc ((int) RID_MAX, sizeof (tree));
00606 for (i = 0; i < ARRAY_SIZE (reswords); i++)
00607 {
00608 id = get_identifier (reswords[i].word);
00609 C_RID_CODE (id) = reswords[i].rid;
00610 ridpointers [(int) reswords[i].rid] = id;
00611 if (! (reswords[i].disable & mask))
00612 C_IS_RESERVED_WORD (id) = 1;
00613 }
00614 }
00615
00616 static void
00617 init_cp_pragma ()
00618 {
00619 cpp_register_pragma (parse_in, 0, "vtable", handle_pragma_vtable);
00620 cpp_register_pragma (parse_in, 0, "unit", handle_pragma_unit);
00621
00622 cpp_register_pragma (parse_in, 0, "interface", handle_pragma_interface);
00623 cpp_register_pragma (parse_in, 0, "implementation",
00624 handle_pragma_implementation);
00625
00626 cpp_register_pragma (parse_in, "GCC", "interface", handle_pragma_interface);
00627 cpp_register_pragma (parse_in, "GCC", "implementation",
00628 handle_pragma_implementation);
00629 cpp_register_pragma (parse_in, "GCC", "java_exceptions",
00630 handle_pragma_java_exceptions);
00631 }
00632
00633
00634
00635
00636
00637 const char *
00638 cxx_init (filename)
00639 const char *filename;
00640 {
00641 input_filename = "<internal>";
00642
00643 init_reswords ();
00644 init_spew ();
00645 init_tree ();
00646 init_cp_semantics ();
00647 init_operators ();
00648 init_method ();
00649 init_error ();
00650
00651 current_function_decl = NULL;
00652
00653 class_type_node = build_int_2 (class_type, 0);
00654 TREE_TYPE (class_type_node) = class_type_node;
00655 ridpointers[(int) RID_CLASS] = class_type_node;
00656
00657 record_type_node = build_int_2 (record_type, 0);
00658 TREE_TYPE (record_type_node) = record_type_node;
00659 ridpointers[(int) RID_STRUCT] = record_type_node;
00660
00661 union_type_node = build_int_2 (union_type, 0);
00662 TREE_TYPE (union_type_node) = union_type_node;
00663 ridpointers[(int) RID_UNION] = union_type_node;
00664
00665 enum_type_node = build_int_2 (enum_type, 0);
00666 TREE_TYPE (enum_type_node) = enum_type_node;
00667 ridpointers[(int) RID_ENUM] = enum_type_node;
00668
00669 cxx_init_decl_processing ();
00670
00671
00672 null_node = build_int_2 (0, 0);
00673 TREE_TYPE (null_node) = c_common_type_for_size (POINTER_SIZE, 0);
00674 ridpointers[RID_NULL] = null_node;
00675
00676 token_count = init_cpp_parse ();
00677 interface_unknown = 1;
00678
00679 filename = c_common_init (filename);
00680 if (filename == NULL)
00681 return NULL;
00682
00683 init_cp_pragma ();
00684
00685 init_repo (filename);
00686
00687 return filename;
00688 }
00689
00690 inline void
00691 yyprint (file, yychar, yylval)
00692 FILE *file;
00693 int yychar;
00694 YYSTYPE yylval;
00695 {
00696 tree t;
00697 switch (yychar)
00698 {
00699 case IDENTIFIER:
00700 case tTYPENAME:
00701 case TYPESPEC:
00702 case PTYPENAME:
00703 case PFUNCNAME:
00704 case IDENTIFIER_DEFN:
00705 case TYPENAME_DEFN:
00706 case PTYPENAME_DEFN:
00707 case SCSPEC:
00708 case PRE_PARSED_CLASS_DECL:
00709 t = yylval.ttype;
00710 if (TREE_CODE (t) == TYPE_DECL || TREE_CODE (t) == TEMPLATE_DECL)
00711 {
00712 fprintf (file, " `%s'", IDENTIFIER_POINTER (DECL_NAME (t)));
00713 break;
00714 }
00715 my_friendly_assert (TREE_CODE (t) == IDENTIFIER_NODE, 224);
00716 if (IDENTIFIER_POINTER (t))
00717 fprintf (file, " `%s'", IDENTIFIER_POINTER (t));
00718 break;
00719
00720 case AGGR:
00721 if (yylval.ttype == class_type_node)
00722 fprintf (file, " `class'");
00723 else if (yylval.ttype == record_type_node)
00724 fprintf (file, " `struct'");
00725 else if (yylval.ttype == union_type_node)
00726 fprintf (file, " `union'");
00727 else if (yylval.ttype == enum_type_node)
00728 fprintf (file, " `enum'");
00729 else
00730 abort ();
00731 break;
00732
00733 case CONSTANT:
00734 t = yylval.ttype;
00735 if (TREE_CODE (t) == INTEGER_CST)
00736 fprintf (file,
00737 #if HOST_BITS_PER_WIDE_INT == 64
00738 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_INT
00739 " 0x%x%016x",
00740 #else
00741 #if HOST_BITS_PER_WIDE_INT == HOST_BITS_PER_LONG
00742 " 0x%lx%016lx",
00743 #else
00744 " 0x%llx%016llx",
00745 #endif
00746 #endif
00747 #else
00748 #if HOST_BITS_PER_WIDE_INT != HOST_BITS_PER_INT
00749 " 0x%lx%08lx",
00750 #else
00751 " 0x%x%08x",
00752 #endif
00753 #endif
00754 TREE_INT_CST_HIGH (t), TREE_INT_CST_LOW (t));
00755 break;
00756 }
00757 }
00758
00759 #if defined(GATHER_STATISTICS) && defined(REDUCE_LENGTH)
00760 static int *reduce_count;
00761 #endif
00762
00763 int *token_count;
00764
00765 #if 0
00766 #define REDUCE_LENGTH ARRAY_SIZE (yyr2)
00767 #define TOKEN_LENGTH (256 + ARRAY_SIZE (yytname))
00768 #endif
00769
00770 #ifdef GATHER_STATISTICS
00771 #ifdef REDUCE_LENGTH
00772 void
00773 yyhook (yyn)
00774 int yyn;
00775 {
00776 reduce_count[yyn] += 1;
00777 }
00778
00779 static int
00780 reduce_cmp (p, q)
00781 int *p, *q;
00782 {
00783 return reduce_count[*q] - reduce_count[*p];
00784 }
00785
00786 static int
00787 token_cmp (p, q)
00788 int *p, *q;
00789 {
00790 return token_count[*q] - token_count[*p];
00791 }
00792 #endif
00793 #endif
00794
00795 void
00796 print_parse_statistics ()
00797 {
00798 #ifdef GATHER_STATISTICS
00799 #ifdef REDUCE_LENGTH
00800 #if YYDEBUG != 0
00801 int i;
00802 int maxlen = REDUCE_LENGTH;
00803 unsigned *sorted;
00804
00805 if (reduce_count[-1] == 0)
00806 return;
00807
00808 if (TOKEN_LENGTH > REDUCE_LENGTH)
00809 maxlen = TOKEN_LENGTH;
00810 sorted = (unsigned *) alloca (sizeof (int) * maxlen);
00811
00812 for (i = 0; i < TOKEN_LENGTH; i++)
00813 sorted[i] = i;
00814 qsort (sorted, TOKEN_LENGTH, sizeof (int), token_cmp);
00815 for (i = 0; i < TOKEN_LENGTH; i++)
00816 {
00817 int idx = sorted[i];
00818 if (token_count[idx] == 0)
00819 break;
00820 if (token_count[idx] < token_count[-1])
00821 break;
00822 fprintf (stderr, "token %d, `%s', count = %d\n",
00823 idx, yytname[YYTRANSLATE (idx)], token_count[idx]);
00824 }
00825 fprintf (stderr, "\n");
00826 for (i = 0; i < REDUCE_LENGTH; i++)
00827 sorted[i] = i;
00828 qsort (sorted, REDUCE_LENGTH, sizeof (int), reduce_cmp);
00829 for (i = 0; i < REDUCE_LENGTH; i++)
00830 {
00831 int idx = sorted[i];
00832 if (reduce_count[idx] == 0)
00833 break;
00834 if (reduce_count[idx] < reduce_count[-1])
00835 break;
00836 fprintf (stderr, "rule %d, line %d, count = %d\n",
00837 idx, yyrline[idx], reduce_count[idx]);
00838 }
00839 fprintf (stderr, "\n");
00840 #endif
00841 #endif
00842 #endif
00843 }
00844
00845
00846
00847
00848 void
00849 extract_interface_info ()
00850 {
00851 struct c_fileinfo *finfo = 0;
00852
00853 if (flag_alt_external_templates)
00854 {
00855 tree til = tinst_for_decl ();
00856
00857 if (til)
00858 finfo = get_fileinfo (TINST_FILE (til));
00859 }
00860 if (!finfo)
00861 finfo = get_fileinfo (input_filename);
00862
00863 interface_only = finfo->interface_only;
00864 interface_unknown = finfo->interface_unknown;
00865 }
00866
00867
00868
00869
00870 static int
00871 interface_strcmp (s)
00872 const char *s;
00873 {
00874
00875 struct impl_files *ifiles;
00876 const char *s1;
00877
00878 for (ifiles = impl_file_chain; ifiles; ifiles = ifiles->next)
00879 {
00880 const char *t1 = ifiles->filename;
00881 s1 = s;
00882
00883 if (*s1 != *t1 || *s1 == 0)
00884 continue;
00885
00886 while (*s1 == *t1 && *s1 != 0)
00887 s1++, t1++;
00888
00889
00890 if (*s1 == *t1)
00891 return 0;
00892
00893
00894 if (strchr (s1, '.') || strchr (t1, '.'))
00895 continue;
00896
00897 if (*s1 == '\0' || s1[-1] != '.' || t1[-1] != '.')
00898 continue;
00899
00900
00901 return 0;
00902 }
00903
00904
00905 return 1;
00906 }
00907
00908
00909
00910
00911
00912 void
00913 check_for_missing_semicolon (type)
00914 tree type;
00915 {
00916 if (yychar < 0)
00917 yychar = yylex ();
00918
00919 if ((yychar > 255
00920 && yychar != SCSPEC
00921 && yychar != IDENTIFIER
00922 && yychar != tTYPENAME
00923 && yychar != CV_QUALIFIER
00924 && yychar != SELFNAME)
00925 || yychar == 0 )
00926 {
00927 if (TYPE_ANONYMOUS_P (type))
00928 error ("semicolon missing after %s declaration",
00929 TREE_CODE (type) == ENUMERAL_TYPE ? "enum" : "struct");
00930 else
00931 error ("semicolon missing after declaration of `%T'", type);
00932 shadow_tag (build_tree_list (0, type));
00933 }
00934
00935 clear_anon_tags ();
00936 }
00937
00938 void
00939 note_got_semicolon (type)
00940 tree type;
00941 {
00942 if (!TYPE_P (type))
00943 abort ();
00944 if (CLASS_TYPE_P (type))
00945 CLASSTYPE_GOT_SEMICOLON (type) = 1;
00946 }
00947
00948 void
00949 note_list_got_semicolon (declspecs)
00950 tree declspecs;
00951 {
00952 tree link;
00953
00954 for (link = declspecs; link; link = TREE_CHAIN (link))
00955 {
00956 tree type = TREE_VALUE (link);
00957 if (type && TYPE_P (type))
00958 note_got_semicolon (type);
00959 }
00960 clear_anon_tags ();
00961 }
00962
00963
00964
00965
00966 static tree
00967 parse_strconst_pragma (name, opt)
00968 const char *name;
00969 int opt;
00970 {
00971 tree result, x;
00972 enum cpp_ttype t;
00973
00974 t = c_lex (&x);
00975 if (t == CPP_STRING)
00976 {
00977 result = x;
00978 if (c_lex (&x) != CPP_EOF)
00979 warning ("junk at end of #pragma %s", name);
00980 return result;
00981 }
00982
00983 if (t == CPP_EOF && opt)
00984 return 0;
00985
00986 error ("invalid #pragma %s", name);
00987 return (tree)-1;
00988 }
00989
00990 static void
00991 handle_pragma_vtable (dfile)
00992 cpp_reader *dfile ATTRIBUTE_UNUSED;
00993 {
00994 parse_strconst_pragma ("vtable", 0);
00995 sorry ("#pragma vtable no longer supported");
00996 }
00997
00998 static void
00999 handle_pragma_unit (dfile)
01000 cpp_reader *dfile ATTRIBUTE_UNUSED;
01001 {
01002
01003 parse_strconst_pragma ("unit", 0);
01004 }
01005
01006 static void
01007 handle_pragma_interface (dfile)
01008 cpp_reader *dfile ATTRIBUTE_UNUSED;
01009 {
01010 tree fname = parse_strconst_pragma ("interface", 1);
01011 struct c_fileinfo *finfo;
01012 const char *main_filename;
01013
01014 if (fname == (tree)-1)
01015 return;
01016 else if (fname == 0)
01017 main_filename = lbasename (input_filename);
01018 else
01019 main_filename = TREE_STRING_POINTER (fname);
01020
01021 finfo = get_fileinfo (input_filename);
01022
01023 if (impl_file_chain == 0)
01024 {
01025
01026
01027 if (main_input_filename == 0)
01028 main_input_filename = input_filename;
01029 }
01030
01031 interface_only = interface_strcmp (main_filename);
01032 #ifdef MULTIPLE_SYMBOL_SPACES
01033 if (! interface_only)
01034 #endif
01035 interface_unknown = 0;
01036
01037 finfo->interface_only = interface_only;
01038 finfo->interface_unknown = interface_unknown;
01039
01040 #ifdef KEY
01041 pragma_interface_seen = true;
01042 #endif
01043 }
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053 static void
01054 handle_pragma_implementation (dfile)
01055 cpp_reader *dfile ATTRIBUTE_UNUSED;
01056 {
01057 tree fname = parse_strconst_pragma ("implementation", 1);
01058 const char *main_filename;
01059 struct impl_files *ifiles = impl_file_chain;
01060
01061 if (fname == (tree)-1)
01062 return;
01063
01064 if (fname == 0)
01065 {
01066 if (main_input_filename)
01067 main_filename = main_input_filename;
01068 else
01069 main_filename = input_filename;
01070 main_filename = lbasename (main_filename);
01071 }
01072 else
01073 {
01074 main_filename = TREE_STRING_POINTER (fname);
01075 if (cpp_included (parse_in, main_filename))
01076 warning ("#pragma implementation for %s appears after file is included",
01077 main_filename);
01078 }
01079
01080 for (; ifiles; ifiles = ifiles->next)
01081 {
01082 if (! strcmp (ifiles->filename, main_filename))
01083 break;
01084 }
01085 if (ifiles == 0)
01086 {
01087 ifiles = (struct impl_files*) xmalloc (sizeof (struct impl_files));
01088 ifiles->filename = main_filename;
01089 ifiles->next = impl_file_chain;
01090 impl_file_chain = ifiles;
01091 }
01092
01093 #ifdef KEY
01094 pragma_implementation_seen = true;
01095 #endif
01096 }
01097
01098
01099 static void
01100 handle_pragma_java_exceptions (dfile)
01101 cpp_reader *dfile ATTRIBUTE_UNUSED;
01102 {
01103 tree x;
01104 if (c_lex (&x) != CPP_EOF)
01105 warning ("junk at end of #pragma GCC java_exceptions");
01106
01107 choose_personality_routine (lang_java);
01108 }
01109
01110 void
01111 do_pending_lang_change ()
01112 {
01113 for (; pending_lang_change > 0; --pending_lang_change)
01114 push_lang_context (lang_name_c);
01115 for (; pending_lang_change < 0; ++pending_lang_change)
01116 pop_lang_context ();
01117 }
01118
01119
01120
01121 static int
01122 is_global (d)
01123 tree d;
01124 {
01125 while (1)
01126 switch (TREE_CODE (d))
01127 {
01128 case ERROR_MARK:
01129 return 1;
01130
01131 case OVERLOAD: d = OVL_FUNCTION (d); continue;
01132 case TREE_LIST: d = TREE_VALUE (d); continue;
01133 default:
01134 my_friendly_assert (DECL_P (d), 980629);
01135
01136 return DECL_NAMESPACE_SCOPE_P (d);
01137 }
01138 }
01139
01140
01141
01142
01143 void
01144 unqualified_name_lookup_error (tree name)
01145 {
01146 if (IDENTIFIER_OPNAME_P (name))
01147 {
01148 if (name != ansi_opname (ERROR_MARK))
01149 error ("`%D' not defined", name);
01150 }
01151 else if (current_function_decl == 0)
01152 error ("`%D' was not declared in this scope", name);
01153 else
01154 {
01155 if (IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node
01156 || IDENTIFIER_ERROR_LOCUS (name) != current_function_decl)
01157 {
01158 static int undeclared_variable_notice;
01159
01160 error ("`%D' undeclared (first use this function)", name);
01161
01162 if (! undeclared_variable_notice)
01163 {
01164 error ("(Each undeclared identifier is reported only once for each function it appears in.)");
01165 undeclared_variable_notice = 1;
01166 }
01167 }
01168
01169 SET_IDENTIFIER_NAMESPACE_VALUE (name, error_mark_node);
01170 SET_IDENTIFIER_ERROR_LOCUS (name, current_function_decl);
01171 }
01172 }
01173
01174 tree
01175 do_identifier (token, parsing, args)
01176 register tree token;
01177 int parsing;
01178 tree args;
01179 {
01180 register tree id;
01181 int lexing = (parsing == 1 || parsing == 3);
01182
01183 timevar_push (TV_NAME_LOOKUP);
01184 if (! lexing)
01185 id = lookup_name (token, 0);
01186 else
01187 id = lastiddecl;
01188
01189 if (lexing && id && TREE_DEPRECATED (id))
01190 warn_deprecated_use (id);
01191
01192
01193
01194
01195
01196
01197
01198
01199 if (args && !current_template_parms && (!id || is_global (id)))
01200 id = lookup_arg_dependent (token, id, args);
01201
01202
01203
01204 if (id && parsing && parsing != 3)
01205 maybe_note_name_used_in_class (token, id);
01206
01207 if (id == error_mark_node)
01208 {
01209
01210
01211
01212
01213 id = lookup_name (token, 0);
01214 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
01215 }
01216
01217 if (!id || (TREE_CODE (id) == FUNCTION_DECL
01218 && DECL_ANTICIPATED (id)))
01219 {
01220 if (current_template_parms)
01221 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP,
01222 build_min_nt (LOOKUP_EXPR, token));
01223 else if (IDENTIFIER_TYPENAME_P (token))
01224
01225 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, token);
01226 else
01227 {
01228 unqualified_name_lookup_error (token);
01229 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
01230 }
01231 }
01232
01233 id = check_for_out_of_scope_variable (id);
01234
01235
01236 if (TREE_CODE (id) == CONST_DECL)
01237 {
01238
01239 if (IDENTIFIER_CLASS_VALUE (token) == id)
01240 enforce_access (CP_DECL_CONTEXT(id), id);
01241 if (!processing_template_decl || DECL_TEMPLATE_PARM_P (id))
01242 id = DECL_INITIAL (id);
01243 }
01244 else
01245 id = hack_identifier (id, token);
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255 if (current_template_parms
01256 && (is_overloaded_fn (id)
01257 || (TREE_CODE (id) == VAR_DECL
01258 && CP_DECL_CONTEXT (id)
01259 && TREE_CODE (CP_DECL_CONTEXT (id)) == FUNCTION_DECL)
01260 || TREE_CODE (id) == PARM_DECL
01261 || TREE_CODE (id) == RESULT_DECL
01262 || TREE_CODE (id) == USING_DECL))
01263 id = build_min_nt (LOOKUP_EXPR, token);
01264
01265 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
01266 }
01267
01268 tree
01269 do_scoped_id (token, id)
01270 tree token;
01271 tree id;
01272 {
01273 timevar_push (TV_NAME_LOOKUP);
01274 if (!id || (TREE_CODE (id) == FUNCTION_DECL
01275 && DECL_ANTICIPATED (id)))
01276 {
01277 if (processing_template_decl)
01278 {
01279 id = build_min_nt (LOOKUP_EXPR, token);
01280 LOOKUP_EXPR_GLOBAL (id) = 1;
01281 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
01282 }
01283 if (IDENTIFIER_NAMESPACE_VALUE (token) != error_mark_node)
01284 error ("`::%D' undeclared (first use here)", token);
01285 id = error_mark_node;
01286
01287 SET_IDENTIFIER_NAMESPACE_VALUE (token, error_mark_node);
01288 }
01289 else
01290 {
01291 if (TREE_CODE (id) == ADDR_EXPR)
01292 mark_used (TREE_OPERAND (id, 0));
01293 else if (TREE_CODE (id) != OVERLOAD)
01294 mark_used (id);
01295 }
01296 if (TREE_CODE (id) == CONST_DECL && ! processing_template_decl)
01297 {
01298
01299 id = DECL_INITIAL (id);
01300
01301
01302 id = build1 (NOP_EXPR, TREE_TYPE (id), id);
01303 TREE_CONSTANT (id) = 1;
01304 }
01305
01306 if (processing_template_decl)
01307 {
01308 if (is_overloaded_fn (id))
01309 {
01310 id = build_min_nt (LOOKUP_EXPR, token);
01311 LOOKUP_EXPR_GLOBAL (id) = 1;
01312 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, id);
01313 }
01314
01315 }
01316 POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, convert_from_reference (id));
01317 }
01318
01319 tree
01320 identifier_typedecl_value (node)
01321 tree node;
01322 {
01323 tree t, type;
01324 type = IDENTIFIER_TYPE_VALUE (node);
01325 if (type == NULL_TREE)
01326 return NULL_TREE;
01327
01328 if (IDENTIFIER_BINDING (node))
01329 {
01330 t = IDENTIFIER_VALUE (node);
01331 if (t && TREE_CODE (t) == TYPE_DECL && TREE_TYPE (t) == type)
01332 return t;
01333 }
01334 if (IDENTIFIER_NAMESPACE_VALUE (node))
01335 {
01336 t = IDENTIFIER_NAMESPACE_VALUE (node);
01337 if (t && TREE_CODE (t) == TYPE_DECL && TREE_TYPE (t) == type)
01338 return t;
01339 }
01340
01341
01342 if (TYPE_MAIN_DECL (type))
01343 return TYPE_MAIN_DECL (type);
01344
01345
01346
01347 return NULL_TREE;
01348 }
01349
01350 #ifdef GATHER_STATISTICS
01351
01352
01353
01354
01355 typedef enum
01356 {
01357 d_kind,
01358 t_kind,
01359 b_kind,
01360 s_kind,
01361 r_kind,
01362 e_kind,
01363 c_kind,
01364 id_kind,
01365 op_id_kind,
01366 perm_list_kind,
01367 temp_list_kind,
01368 vec_kind,
01369 x_kind,
01370 lang_decl,
01371 lang_type,
01372 all_kinds
01373 } tree_node_kind;
01374
01375 extern int tree_node_counts[];
01376 extern int tree_node_sizes[];
01377 #endif
01378
01379 tree
01380 build_lang_decl (code, name, type)
01381 enum tree_code code;
01382 tree name;
01383 tree type;
01384 {
01385 tree t;
01386
01387 t = build_decl (code, name, type);
01388 retrofit_lang_decl (t);
01389
01390 return t;
01391 }
01392
01393
01394
01395
01396 void
01397 retrofit_lang_decl (t)
01398 tree t;
01399 {
01400 struct lang_decl *ld;
01401 size_t size;
01402
01403 if (CAN_HAVE_FULL_LANG_DECL_P (t))
01404 size = sizeof (struct lang_decl);
01405 else
01406 size = sizeof (struct lang_decl_flags);
01407
01408 ld = (struct lang_decl *) ggc_alloc_cleared (size);
01409
01410 ld->decl_flags.can_be_full = CAN_HAVE_FULL_LANG_DECL_P (t) ? 1 : 0;
01411 ld->decl_flags.u1sel = TREE_CODE (t) == NAMESPACE_DECL ? 1 : 0;
01412 ld->decl_flags.u2sel = 0;
01413 if (ld->decl_flags.can_be_full)
01414 ld->u.f.u3sel = TREE_CODE (t) == FUNCTION_DECL ? 1 : 0;
01415
01416 DECL_LANG_SPECIFIC (t) = ld;
01417 if (current_lang_name == lang_name_cplusplus)
01418 SET_DECL_LANGUAGE (t, lang_cplusplus);
01419 else if (current_lang_name == lang_name_c)
01420 SET_DECL_LANGUAGE (t, lang_c);
01421 else if (current_lang_name == lang_name_java)
01422 SET_DECL_LANGUAGE (t, lang_java);
01423 else abort ();
01424
01425 #ifdef GATHER_STATISTICS
01426 tree_node_counts[(int)lang_decl] += 1;
01427 tree_node_sizes[(int)lang_decl] += size;
01428 #endif
01429 }
01430
01431 void
01432 cxx_dup_lang_specific_decl (node)
01433 tree node;
01434 {
01435 int size;
01436 struct lang_decl *ld;
01437
01438 if (! DECL_LANG_SPECIFIC (node))
01439 return;
01440
01441 if (!CAN_HAVE_FULL_LANG_DECL_P (node))
01442 size = sizeof (struct lang_decl_flags);
01443 else
01444 size = sizeof (struct lang_decl);
01445 ld = (struct lang_decl *) ggc_alloc (size);
01446 memcpy (ld, DECL_LANG_SPECIFIC (node), size);
01447 DECL_LANG_SPECIFIC (node) = ld;
01448
01449 #ifdef GATHER_STATISTICS
01450 tree_node_counts[(int)lang_decl] += 1;
01451 tree_node_sizes[(int)lang_decl] += size;
01452 #endif
01453 }
01454
01455
01456
01457 tree
01458 copy_decl (decl)
01459 tree decl;
01460 {
01461 tree copy;
01462
01463 copy = copy_node (decl);
01464 cxx_dup_lang_specific_decl (copy);
01465 return copy;
01466 }
01467
01468
01469
01470 static void
01471 copy_lang_type (node)
01472 tree node;
01473 {
01474 int size;
01475 struct lang_type *lt;
01476
01477 if (! TYPE_LANG_SPECIFIC (node))
01478 return;
01479
01480 if (TYPE_LANG_SPECIFIC (node)->u.h.is_lang_type_class)
01481 size = sizeof (struct lang_type);
01482 else
01483 size = sizeof (struct lang_type_ptrmem);
01484 lt = (struct lang_type *) ggc_alloc (size);
01485 memcpy (lt, TYPE_LANG_SPECIFIC (node), size);
01486 TYPE_LANG_SPECIFIC (node) = lt;
01487
01488 #ifdef GATHER_STATISTICS
01489 tree_node_counts[(int)lang_type] += 1;
01490 tree_node_sizes[(int)lang_type] += size;
01491 #endif
01492 }
01493
01494
01495
01496 tree
01497 copy_type (type)
01498 tree type;
01499 {
01500 tree copy;
01501
01502 copy = copy_node (type);
01503 copy_lang_type (copy);
01504 return copy;
01505 }
01506
01507 tree
01508 cxx_make_type (code)
01509 enum tree_code code;
01510 {
01511 register tree t = make_node (code);
01512
01513
01514 if (IS_AGGR_TYPE_CODE (code)
01515 || code == BOUND_TEMPLATE_TEMPLATE_PARM)
01516 {
01517 struct lang_type *pi;
01518
01519 pi = ((struct lang_type *)
01520 ggc_alloc_cleared (sizeof (struct lang_type)));
01521
01522 TYPE_LANG_SPECIFIC (t) = pi;
01523 pi->u.c.h.is_lang_type_class = 1;
01524
01525 #ifdef GATHER_STATISTICS
01526 tree_node_counts[(int)lang_type] += 1;
01527 tree_node_sizes[(int)lang_type] += sizeof (struct lang_type);
01528 #endif
01529 }
01530
01531
01532 if (IS_AGGR_TYPE_CODE (code))
01533 {
01534 SET_CLASSTYPE_INTERFACE_UNKNOWN_X (t, interface_unknown);
01535 CLASSTYPE_INTERFACE_ONLY (t) = interface_only;
01536
01537
01538
01539
01540 build_pointer_type (t);
01541 }
01542 else
01543
01544
01545
01546 TYPE_ALIAS_SET (t) = 0;
01547
01548
01549
01550
01551
01552 if (IS_AGGR_TYPE_CODE (code) || code == TEMPLATE_TYPE_PARM
01553 || code == BOUND_TEMPLATE_TEMPLATE_PARM
01554 || code == TYPENAME_TYPE)
01555 TYPE_BINFO (t) = make_binfo (size_zero_node, t, NULL_TREE, NULL_TREE);
01556
01557 return t;
01558 }
01559
01560 tree
01561 make_aggr_type (code)
01562 enum tree_code code;
01563 {
01564 tree t = cxx_make_type (code);
01565
01566 if (IS_AGGR_TYPE_CODE (code))
01567 SET_IS_AGGR_TYPE (t, 1);
01568
01569 return t;
01570 }
01571
01572
01573
01574
01575 int
01576 cp_type_qual_from_rid (rid)
01577 tree rid;
01578 {
01579 if (rid == ridpointers[(int) RID_CONST])
01580 return TYPE_QUAL_CONST;
01581 else if (rid == ridpointers[(int) RID_VOLATILE])
01582 return TYPE_QUAL_VOLATILE;
01583 else if (rid == ridpointers[(int) RID_RESTRICT])
01584 return TYPE_QUAL_RESTRICT;
01585
01586 abort ();
01587 return TYPE_UNQUALIFIED;
01588 }