diff options
author | Doug Kwan <dougkwan@google.com> | 2007-12-14 18:24:57 +0000 |
---|---|---|
committer | Doug Kwan <dougkwan@google.com> | 2007-12-14 18:24:57 +0000 |
commit | 437282b0fbf065e4c45fd4786e6622f48a3f5d12 (patch) | |
tree | bd00deee10ad205ba0515846d90092ee0fedccaf | |
parent | d3cb3c7501a5a06f00895fc5c2591d7d24f6aaba (diff) |
2007-12-13 Doug Kwan <dougkwan@google.com>
* lto.c (lto_read_pointer_reference_type_DIE): Handle optional name
in pointer and reference types.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/lto@130939 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 15 |
2 files changed, 20 insertions, 0 deletions
diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 6955318f6b2..7b0f8da8012 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -1,3 +1,8 @@ +2007-12-13 Doug Kwan <dougkwan@google.com> + + * lto.c (lto_read_pointer_reference_type_DIE): Handle optional name + in pointer and reference types. + 2007-12-13 Nathan Froyd <froydnj@codesourcery.com> * lto-read.c (input_expr_operand): Use DECL_RESULT when reading a diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 80a93e00e0d..38cd2b0d66c 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -2793,10 +2793,15 @@ lto_read_pointer_reference_type_DIE (lto_info_fd *fd, lto_context *context) { tree pointed_to = NULL_TREE; + tree name = NULL_TREE; tree type; LTO_BEGIN_READ_ATTRS () { + case DW_AT_name: + name = lto_get_identifier (&attr_data); + break; + case DW_AT_type: pointed_to = lto_read_referenced_type_DIE (fd, context, @@ -2830,6 +2835,16 @@ lto_read_pointer_reference_type_DIE (lto_info_fd *fd, gcc_unreachable (); } + /* If pointer/reference has a name, build a typedef. */ + if (name != NULL_TREE) + { + tree named_type = build_variant_type_copy (type); + tree decl = build_decl (TYPE_DECL, name, named_type); + TYPE_NAME (named_type) = decl; + DECL_ORIGINAL_TYPE (decl) = type; + type = named_type; + } + lto_read_child_DIEs (fd, abbrev, context); return type; } |