diff options
author | Jim Wilson <wilson@gcc.gnu.org> | 1995-05-11 11:21:22 -0700 |
---|---|---|
committer | Jim Wilson <wilson@gcc.gnu.org> | 1995-05-11 11:21:22 -0700 |
commit | 58add97ac9482b840c8de0a2bd1b481dfa848b60 (patch) | |
tree | 76f82043cc8797d421807e905c632c73aa749c31 | |
parent | e100a3bb5d681607423d4aa1b541c1e46b047e8b (diff) | |
download | gcc-58add97ac9482b840c8de0a2bd1b481dfa848b60.zip gcc-58add97ac9482b840c8de0a2bd1b481dfa848b60.tar.gz gcc-58add97ac9482b840c8de0a2bd1b481dfa848b60.tar.bz2 |
(output_decl): Don't output DIE for struct or union type
with no name or with ERROR_MARK for the fields.
From-SVN: r9619
-rw-r--r-- | gcc/dwarfout.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c index 0657847..f5cb10c 100644 --- a/gcc/dwarfout.c +++ b/gcc/dwarfout.c @@ -4359,6 +4359,17 @@ output_decl (decl, containing_scope) if (TREE_CODE (decl) == ERROR_MARK) return; + /* If a structure is declared within an initialization, e.g. as the + operand of a sizeof, then it will not have a name. We don't want + to output a DIE for it, as the tree nodes are in the temporary obstack */ + + if ((TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE + || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE) + && ((DECL_NAME (decl) == 0 && TYPE_NAME (TREE_TYPE (decl)) == 0) + || (TYPE_FIELDS (TREE_TYPE (decl)) + && (TREE_CODE (TYPE_FIELDS (TREE_TYPE (decl))) == ERROR_MARK)))) + return; + /* If this ..._DECL node is marked to be ignored, then ignore it. But don't ignore a function definition, since that would screw up our count of blocks, and that it turn will completely screw up the |