diff options
author | echristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-22 21:54:33 +0000 |
---|---|---|
committer | echristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4> | 2013-07-22 21:54:33 +0000 |
commit | 109b4732e5e55d32fbe59b3cd12e87df54fb92c6 (patch) | |
tree | 4dde03da694b2ad00265488cda73bcc32342639b /gcc/dwarf2out.c | |
parent | 191a0bb76b27ca08afa095210b868b5ca1f61b41 (diff) | |
download | gcc-109b4732e5e55d32fbe59b3cd12e87df54fb92c6.tar.gz |
2013-07-22 Eric Christopher <echristo@gmail.com>
* dwarf2out.c (die_odr_checksum): New function to use
CHECKSUM_ macros and ULEB128 for DIE tag.
(generate_type_signature): Use.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@201148 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/dwarf2out.c')
-rw-r--r-- | gcc/dwarf2out.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index c3417636d2c..87f96447fa3 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -6103,6 +6103,14 @@ die_checksum_ordered (dw_die_ref die, struct md5_ctx *ctx, int *mark) CHECKSUM_ULEB128 (0); } +/* Add a type name and tag to a hash. */ +static void +die_odr_checksum (int tag, const char *name, md5_ctx *ctx) +{ + CHECKSUM_ULEB128 (tag); + CHECKSUM_STRING (name); +} + #undef CHECKSUM #undef CHECKSUM_STRING #undef CHECKSUM_ATTR @@ -6143,8 +6151,8 @@ generate_type_signature (dw_die_ref die, comdat_type_node *type_node) if (parent != NULL) checksum_die_context (parent, &ctx); - md5_process_bytes (&die->die_tag, sizeof (die->die_tag), &ctx); - md5_process_bytes (name, strlen (name) + 1, &ctx); + /* Checksum the current DIE. */ + die_odr_checksum (die->die_tag, name, &ctx); md5_finish_ctx (&ctx, checksum); add_AT_data8 (type_node->root_die, DW_AT_GNU_odr_signature, &checksum[8]); |