diff options
Diffstat (limited to 'contrib/gcc/cp')
-rw-r--r-- | contrib/gcc/cp/ChangeLog.gcc43 | 28 | ||||
-rw-r--r-- | contrib/gcc/cp/decl2.c | 13 | ||||
-rw-r--r-- | contrib/gcc/cp/name-lookup.c | 24 |
3 files changed, 54 insertions, 11 deletions
diff --git a/contrib/gcc/cp/ChangeLog.gcc43 b/contrib/gcc/cp/ChangeLog.gcc43 new file mode 100644 index 0000000..ed9c7b5 --- /dev/null +++ b/contrib/gcc/cp/ChangeLog.gcc43 @@ -0,0 +1,28 @@ +2007-06-28 Geoffrey Keating <geoffk@apple.com> (r126080) + + * decl2.c (start_objects): Mark constructor-runnning function + as artificial. + +2007-06-14 Geoff Keating <geoffk@apple.com> (r125721) + + PR 31093 + * decl2.c (determine_visibility): Remove duplicate code for + handling type info. + +2007-03-12 Seongbae Park <seongbae.park@gmail.com> (r122851) + + * decl.c (compute_array_index_type): New warning flag warn_vla. + +2007-01-07 Manuel Lopez-Ibanez <manu@gcc.gnu.org> + + PR c++/28986 + * typeck.c (build_binary_op): Call overflow_warning if + TREE_OVERFLOW_P is true for the result and not for any of the + operands. + +2006-10-31 Geoffrey Keating <geoffk@apple.com> (r118360) + + * name-lookup.c (get_anonymous_namespace_name): New. + (push_namespace_with_attribs): Use get_anonymous_namespace_name. + * decl2.c (start_objects): Update for rename of + get_file_function_name_long. diff --git a/contrib/gcc/cp/decl2.c b/contrib/gcc/cp/decl2.c index 310dc83..f0b46c9 100644 --- a/contrib/gcc/cp/decl2.c +++ b/contrib/gcc/cp/decl2.c @@ -1698,10 +1698,6 @@ determine_visibility (tree decl) class can influence the visibility of the DECL. */ if (DECL_CLASS_SCOPE_P (decl)) class_type = DECL_CONTEXT (decl); - else if (TREE_CODE (decl) == VAR_DECL - && DECL_TINFO_P (decl) - && CLASS_TYPE_P (TREE_TYPE (DECL_NAME (decl)))) - class_type = TREE_TYPE (DECL_NAME (decl)); else { /* Not a class member. */ @@ -1787,7 +1783,8 @@ determine_visibility (tree decl) { /* Propagate anonymity from type to decl. */ int tvis = type_visibility (TREE_TYPE (decl)); - if (tvis == VISIBILITY_ANON) + if (tvis == VISIBILITY_ANON + || ! DECL_VISIBILITY_SPECIFIED (decl)) constrain_visibility (decl, tvis); } } @@ -2326,7 +2323,7 @@ start_objects (int method_type, int initp) sprintf (type, "%c", method_type); fndecl = build_lang_decl (FUNCTION_DECL, - get_file_function_name_long (type), + get_file_function_name (type), build_function_type (void_type_node, void_list_node)); start_preparsed_function (fndecl, /*attrs=*/NULL_TREE, SF_PRE_PARSED); @@ -2335,6 +2332,10 @@ start_objects (int method_type, int initp) to scan the object file to find its ctor/dtor routine. */ TREE_PUBLIC (current_function_decl) = ! targetm.have_ctors_dtors; + /* Mark as artificial because it's not explicitly in the user's + source code. */ + DECL_ARTIFICIAL (current_function_decl) = 1; + /* Mark this declaration as used to avoid spurious warnings. */ TREE_USED (current_function_decl) = 1; diff --git a/contrib/gcc/cp/name-lookup.c b/contrib/gcc/cp/name-lookup.c index 744dd5c..4d08174 100644 --- a/contrib/gcc/cp/name-lookup.c +++ b/contrib/gcc/cp/name-lookup.c @@ -61,6 +61,24 @@ tree global_namespace; unit. */ static GTY(()) tree anonymous_namespace_name; +/* Initialise anonymous_namespace_name if necessary, and return it. */ + +static tree +get_anonymous_namespace_name(void) +{ + if (!anonymous_namespace_name) + { + /* The anonymous namespace has to have a unique name + if typeinfo objects are being compared by name. */ + if (! flag_weak || ! SUPPORTS_ONE_ONLY) + anonymous_namespace_name = get_file_function_name ("N"); + else + /* The demangler expects anonymous namespaces to be called + something starting with '_GLOBAL__N_'. */ + anonymous_namespace_name = get_identifier ("_GLOBAL__N_1"); + } + return anonymous_namespace_name; +} /* Compute the chain index of a binding_entry given the HASH value of its name and the total COUNT of chains. COUNT is assumed to be a power @@ -3011,11 +3029,7 @@ push_namespace_with_attribs (tree name, tree attributes) if (anon) { - /* The name of anonymous namespace is unique for the translation - unit. */ - if (!anonymous_namespace_name) - anonymous_namespace_name = get_file_function_name ('N'); - name = anonymous_namespace_name; + name = get_anonymous_namespace_name(); d = IDENTIFIER_NAMESPACE_VALUE (name); if (d) /* Reopening anonymous namespace. */ |