summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gcc/tree.c')
-rw-r--r--contrib/gcc/tree.c69
1 files changed, 33 insertions, 36 deletions
diff --git a/contrib/gcc/tree.c b/contrib/gcc/tree.c
index a4f0616..a778b08 100644
--- a/contrib/gcc/tree.c
+++ b/contrib/gcc/tree.c
@@ -6044,41 +6044,48 @@ clean_symbol_name (char *p)
*p = '_';
}
-/* Generate a name for a function unique to this translation unit.
+/* Generate a name for a special-purpose function function.
+ The generated name may need to be unique across the whole link.
TYPE is some string to identify the purpose of this function to the
- linker or collect2. */
+ linker or collect2; it must start with an uppercase letter,
+ one of:
+ I - for constructors
+ D - for destructors
+ N - for C++ anonymous namespaces
+ F - for DWARF unwind frame information. */
tree
-get_file_function_name_long (const char *type)
+get_file_function_name (const char *type)
{
char *buf;
const char *p;
char *q;
+ /* If we already have a name we know to be unique, just use that. */
if (first_global_object_name)
+ p = first_global_object_name;
+ /* If the target is handling the constructors/destructors, they
+ will be local to this file and the name is only necessary for
+ debugging purposes. */
+ else if ((type[0] == 'I' || type[0] == 'D') && targetm.have_ctors_dtors)
{
- p = first_global_object_name;
-
- /* For type 'F', the generated name must be unique not only to this
- translation unit but also to any given link. Since global names
- can be overloaded, we concatenate the first global object name
- with a string derived from the file name of this object. */
- if (!strcmp (type, "F"))
- {
- const char *file = main_input_filename;
-
- if (! file)
- file = input_filename;
-
- q = alloca (strlen (p) + 10);
- sprintf (q, "%s_%08X", p, crc32_string (0, file));
-
- p = q;
- }
+ const char *file = main_input_filename;
+ if (! file)
+ file = input_filename;
+ /* Just use the file's basename, because the full pathname
+ might be quite long. */
+ p = strrchr (file, '/');
+ if (p)
+ p++;
+ else
+ p = file;
+ p = q = ASTRDUP (p);
+ clean_symbol_name (q);
}
else
{
- /* We don't have anything that we know to be unique to this translation
+ /* Otherwise, the name must be unique across the entire link.
+ We don't have anything that we know to be unique to this translation
unit, so use what we do have and throw in some randomness. */
unsigned len;
const char *name = weak_global_object_name;
@@ -6110,20 +6117,6 @@ get_file_function_name_long (const char *type)
return get_identifier (buf);
}
-
-/* If KIND=='I', return a suitable global initializer (constructor) name.
- If KIND=='D', return a suitable global clean-up (destructor) name. */
-
-tree
-get_file_function_name (int kind)
-{
- char p[2];
-
- p[0] = kind;
- p[1] = 0;
-
- return get_file_function_name_long (p);
-}
#if defined ENABLE_TREE_CHECKING && (GCC_VERSION >= 2007)
@@ -6585,6 +6578,10 @@ build_common_tree_nodes_2 (int short_double)
long_double_ptr_type_node = build_pointer_type (long_double_type_node);
integer_ptr_type_node = build_pointer_type (integer_type_node);
+ /* Fixed size integer types. */
+ uint32_type_node = build_nonstandard_integer_type (32, true);
+ uint64_type_node = build_nonstandard_integer_type (64, true);
+
/* Decimal float types. */
dfloat32_type_node = make_node (REAL_TYPE);
TYPE_PRECISION (dfloat32_type_node) = DECIMAL32_TYPE_SIZE;
OpenPOWER on IntegriCloud