Commit 881c6935 by Jason Merrill Committed by Jason Merrill

[multiple changes]

2000-08-28  Daniel Berlin  <dberlin@redhat.com>

        * dwarf2out.c (DIE_LABEL_PREFIX): Remove leading "__".
        (print_die): If we don't know the offset of the
        target die, try the symbol.  Add a trailing newline.
        (reverse_all_dies): New fn.
        (dwarf2out_finish): Call it.
        (break_out_includes): Reorganize for clarity.
        (add_sibling_attributes): Don't call reverse_die_lists.
        (output_comp_unit): Rename from output_comdat_comp_unit.  Use for
        primary CU, too.
        * flags.h: Add flag_eliminate_dwarf2_dups.
        * toplev.c (f_options): Support -feliminate-dwarf2-dups.

2000-08-28  Jason Merrill  <jason@redhat.com>

        * dwarf2.h (DW_TAG_GNU_BINCL, DW_TAG_GNU_EINCL): New tags.
        * dwarf2out.c: #include "md5.h".
        (DIE_LABEL_PREFIX): New macro.
        (dw_val_struct): Add 'external' flag to val_die_ref.
        (add_AT_die_ref, AT_ref): Adjust.
        (AT_ref_external, set_AT_ref_external): New fns.
        (build_abbrev_table): Call set_AT_ref_external.
        (value_format): Call AT_ref_external.
        (die_struct): Add die_symbol field.
        (new_die): Clear it.
        (dwarf_tag_name): Handle BINCL/EINCL.
        (dwarf2out_start_source_file): Add BINCL DIE.
        (dwarf2out_end_source_file): Add EINCL DIE.
        (push_new_compile_unit, pop_compile_unit, clear_die_sizes): New fns.
        (loc_checksum, attr_checksum, die_checksum): New fns.
        (is_type_die, is_comdat_die, is_symbol_die): New fns.
        (compute_section_prefix, assign_symbol_names): New fns.
        (gen_internal_sym, output_die_symbol, output_symbolic_ref): New fns.
        (output_die): Call output_die_symbol and AT_ref_external.
        (output_comdat_comp_unit): New fn, split out from...
        (dwarf2out_finish): ...here.  Also call add_sibling_attributes for
        secondary CUs.
        (output_pubnames, output_aranges): Abort if we see entries from
        secondary CUs.
        * toplev.h: Declare file_name_nondirectory.
        * toplev.c (file_name_nondirectory): New fn, moved from C++ frontend.
        (rest_of_type_compilation): Call dwarf2out_decl if at toplevel.
        (debug_start_source_file): Call dwarf2out_start_source_file
        regardless of debug verbosity.
        (debug_end_source_file): Similarly.
        * tree.h: Declare clean_symbol_name.
        * tree.c (clean_symbol_name): Split out from...
        (get_file_function_name_long): ...here.

        * dwarf2out.c (new_loc_descr): Use calloc.
        (splice_child_die): Remove the die from the right parent.
        (gen_struct_or_union_die): Don't add AT_name to a specification DIE.

gcc/cp:
2000-08-28  Jason Merrill  <jason@redhat.com>

        * lex.c (file_name_nondirectory): Move to toplev.c.

libiberty:
2000-08-28  Jason Merrill  <jason@redhat.com>

        * Makefile.in (REQUIRED_OFILES): Add md5.o.
        (CFILES): Add md5.c.
        * md5.c: New file.

include:
2000-08-28  Jason Merrill  <jason@redhat.com>

        * md5.h: New file.

gcc/cp:
2000-08-28  Jason Merrill  <jason@redhat.com>

        * cp-tree.h (LOCAL_CLASS_P): New macro.
        * class.c (finish_struct_1): Use it.

