diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-21 07:20:48 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-01-21 07:20:48 +0000 |
commit | 1869ca576befbe5457337f88ec2e183aa66eb96f (patch) | |
tree | 5a7be8ba6dc1abd3f95a537fbc5e0ad6a7afb4ef /gcc/cp/mangle.c | |
parent | 63b82f0a74f7ec778b00401a1a273c9df747b758 (diff) | |
download | gcc-1869ca576befbe5457337f88ec2e183aa66eb96f.tar.gz |
2010-01-21 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 156107
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@156108 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/mangle.c')
-rw-r--r-- | gcc/cp/mangle.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c index 13b0ed47af3..c14f5b7d844 100644 --- a/gcc/cp/mangle.c +++ b/gcc/cp/mangle.c @@ -1732,6 +1732,12 @@ write_type (tree type) if (find_substitution (type)) return; + /* According to the C++ ABI, some library classes are passed the + same as the scalar type of their single member and use the same + mangling. */ + if (TREE_CODE (type) == RECORD_TYPE && TYPE_TRANSPARENT_AGGR (type)) + type = TREE_TYPE (first_field (type)); + if (write_CV_qualifiers_for_type (type) > 0) /* If TYPE was CV-qualified, we just wrote the qualifiers; now mangle the unqualified type. The recursive call is needed here @@ -2481,7 +2487,7 @@ write_expression (tree expr) } else { - int i; + int i, len; const char *name; /* When we bind a variable or function to a non-type template @@ -2582,7 +2588,27 @@ write_expression (tree expr) break; default: - for (i = 0; i < TREE_OPERAND_LENGTH (expr); ++i) + /* In the middle-end, some expressions have more operands than + they do in templates (and mangling). */ + switch (code) + { + case PREINCREMENT_EXPR: + case PREDECREMENT_EXPR: + case POSTINCREMENT_EXPR: + case POSTDECREMENT_EXPR: + len = 1; + break; + + case ARRAY_REF: + len = 2; + break; + + default: + len = TREE_OPERAND_LENGTH (expr); + break; + } + + for (i = 0; i < len; ++i) { tree operand = TREE_OPERAND (expr, i); /* As a GNU extension, the middle operand of a |