Changeset 1394 for trunk/src/gcc/gcc/cp/semantics.c
- Timestamp:
- Apr 28, 2004, 6:58:06 AM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gcc/gcc/cp/semantics.c
-
Property cvs2svn:cvs-rev
changed from
1.2
to1.3
r1393 r1394 57 57 static void genrtl_eh_spec_block PARAMS ((tree)); 58 58 static void genrtl_handler PARAMS ((tree)); 59 static void genrtl_ctor_stmt PARAMS ((tree));60 static void genrtl_subobject PARAMS ((tree));61 59 static void genrtl_named_return_value PARAMS ((void)); 62 60 static void cp_expand_stmt PARAMS ((tree)); … … 82 80 } while (0) 83 81 84 /* Returns non -zero if the current statement is a full expression,82 /* Returns nonzero if the current statement is a full expression, 85 83 i.e. temporaries created during that statement should be destroyed 86 84 at the end of the statement. */ … … 100 98 { 101 99 return (cfun 102 ? &cfun->language-> x_stmt_tree100 ? &cfun->language->base.x_stmt_tree 103 101 : &scope_chain->x_stmt_tree); 104 102 } … … 112 110 tree node; 113 111 { 114 return (CLASS_TYPE_P (node) && TYPE_LANG_SPECIFIC(node)->anon_aggr);112 return ANON_AGGR_TYPE_P (node); 115 113 } 116 114 … … 269 267 { 270 268 RECHAIN_STMTS (if_stmt, THEN_CLAUSE (if_stmt)); 271 last_tree = if_stmt;272 269 return if_stmt; 273 270 } … … 295 292 finish_if_stmt () 296 293 { 294 finish_stmt (); 297 295 do_poplevel (); 298 finish_stmt ();299 }300 301 void302 clear_out_block ()303 {304 /* If COND wasn't a declaration, clear out the305 block we made for it and start a new one here so the306 optimization in expand_end_loop will work. */307 if (getdecls () == NULL_TREE)308 {309 do_poplevel ();310 do_pushlevel ();311 }312 296 } 313 297 … … 334 318 { 335 319 cond = maybe_convert_cond (cond); 336 FINISH_COND (cond, while_stmt, WHILE_COND (while_stmt)); 337 clear_out_block (); 320 if (processing_template_decl) 321 /* Don't mess with condition decls in a template. */ 322 FINISH_COND (cond, while_stmt, WHILE_COND (while_stmt)); 323 else if (getdecls () == NULL_TREE) 324 /* It was a simple condition; install it. */ 325 WHILE_COND (while_stmt) = cond; 326 else 327 { 328 /* If there was a declaration in the condition, we can't leave it 329 there; transform 330 while (A x = 42) { } 331 to 332 while (true) { A x = 42; if (!x) break; } */ 333 tree if_stmt; 334 WHILE_COND (while_stmt) = boolean_true_node; 335 336 if_stmt = begin_if_stmt (); 337 cond = build_unary_op (TRUTH_NOT_EXPR, cond, 0); 338 finish_if_stmt_cond (cond, if_stmt); 339 finish_break_stmt (); 340 finish_then_clause (if_stmt); 341 finish_if_stmt (); 342 } 338 343 } 339 344 … … 420 425 NULL_TREE, NULL_TREE); 421 426 NEW_FOR_SCOPE_P (r) = flag_new_for_scope > 0; 422 add_stmt (r);423 427 if (NEW_FOR_SCOPE_P (r)) 424 428 { … … 426 430 note_level_for_for (); 427 431 } 432 add_stmt (r); 428 433 429 434 return r; … … 451 456 { 452 457 cond = maybe_convert_cond (cond); 453 FINISH_COND (cond, for_stmt, FOR_COND (for_stmt)); 454 clear_out_block (); 458 if (processing_template_decl) 459 /* Don't mess with condition decls in a template. */ 460 FINISH_COND (cond, for_stmt, FOR_COND (for_stmt)); 461 else if (getdecls () == NULL_TREE) 462 /* It was a simple condition; install it. */ 463 FOR_COND (for_stmt) = cond; 464 else 465 { 466 /* If there was a declaration in the condition, we can't leave it 467 there; transform 468 for (; A x = 42;) { } 469 to 470 for (;;) { A x = 42; if (!x) break; } */ 471 tree if_stmt; 472 FOR_COND (for_stmt) = NULL_TREE; 473 474 if_stmt = begin_if_stmt (); 475 cond = build_unary_op (TRUTH_NOT_EXPR, cond, 0); 476 finish_if_stmt_cond (cond, if_stmt); 477 finish_break_stmt (); 478 finish_then_clause (if_stmt); 479 finish_if_stmt (); 480 } 455 481 } 456 482 … … 505 531 { 506 532 tree r; 533 do_pushlevel (); 507 534 r = build_stmt (SWITCH_STMT, NULL_TREE, NULL_TREE, NULL_TREE); 508 535 add_stmt (r); 509 do_pushlevel ();510 536 return r; 511 537 } … … 563 589 RECHAIN_STMTS (switch_stmt, SWITCH_BODY (switch_stmt)); 564 590 pop_switch (); 591 finish_stmt (); 565 592 do_poplevel (); 566 finish_stmt (); 567 } 568 569 /* Generate the RTL for T, which is a TRY_BLOCK. */ 593 } 594 595 /* Generate the RTL for T, which is a TRY_BLOCK. */ 570 596 571 597 static void … … 604 630 } 605 631 606 /* Generate the RTL for T, which is an EH_SPEC_BLOCK. */632 /* Generate the RTL for T, which is an EH_SPEC_BLOCK. */ 607 633 608 634 static void … … 713 739 } 714 740 715 /* Generate the RTL for T, which is a HANDLER. */741 /* Generate the RTL for T, which is a HANDLER. */ 716 742 717 743 static void … … 782 808 } 783 809 784 /* Generate the RTL for T, which is a CTOR_STMT. */ 785 786 static void 787 genrtl_ctor_stmt (t) 788 tree t; 789 { 790 if (CTOR_BEGIN_P (t)) 791 begin_protect_partials (); 792 else 793 /* After this point, any exceptions will cause the 794 destructor to be executed, so we no longer need to worry 795 about destroying the various subobjects ourselves. */ 796 end_protect_partials (); 797 } 798 799 /* Begin a compound-statement. If HAS_NO_SCOPE is non-zero, the 810 /* Begin a compound-statement. If HAS_NO_SCOPE is nonzero, the 800 811 compound-statement does not define a scope. Returns a new 801 812 COMPOUND_STMT if appropriate. */ … … 836 847 837 848 /* Finish a compound-statement, which may be given by COMPOUND_STMT. 838 If HAS_NO_SCOPE is non -zero, the compound statement does not define849 If HAS_NO_SCOPE is nonzero, the compound statement does not define 839 850 a scope. */ 840 851 … … 880 891 tree r; 881 892 tree t; 882 883 if (TREE_CHAIN (string))884 string = combine_strings (string);885 893 886 894 if (cv_qualifier != NULL_TREE … … 928 936 929 937 constraint = TREE_STRING_POINTER (TREE_VALUE (TREE_PURPOSE (t))); 930 operand = TREE_VALUE ( output_operands);938 operand = TREE_VALUE (t); 931 939 932 940 if (!parse_output_constraint (&constraint, … … 949 957 point. */ 950 958 if (!allows_reg && DECL_P (operand)) 951 mark_addressable (operand);959 cxx_mark_addressable (operand); 952 960 } 953 961 } … … 981 989 } 982 990 983 /* Generate the RTL for a SUBOBJECT. */984 985 static void986 genrtl_subobject (cleanup)987 tree cleanup;988 {989 add_partial_entry (cleanup);990 }991 992 /* We're in a constructor, and have just constructed a a subobject of993 *THIS. CLEANUP is code to run if an exception is thrown before the994 end of the current function is reached. */995 996 void997 finish_subobject (cleanup)998 tree cleanup;999 {1000 tree r = build_stmt (SUBOBJECT, cleanup);1001 add_stmt (r);1002 }1003 1004 991 /* When DECL goes out of scope, make sure that CLEANUP is executed. */ 1005 992 … … 1012 999 } 1013 1000 1014 /* Generate the RTL for a RETURN_INIT. */ 1001 /* If the current scope exits with an exception, run CLEANUP. */ 1002 1003 void 1004 finish_eh_cleanup (cleanup) 1005 tree cleanup; 1006 { 1007 tree r = build_stmt (CLEANUP_STMT, NULL_TREE, cleanup); 1008 CLEANUP_EH_ONLY (r) = 1; 1009 add_stmt (r); 1010 } 1011 1012 /* Generate the RTL for a RETURN_INIT. */ 1015 1013 1016 1014 static void … … 1032 1030 SET_DECL_RTL (decl, gen_reg_rtx (GET_MODE (DECL_RTL (decl)))); 1033 1031 if (TREE_ADDRESSABLE (decl)) 1034 put_var_into_stack (decl );1032 put_var_into_stack (decl, /*rescan=*/true); 1035 1033 } 1036 1034 … … 1094 1092 } 1095 1093 1096 /* The INIT_LIST is a list of mem-initializers, in the order they were 1097 written by the user. The TREE_VALUE of each node is a list of 1098 initializers for a particular subobject. The TREE_PURPOSE is a 1099 FIELD_DECL is the initializer is for a non-static data member, and 1100 a class type if the initializer is for a base class. */ 1101 1102 void 1103 finish_mem_initializers (init_list) 1104 tree init_list; 1105 { 1106 tree member_init_list; 1107 tree base_init_list; 1108 tree last_base_warned_about; 1109 tree next; 1110 tree init; 1111 1112 member_init_list = NULL_TREE; 1113 base_init_list = NULL_TREE; 1114 last_base_warned_about = NULL_TREE; 1115 1116 for (init = init_list; init; init = next) 1117 { 1118 next = TREE_CHAIN (init); 1119 if (TREE_CODE (TREE_PURPOSE (init)) == FIELD_DECL) 1120 { 1121 TREE_CHAIN (init) = member_init_list; 1122 member_init_list = init; 1123 1124 /* We're running through the initializers from right to left 1125 as we process them here. So, if we see a data member 1126 initializer after we see a base initializer, that 1127 actually means that the base initializer preceded the 1128 data member initializer. */ 1129 if (warn_reorder && last_base_warned_about != base_init_list) 1130 { 1131 tree base; 1132 1133 for (base = base_init_list; 1134 base != last_base_warned_about; 1135 base = TREE_CHAIN (base)) 1136 { 1137 warning ("base initializer for `%T'", 1138 TREE_PURPOSE (base)); 1139 warning (" will be re-ordered to precede member initializations"); 1140 } 1141 1142 last_base_warned_about = base_init_list; 1143 } 1144 } 1145 else 1146 { 1147 TREE_CHAIN (init) = base_init_list; 1148 base_init_list = init; 1149 } 1150 } 1094 /* Begin processing a mem-initializer-list. */ 1095 1096 void 1097 begin_mem_initializers () 1098 { 1099 if (! DECL_CONSTRUCTOR_P (current_function_decl)) 1100 error ("only constructors take base initializers"); 1101 } 1102 1103 /* The MEM_INITS is a list of mem-initializers, in reverse of the 1104 order they were written by the user. Each node is as for 1105 emit_mem_initializers. */ 1106 1107 void 1108 finish_mem_initializers (tree mem_inits) 1109 { 1110 /* Reorder the MEM_INITS so that they are in the order they appeared 1111 in the source program. */ 1112 mem_inits = nreverse (mem_inits); 1151 1113 1152 1114 if (processing_template_decl) 1153 add_stmt (build_min_nt (CTOR_INITIALIZER, 1154 member_init_list, base_init_list)); 1115 add_stmt (build_min_nt (CTOR_INITIALIZER, mem_inits)); 1155 1116 else 1156 emit_ base_init (member_init_list, base_init_list);1117 emit_mem_initializers (mem_inits); 1157 1118 } 1158 1119 … … 1162 1123 current_scope_stmt_stack () 1163 1124 { 1164 return &cfun->language-> x_scope_stmt_stack;1125 return &cfun->language->base.x_scope_stmt_stack; 1165 1126 } 1166 1127 … … 1172 1133 { 1173 1134 if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (expr)))) 1174 /* This inhibits warnings in truthvalue_conversion. */1135 /* This inhibits warnings in c_common_truthvalue_conversion. */ 1175 1136 C_SET_EXP_ORIGINAL_CODE (expr, ERROR_MARK); 1176 1137 … … 1264 1225 } 1265 1226 1266 /* Finish a call to FN with ARGS. Returns a representation of the 1267 call. */ 1227 /* Generate an expression for `FN (ARGS)'. 1228 1229 If DISALLOW_VIRTUAL is true, the call to FN will be not generated 1230 as a virtual call, even if FN is virtual. (This flag is set when 1231 encountering an expression where the function name is explicitly 1232 qualified. For example a call to `X::f' never generates a virtual 1233 call.) 1234 1235 Returns code for the call. */ 1268 1236 1269 1237 tree 1270 finish_call_expr (fn, args, koenig) 1271 tree fn; 1272 tree args; 1273 int koenig; 1274 { 1275 tree result; 1276 1277 if (koenig) 1278 { 1279 if (TREE_CODE (fn) == BIT_NOT_EXPR) 1280 fn = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND (fn, 0)); 1281 else if (TREE_CODE (fn) != TEMPLATE_ID_EXPR) 1282 fn = do_identifier (fn, 2, args); 1283 } 1284 result = build_x_function_call (fn, args, current_class_ref); 1285 1286 if (TREE_CODE (result) == CALL_EXPR 1287 && (! TREE_TYPE (result) 1288 || TREE_CODE (TREE_TYPE (result)) != VOID_TYPE)) 1289 result = require_complete_type (result); 1290 1291 return result; 1238 finish_call_expr (tree fn, tree args, bool disallow_virtual) 1239 { 1240 if (fn == error_mark_node || args == error_mark_node) 1241 return error_mark_node; 1242 1243 if (processing_template_decl) 1244 return build_nt (CALL_EXPR, fn, args, NULL_TREE); 1245 1246 /* ARGS should be a list of arguments. */ 1247 my_friendly_assert (!args || TREE_CODE (args) == TREE_LIST, 1248 20020712); 1249 1250 if (BASELINK_P (fn)) 1251 { 1252 tree object; 1253 1254 /* A call to a member function. From [over.call.func]: 1255 1256 If the keyword this is in scope and refers to the class of 1257 that member function, or a derived class thereof, then the 1258 function call is transformed into a qualified function call 1259 using (*this) as the postfix-expression to the left of the 1260 . operator.... [Otherwise] a contrived object of type T 1261 becomes the implied object argument. 1262 1263 This paragraph is unclear about this situation: 1264 1265 struct A { void f(); }; 1266 struct B : public A {}; 1267 struct C : public A { void g() { B::f(); }}; 1268 1269 In particular, for `B::f', this paragraph does not make clear 1270 whether "the class of that member function" refers to `A' or 1271 to `B'. We believe it refers to `B'. */ 1272 if (current_class_type 1273 && DERIVED_FROM_P (BINFO_TYPE (BASELINK_ACCESS_BINFO (fn)), 1274 current_class_type) 1275 && current_class_ref) 1276 object = maybe_dummy_object (BINFO_TYPE (BASELINK_ACCESS_BINFO (fn)), 1277 NULL); 1278 else 1279 { 1280 tree representative_fn; 1281 1282 representative_fn = BASELINK_FUNCTIONS (fn); 1283 if (TREE_CODE (representative_fn) == TEMPLATE_ID_EXPR) 1284 representative_fn = TREE_OPERAND (representative_fn, 0); 1285 representative_fn = get_first_fn (representative_fn); 1286 object = build_dummy_object (DECL_CONTEXT (representative_fn)); 1287 } 1288 1289 return build_new_method_call (object, fn, args, NULL_TREE, 1290 (disallow_virtual 1291 ? LOOKUP_NONVIRTUAL : 0)); 1292 } 1293 else if (is_overloaded_fn (fn)) 1294 /* A call to a namespace-scope function. */ 1295 return build_new_function_call (fn, args); 1296 else if (CLASS_TYPE_P (TREE_TYPE (fn))) 1297 { 1298 /* If the "function" is really an object of class type, it might 1299 have an overloaded `operator ()'. */ 1300 tree result; 1301 result = build_opfncall (CALL_EXPR, LOOKUP_NORMAL, fn, args, NULL_TREE); 1302 if (result) 1303 return result; 1304 } 1305 1306 /* A call where the function is unknown. */ 1307 return build_function_call (fn, args); 1292 1308 } 1293 1309 … … 1349 1365 tree args; 1350 1366 { 1351 #if 01352 /* This is a future direction of this code, but because1353 build_x_function_call cannot always undo what is done in1354 build_component_ref entirely yet, we cannot do this. */1355 1356 tree real_fn = build_component_ref (object, fn, NULL_TREE, 1);1357 return finish_call_expr (real_fn, args);1358 #else1359 1367 if (DECL_DECLARES_TYPE_P (fn)) 1360 1368 { … … 1375 1383 } 1376 1384 } 1377 1378 return build_method_call (object, fn, args, NULL_TREE, LOOKUP_NORMAL); 1379 #endif 1385 1386 if (processing_template_decl || name_p (fn)) 1387 return build_method_call (object, fn, args, NULL_TREE, LOOKUP_NORMAL); 1388 else 1389 return build_new_method_call (object, fn, args, NULL_TREE, LOOKUP_NORMAL); 1380 1390 } 1381 1391 … … 1416 1426 1417 1427 return cp_convert (void_type_node, object); 1418 }1419 1420 /* Finish a call to a globally qualified member function FN using1421 ARGS. Returns an expression for the call. */1422 1423 tree1424 finish_qualified_call_expr (fn, args)1425 tree fn;1426 tree args;1427 {1428 if (processing_template_decl)1429 return build_min_nt (CALL_EXPR, fn, args, NULL_TREE);1430 else1431 return build_member_call (TREE_OPERAND (fn, 0),1432 TREE_OPERAND (fn, 1),1433 args);1434 1428 } 1435 1429 … … 1468 1462 } 1469 1463 1464 /* Return the declaration for the function-name variable indicated by 1465 ID. */ 1466 1467 tree 1468 finish_fname (tree id) 1469 { 1470 tree decl; 1471 1472 decl = fname_decl (C_RID_CODE (id), id); 1473 if (processing_template_decl) 1474 decl = build_min_nt (LOOKUP_EXPR, DECL_NAME (decl)); 1475 return decl; 1476 } 1477 1470 1478 static tree current_type_lookups; 1471 1479 … … 1525 1533 } 1526 1534 1527 /* Begin a function definition declared with DECL_SPECS and1528 DECLARATOR. Returns non-zero if the function-declaration is1529 legal. */1535 /* Begin a function definition declared with DECL_SPECS, ATTRIBUTES, 1536 and DECLARATOR. Returns nonzero if the function-declaration is 1537 valid. */ 1530 1538 1531 1539 int 1532 begin_function_definition (decl_specs, declarator)1540 begin_function_definition (decl_specs, attributes, declarator) 1533 1541 tree decl_specs; 1542 tree attributes; 1534 1543 tree declarator; 1535 1544 { 1536 tree specs; 1537 tree attrs; 1538 1539 split_specs_attrs (decl_specs, &specs, &attrs); 1540 if (!start_function (specs, declarator, attrs, SF_DEFAULT)) 1545 if (!start_function (decl_specs, declarator, attributes, SF_DEFAULT)) 1541 1546 return 0; 1542 1547 … … 1590 1595 pop_namespace (); 1591 1596 1592 /* Do file scope __FUNCTION__ et al. */1597 /* Do file scope __FUNCTION__ et al. */ 1593 1598 finish_fname_decls (); 1594 1599 … … 1633 1638 } 1634 1639 1640 /* ARGUMENT is the default-argument value for a template template 1641 parameter. If ARGUMENT is invalid, issue error messages and return 1642 the ERROR_MARK_NODE. Otherwise, ARGUMENT itself is returned. */ 1643 1644 tree 1645 check_template_template_default_arg (tree argument) 1646 { 1647 if (TREE_CODE (argument) != TEMPLATE_DECL 1648 && TREE_CODE (argument) != TEMPLATE_TEMPLATE_PARM 1649 && TREE_CODE (argument) != TYPE_DECL 1650 && TREE_CODE (argument) != UNBOUND_CLASS_TEMPLATE) 1651 { 1652 error ("invalid default template argument"); 1653 return error_mark_node; 1654 } 1655 1656 return argument; 1657 } 1658 1635 1659 /* Finish a parameter list, indicated by PARMS. If ELLIPSIS is 1636 non -zero, the parameter list was terminated by a `...'. */1660 nonzero, the parameter list was terminated by a `...'. */ 1637 1661 1638 1662 tree … … 1662 1686 return error_mark_node; 1663 1687 1664 /* Check the bases are accessible. */1688 /* Check the bases are accessible. */ 1665 1689 decl_type_access_control (TYPE_NAME (t)); 1666 1690 reset_type_access_control (); … … 1732 1756 TYPE_FIELDS (t) = NULL_TREE; 1733 1757 TYPE_METHODS (t) = NULL_TREE; 1734 CLASSTYPE_TAGS (t) = NULL_TREE; 1758 CLASSTYPE_DECL_LIST (t) = NULL_TREE; 1759 CLASSTYPE_NESTED_UDTS (t) = NULL; 1735 1760 CLASSTYPE_VBASECLASSES (t) = NULL_TREE; 1736 1761 TYPE_SIZE (t) = NULL_TREE; … … 1825 1850 TREE_CHAIN (decl) = TYPE_METHODS (current_class_type); 1826 1851 TYPE_METHODS (current_class_type) = decl; 1827 } 1828 else 1852 1853 maybe_add_class_template_decl_list (current_class_type, decl, 1854 /*friend_p=*/0); 1855 } 1856 /* Enter the DECL into the scope of the class. */ 1857 else if (TREE_CODE (decl) == USING_DECL || pushdecl_class_level (decl)) 1829 1858 { 1830 1859 /* All TYPE_DECLs go at the end of TYPE_FIELDS. Ordinary fields … … 1837 1866 s.E = 3; 1838 1867 1839 is legal. In addition, the FIELD_DECLs must be maintained in1868 is valid. In addition, the FIELD_DECLs must be maintained in 1840 1869 declaration order so that class layout works as expected. 1841 1870 However, we don't need that order until class layout, so we … … 1854 1883 } 1855 1884 1856 /* Enter the DECL into the scope of the class. */ 1857 if (TREE_CODE (decl) != USING_DECL) 1858 pushdecl_class_level (decl); 1885 maybe_add_class_template_decl_list (current_class_type, decl, 1886 /*friend_p=*/0); 1859 1887 } 1860 1888 } … … 1911 1939 if (current_scope () == current_function_decl) 1912 1940 do_pending_inlines (); 1913 }1914 1915 /* Finish processing the inline function definitions cached during the1916 processing of a class definition. */1917 1918 void1919 finish_inline_definitions ()1920 {1921 if (current_class_type == NULL_TREE)1922 clear_inline_text_obstack ();1923 1941 } 1924 1942 … … 1970 1988 /* Finish processing a template-id (which names a type) of the form 1971 1989 NAME < ARGS >. Return the TYPE_DECL for the type named by the 1972 template-id. If ENTERING_SCOPE is non -zero we are about to enter1990 template-id. If ENTERING_SCOPE is nonzero we are about to enter 1973 1991 the scope of template-id indicated. */ 1974 1992 … … 2031 2049 tree result; 2032 2050 2033 if (! is_aggr_type (base_class, 1)) 2051 if (base_class == error_mark_node) 2052 { 2053 error ("invalid base-class specification"); 2054 result = NULL_TREE; 2055 } 2056 else if (! is_aggr_type (base_class, 1)) 2034 2057 result = NULL_TREE; 2035 2058 else … … 2059 2082 2060 2083 We don't just use PROCESSING_TEMPLATE_DECL for the first 2061 condition since that would disallow the perfectly legalcode,2084 condition since that would disallow the perfectly valid code, 2062 2085 like `template <class T> struct S { int i, j; };'. */ 2063 tree scope = current_scope (); 2064 2065 if (scope && TREE_CODE (scope) == FUNCTION_DECL) 2086 if (at_function_scope_p ()) 2066 2087 /* It's OK to write `template <class T> void f() { int i, j;}'. */ 2067 2088 return; … … 2113 2134 return build_min_nt (SIZEOF_EXPR, t); 2114 2135 2115 return TYPE_P (t) ? c _sizeof (t) : expr_sizeof (t);2136 return TYPE_P (t) ? cxx_sizeof (t) : expr_sizeof (t); 2116 2137 } 2117 2138 … … 2126 2147 return build_min_nt (ALIGNOF_EXPR, t); 2127 2148 2128 return TYPE_P (t) ? c _alignof (complete_type (t)) : c_alignof_expr (t);2149 return TYPE_P (t) ? cxx_alignof (t) : c_alignof_expr (t); 2129 2150 } 2130 2151 … … 2138 2159 switch (TREE_CODE (t)) 2139 2160 { 2140 case CTOR_STMT:2141 genrtl_ctor_stmt (t);2142 break;2143 2144 2161 case TRY_BLOCK: 2145 2162 genrtl_try_block (t); … … 2152 2169 case HANDLER: 2153 2170 genrtl_handler (t); 2154 break;2155 2156 case SUBOBJECT:2157 genrtl_subobject (SUBOBJECT_CLEANUP (t));2158 2171 break; 2159 2172 … … 2212 2225 /* Replace the first argument with the address of the third 2213 2226 argument to the AGGR_INIT_EXPR. */ 2214 mark_addressable (slot);2227 cxx_mark_addressable (slot); 2215 2228 args = tree_cons (NULL_TREE, 2216 2229 build1 (ADDR_EXPR, … … 2272 2285 if (DECL_VIRTUAL_P (fn)) 2273 2286 { 2274 tree binfo; 2275 tree v; 2276 2277 for (binfo = TYPE_BINFO (DECL_CONTEXT (fn)); 2278 binfo; 2279 binfo = TREE_CHAIN (binfo)) 2280 for (v = BINFO_VIRTUALS (binfo); v; v = TREE_CHAIN (v)) 2281 if (BV_FN (v) == fn 2282 && (!integer_zerop (BV_DELTA (v)) 2283 || BV_USE_VCALL_INDEX_P (v))) 2284 { 2285 tree thunk; 2286 tree vcall_index; 2287 2288 if (BV_USE_VCALL_INDEX_P (v)) 2289 { 2290 vcall_index = BV_VCALL_INDEX (v); 2291 my_friendly_assert (vcall_index != NULL_TREE, 20000621); 2292 } 2293 else 2294 vcall_index = NULL_TREE; 2295 2296 thunk = make_thunk (build1 (ADDR_EXPR, 2297 vfunc_ptr_type_node, 2298 fn), 2299 BV_DELTA (v), 2300 vcall_index); 2301 use_thunk (thunk, /*emit_p=*/1); 2302 } 2287 tree thunk; 2288 for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk)) 2289 use_thunk (thunk, /*emit_p=*/1); 2303 2290 } 2304 2291 } … … 2312 2299 int saved_lineno; 2313 2300 const char *saved_input_filename; 2301 tree saved_function; 2314 2302 2315 2303 /* When the parser calls us after finishing the body of a template … … 2389 2377 return; 2390 2378 2391 timevar_push (TV_INTEGRATION);2392 2393 /* Optimize the body of the function before expanding it. */2394 optimize_function (fn);2395 2396 timevar_pop (TV_INTEGRATION);2397 timevar_push (TV_EXPAND);2398 2399 2379 /* Save the current file name and line number. When we expand the 2400 2380 body of the function, we'll set LINENO and INPUT_FILENAME so that … … 2402 2382 saved_lineno = lineno; 2403 2383 saved_input_filename = input_filename; 2384 saved_function = current_function_decl; 2404 2385 lineno = DECL_SOURCE_LINE (fn); 2405 2386 input_filename = DECL_SOURCE_FILE (fn); 2387 current_function_decl = fn; 2388 2389 timevar_push (TV_INTEGRATION); 2390 2391 /* Optimize the body of the function before expanding it. */ 2392 optimize_function (fn); 2393 2394 timevar_pop (TV_INTEGRATION); 2395 timevar_push (TV_EXPAND); 2406 2396 2407 2397 genrtl_start_function (fn); … … 2436 2426 2437 2427 /* And restore the current source position. */ 2428 current_function_decl = saved_function; 2438 2429 lineno = saved_lineno; 2439 2430 input_filename = saved_input_filename; … … 2463 2454 *walk_subtrees = 0; 2464 2455 else if (TREE_CODE (*tp) == RETURN_STMT) 2465 RETURN_ EXPR (*tp) = NULL_TREE;2456 RETURN_STMT_EXPR (*tp) = NULL_TREE; 2466 2457 else if (TREE_CODE (*tp) == CLEANUP_STMT 2467 2458 && CLEANUP_DECL (*tp) == nrv) … … 2517 2508 cp_copy_res_decl_for_inlining. */ 2518 2509 if (! DECL_INLINE (fn)) 2519 { 2520 free (DECL_SAVED_FUNCTION_DATA (fn)); 2521 DECL_SAVED_FUNCTION_DATA (fn) = NULL; 2522 } 2510 DECL_SAVED_FUNCTION_DATA (fn) = NULL; 2523 2511 } 2524 2512 -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.