aboutsummaryrefslogtreecommitdiff
path: root/contrib/gcc/cp
diff options
context:
space:
mode:
authorPedro F. Giffuni <pfg@FreeBSD.org>2013-11-21 16:38:57 +0000
committerPedro F. Giffuni <pfg@FreeBSD.org>2013-11-21 16:38:57 +0000
commit2bd5e058b774c204ec24f362180b9da438d08c31 (patch)
tree96688663ab2bd665ffb1db7e8d0122835df5086e /contrib/gcc/cp
parente941e1e94a621d0e6366335e61c352f579349403 (diff)
downloadsrc-2bd5e058b774c204ec24f362180b9da438d08c31.tar.gz
src-2bd5e058b774c204ec24f362180b9da438d08c31.zip
gcc: another round of merges from the gcc pre-43 branch.
Bring The following revisions from the gcc43 branch[1]: 118360, 118361, 118363, 118576, 119820, 123906, 125246, and 125721. They all have in common that the were merged long ago into Apple's gcc and should help improve the general quality of the compiler and make it easier to bring new features from Apple's gcc42. For details please review the additions to the files: gcc/ChangeLog.gcc43 gcc/cp/ChangeLog.gcc43 (new, adds previous revisions) Reference: [1] http://gcc.gnu.org/viewcvs/gcc/trunk/?pathrev=126700 Obtained from: gcc pre4.3 (GPLv2) branch MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=258428
Diffstat (limited to 'contrib/gcc/cp')
-rw-r--r--contrib/gcc/cp/ChangeLog.gcc4328
-rw-r--r--contrib/gcc/cp/decl2.c13
-rw-r--r--contrib/gcc/cp/name-lookup.c24
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 000000000000..ed9c7b5a2cbd
--- /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 310dc83159dd..f0b46c91dce3 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 744dd5c489ec..4d08174a4be8 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. */