From-SVN: r36022
parent 5de0e8d4
2000-08-28 Jason Merrill <jason@redhat.com>
* lex.c (file_name_nondirectory): Move to toplev.c.
* cp-tree.h (LOCAL_CLASS_P): New macro.
* class.c (finish_struct_1): Use it.
2000-08-27 Alex Samuel <samuel@codesourcery.com>
* mangle.c (CLASSTYPE_TEMPLATE_ID_P): Remove unexplained voodoo.
......
......@@ -5200,7 +5200,7 @@ finish_struct_1 (t)
maybe_suppress_debug_info (t);
/* Finish debugging output for this type. */
rest_of_type_compilation (t, toplevel_bindings_p ());
rest_of_type_compilation (t, ! LOCAL_CLASS_P (t));
}
/* When T was built up, the member declarations were added in reverse
......
......@@ -2224,6 +2224,11 @@ struct lang_decl
(DECL_CONTEXT (NODE) \
&& TREE_CODE (DECL_CONTEXT (NODE)) == FUNCTION_DECL)
/* 1 iff NODE is function-local, but for types. */
#define LOCAL_CLASS_P(NODE) \
(TYPE_CONTEXT (NODE) \
&& TREE_CODE (TYPE_CONTEXT (NODE)) == FUNCTION_DECL)
/* For a NAMESPACE_DECL: the list of using namespace directives
The PURPOSE is the used namespace, the value is the namespace
that is the common ancestor. */
......
......@@ -96,21 +96,6 @@ static int is_extended_char PARAMS ((int));
static int is_extended_char_1 PARAMS ((int));
static void init_operators PARAMS ((void));
/* Given a file name X, return the nondirectory portion.
Keep in mind that X can be computed more than once. */
char *
file_name_nondirectory (x)
const char *x;
{
char *tmp = (char *) rindex (x, '/');
if (DIR_SEPARATOR != '/' && ! tmp)
tmp = (char *) rindex (x, DIR_SEPARATOR);
if (tmp)
return (char *) (tmp + 1);
else
return (char *) x;
}
/* This obstack is needed to hold text. It is not safe to use
TOKEN_BUFFER because `check_newline' calls `yylex'. */
struct obstack inline_text_obstack;
......
......@@ -88,7 +88,9 @@ enum dwarf_tag
/* GNU extensions */
DW_TAG_format_label = 0x4101, /* for FORTRAN 77 and Fortran 90 */
DW_TAG_function_template = 0x4102, /* for C++ */
DW_TAG_class_template = 0x4103 /* for C++ */
DW_TAG_class_template = 0x4103, /* for C++ */
DW_TAG_GNU_BINCL = 0x4104,
DW_TAG_GNU_EINCL = 0x4105
};
#define DW_TAG_lo_user 0x4080
......
......@@ -577,3 +577,7 @@ extern enum graph_dump_types graph_dump_format;
string identifying the compiler. */
extern int flag_no_ident;
/* Nonzero means we should do dwarf2 duplicate elimination. */
extern int flag_eliminate_dwarf2_dups;
......@@ -422,6 +422,10 @@ tree (*lang_expand_constant) PARAMS ((tree)) = 0;
void (*incomplete_decl_finalize_hook) PARAMS ((tree)) = 0;
/* Nonzero if doing dwarf2 duplicate elimination. */
int flag_eliminate_dwarf2_dups = 0;
/* Nonzero if generating code to do profiling. */
int profile_flag = 0;
......@@ -944,6 +948,8 @@ const char *user_label_prefix;
lang_independent_options f_options[] =
{
{"eliminate-dwarf2-dups", &flag_eliminate_dwarf2_dups, 1,
"Perform DWARF2 duplicate elimination"},
{"float-store", &flag_float_store, 1,
"Do not store floats in registers" },
{"volatile", &flag_volatile, 1,
......@@ -1656,6 +1662,21 @@ strip_off_ending (name, len)
}
}
/* Given a file name X, return the nondirectory portion. */
char *
file_name_nondirectory (x)
const char *x;
{
char *tmp = (char *) rindex (x, '/');
if (DIR_SEPARATOR != '/' && ! tmp)
tmp = (char *) rindex (x, DIR_SEPARATOR);
if (tmp)
return (char *) (tmp + 1);
else
return (char *) x;
}
/* Output a quoted string. */
void
......@@ -2561,6 +2582,10 @@ rest_of_type_compilation (type, toplev)
if (write_symbols == SDB_DEBUG)
sdbout_symbol (TYPE_STUB_DECL (type), !toplev);
#endif
#ifdef DWARF2_DEBUGGING_INFO
if (write_symbols == DWARF2_DEBUG && toplev)
dwarf2out_decl (TYPE_STUB_DECL (type));
#endif
timevar_pop (TV_SYMOUT);
}
......@@ -4973,8 +4998,7 @@ debug_start_source_file (filename)
dwarfout_start_new_source_file (filename);
#endif /* DWARF_DEBUGGING_INFO */
#ifdef DWARF2_DEBUGGING_INFO
if (debug_info_level == DINFO_LEVEL_VERBOSE
&& write_symbols == DWARF2_DEBUG)
if (write_symbols == DWARF2_DEBUG)
dwarf2out_start_source_file (filename);
#endif /* DWARF2_DEBUGGING_INFO */
#ifdef SDB_DEBUGGING_INFO
......@@ -5000,8 +5024,7 @@ debug_end_source_file (lineno)
dwarfout_resume_previous_source_file (lineno);
#endif /* DWARF_DEBUGGING_INFO */
#ifdef DWARF2_DEBUGGING_INFO
if (debug_info_level == DINFO_LEVEL_VERBOSE
&& write_symbols == DWARF2_DEBUG)
if (write_symbols == DWARF2_DEBUG)
dwarf2out_end_source_file ();
#endif /* DWARF2_DEBUGGING_INFO */
#ifdef SDB_DEBUGGING_INFO
......
......@@ -35,6 +35,7 @@ extern int read_integral_parameter PARAMS ((const char *, const char *,
const int));
extern int count_error PARAMS ((int));
extern void strip_off_ending PARAMS ((char *, int));
extern char *file_name_nondirectory PARAMS ((const char *));
extern void print_time PARAMS ((const char *, long));
extern void debug_start_source_file PARAMS ((const char *));
extern void debug_end_source_file PARAMS ((unsigned));
......
......@@ -5386,6 +5386,26 @@ append_random_chars (template)
template[6] = '\0';
}
/* P is a string that will be used in a symbol. Mask out any characters
that are not valid in that context. */
void
clean_symbol_name (p)
char *p;
{
for (; *p; p++)
if (! ( ISDIGIT(*p)
#ifndef NO_DOLLAR_IN_LABEL /* this for `$'; unlikely, but... -- kr */
|| *p == '$'
#endif
#ifndef NO_DOT_IN_LABEL /* this for `.'; unlikely, but... */
|| *p == '.'
#endif
|| ISUPPER(*p)
|| ISLOWER(*p)))
*p = '_';
}
/* Generate a name for a function unique to this translation unit.
TYPE is some string to identify the purpose of this function to the
linker or collect2. */
......@@ -5431,19 +5451,7 @@ get_file_function_name_long (type)
/* Don't need to pull weird characters out of global names. */
if (p != first_global_object_name)
{
for (q = buf+11; *q; q++)
if (! ( ISDIGIT(*q)
#ifndef NO_DOLLAR_IN_LABEL /* this for `$'; unlikely, but... -- kr */
|| *q == '$'
#endif
#ifndef NO_DOT_IN_LABEL /* this for `.'; unlikely, but... */
|| *q == '.'
#endif
|| ISUPPER(*q)
|| ISLOWER(*q)))
*q = '_';
}
clean_symbol_name (buf + 11);
return get_identifier (buf);
}
......
......@@ -2435,6 +2435,7 @@ extern tree builtin_function PARAMS ((const char *, tree, int,
/* In tree.c */
extern char *perm_calloc PARAMS ((int, long));
extern void clean_symbol_name PARAMS ((char *));
extern tree get_file_function_name PARAMS ((int));
extern tree get_file_function_name_long PARAMS ((const char *));
extern tree get_set_constructor_bits PARAMS ((tree, char *, int));
......
2000-08-28 Jason Merrill <jason@redhat.com>
* md5.h: New file.
2000-08-24 Greg McGary <greg@mcgary.org>
* libiberty.h (ARRAY_SIZE): New macro.
......
/* md5.h - Declaration of functions and data types used for MD5 sum
computing library functions.
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C
Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any
later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#ifndef _MD5_H
#define _MD5_H 1
#include <stdio.h>
#if defined HAVE_LIMITS_H || _LIBC
# include <limits.h>
#endif
/* The following contortions are an attempt to use the C preprocessor
to determine an unsigned integral type that is 32 bits wide. An
alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
doing that would require that the configure script compile and *run*
the resulting executable. Locally running cross-compiled executables
is usually not possible. */
#ifdef _LIBC
# include <sys/types.h>
typedef u_int32_t md5_uint32;
#else
# if defined __STDC__ && __STDC__
# define UINT_MAX_32_BITS 4294967295U
# else
# define UINT_MAX_32_BITS 0xFFFFFFFF
# endif
/* If UINT_MAX isn't defined, assume it's a 32-bit type.
This should be valid for all systems GNU cares about because
that doesn't include 16-bit systems, and only modern systems
(that certainly have <limits.h>) have 64+-bit integral types. */
# ifndef UINT_MAX
# define UINT_MAX UINT_MAX_32_BITS
# endif
# if UINT_MAX == UINT_MAX_32_BITS
typedef unsigned int md5_uint32;
# else
# if USHRT_MAX == UINT_MAX_32_BITS
typedef unsigned short md5_uint32;
# else
# if ULONG_MAX == UINT_MAX_32_BITS
typedef unsigned long md5_uint32;
# else
/* The following line is intended to evoke an error.
Using #error is not portable enough. */
"Cannot determine unsigned 32-bit data type."
# endif
# endif
# endif
#endif
#undef __P
#if defined (__STDC__) && __STDC__
#define __P(x) x
#else
#define __P(x) ()
#endif
/* Structure to save state of computation between the single steps. */
struct md5_ctx
{
md5_uint32 A;
md5_uint32 B;
md5_uint32 C;
md5_uint32 D;
md5_uint32 total[2];
md5_uint32 buflen;
char buffer[128];
};
/*
* The following three functions are build up the low level used in
* the functions `md5_stream' and `md5_buffer'.
*/
/* Initialize structure containing state of computation.
(RFC 1321, 3.3: Step 3) */
extern void md5_init_ctx __P ((struct md5_ctx *ctx));
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is necessary that LEN is a multiple of 64!!! */
extern void md5_process_block __P ((const void *buffer, size_t len,
struct md5_ctx *ctx));
/* Starting with the result of former calls of this function (or the
initialization function update the context for the next LEN bytes
starting at BUFFER.
It is NOT required that LEN is a multiple of 64. */
extern void md5_process_bytes __P ((const void *buffer, size_t len,
struct md5_ctx *ctx));
/* Process the remaining bytes in the buffer and put result from CTX
in first 16 bytes following RESBUF. The result is always in little
endian byte order, so that a byte-wise output yields to the wanted
ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf));
/* Put result from CTX in first 16 bytes following RESBUF. The result is
always in little endian byte order, so that a byte-wise output yields
to the wanted ASCII representation of the message digest.
IMPORTANT: On some systems it is required that RESBUF is correctly
aligned for a 32 bits value. */
extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf));
/* Compute MD5 message digest for bytes read from STREAM. The
resulting message digest number will be written into the 16 bytes
beginning at RESBLOCK. */
extern int md5_stream __P ((FILE *stream, void *resblock));
/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The
result is always in little endian byte order, so that a byte-wise
output yields to the wanted ASCII representation of the message
digest. */
extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock));
#endif
2000-08-28 Jason Merrill <jason@redhat.com>
* Makefile.in (REQUIRED_OFILES): Add md5.o.
(CFILES): Add md5.c.
* md5.c: New file.
2000-08-27 Alex Samuel <samuel@codesourcery.com>
* cp-demangle.c (demangle_name): Initialize template_p in local
......
......@@ -128,7 +128,7 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
bzero.c calloc.c choose-temp.c clock.c concat.c cplus-dem.c \
cp-demangle.c dyn-string.c fdmatch.c fnmatch.c getcwd.c \
getpwd.c getopt.c getopt1.c getpagesize.c getruntime.c \
floatformat.c hashtab.c hex.c index.c insque.c memchr.c memcmp.c \
floatformat.c hashtab.c hex.c index.c insque.c md5.c memchr.c memcmp.c\
memcpy.c memmove.c memset.c mkstemps.c objalloc.c obstack.c \
partition.c pexecute.c putenv.c random.c rename.c rindex.c setenv.c \
sigsetmask.c sort.c spaces.c splay-tree.c strcasecmp.c strncasecmp.c \
......@@ -140,7 +140,7 @@ CFILES = asprintf.c alloca.c argv.c atexit.c basename.c bcmp.c bcopy.c \
# These are always included in the library.
REQUIRED_OFILES = argv.o choose-temp.o concat.o cplus-dem.o cp-demangle.o \
dyn-string.o fdmatch.o fnmatch.o getopt.o getopt1.o getpwd.o \
getruntime.o hashtab.o hex.o floatformat.o objalloc.o obstack.o \
getruntime.o hashtab.o hex.o floatformat.o md5.o objalloc.o obstack.o \
partition.o pexecute.o sort.o spaces.o splay-tree.o strerror.o \
strsignal.o xatexit.o xexit.o xmalloc.o xmemdup.o xstrdup.o \
xstrerror.o
......
This diff is collapsed. Click to expand it.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment