diff options
| author | David Majnemer <david.majnemer@gmail.com> | 2013-09-17 22:21:27 +0000 |
|---|---|---|
| committer | David Majnemer <david.majnemer@gmail.com> | 2013-09-17 22:21:27 +0000 |
| commit | 1ebb145bdff0b3dc85a972922b9c706d298fc462 (patch) | |
| tree | c6580c88b57f6ccfb0565553d7d13e9a6b02ee19 /clang/lib/Serialization | |
| parent | 870b662779107b429a3ebc10340b039c48229806 (diff) | |
| download | bcm5719-llvm-1ebb145bdff0b3dc85a972922b9c706d298fc462.tar.gz bcm5719-llvm-1ebb145bdff0b3dc85a972922b9c706d298fc462.zip | |
[-cxx-abi microsoft] Mangle local TagDecls appropriately
Summary:
When selecting a mangling for an anonymous tag type:
- We should first try it's typedef'd name.
- If that doesn't work, we should mangle in the name of the declarator
that specified it as a declaration specifier.
- If that doesn't work, fall back to a static mangling of
<unnamed-type>.
This should make our anonymous type mangling compatible.
This partially fixes PR16994; we would need to have an implementation of
scope numbering to get it right (a separate issue).
Reviewers: rnk, rsmith, rjmccall, cdavis5x
CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1540
llvm-svn: 190892
Diffstat (limited to 'clang/lib/Serialization')
| -rw-r--r-- | clang/lib/Serialization/ASTReaderDecl.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTWriterDecl.cpp | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 791f3c9f8ca..a9225fc81be 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -464,9 +464,9 @@ ASTDeclReader::RedeclarableResult ASTDeclReader::VisitTagDecl(TagDecl *TD) { if (Record[Idx++]) { // hasExtInfo TagDecl::ExtInfo *Info = new (Reader.getContext()) TagDecl::ExtInfo(); ReadQualifierInfo(*Info, Record, Idx); - TD->TypedefNameDeclOrQualifier = Info; + TD->NamedDeclOrQualifier = Info; } else - TD->setTypedefNameForAnonDecl(ReadDeclAs<TypedefNameDecl>(Record, Idx)); + TD->NamedDeclOrQualifier = ReadDeclAs<NamedDecl>(Record, Idx); mergeRedeclarable(TD, Redecl); return Redecl; diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp index dc2ed465758..a9d8a03f717 100644 --- a/clang/lib/Serialization/ASTWriterDecl.cpp +++ b/clang/lib/Serialization/ASTWriterDecl.cpp @@ -229,8 +229,10 @@ void ASTDeclWriter::VisitTagDecl(TagDecl *D) { Record.push_back(D->hasExtInfo()); if (D->hasExtInfo()) Writer.AddQualifierInfo(*D->getExtInfo(), Record); - else + else if (D->getTypedefNameForAnonDecl()) Writer.AddDeclRef(D->getTypedefNameForAnonDecl(), Record); + else if (D->hasDeclaratorForAnonDecl()) + Writer.AddDeclRef(D->getDeclaratorForAnonDecl(), Record); } void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) { |

