summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2015-08-31 18:48:39 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2015-08-31 18:48:39 +0000
commit0035052729e4a3adfbbf0a65ac42d372e9a29c55 (patch)
treee941f52afb7f7eae68bf12a49a2e11ab8a728622 /clang/lib/Serialization/ASTWriterDecl.cpp
parentd40722e26787a6e080e0de30d8980bc15da93ec9 (diff)
downloadbcm5719-llvm-0035052729e4a3adfbbf0a65ac42d372e9a29c55.tar.gz
bcm5719-llvm-0035052729e4a3adfbbf0a65ac42d372e9a29c55.zip
[MS ABI] Correctly mangle classes without names for linkage purposes
A class without a name for linkage purposes gets a name along the lines of <unnamed-type-foo> where foo is either the name of a declarator which defined it (like a variable or field) or a typedef-name (like a typedef or alias-declaration). We handled the declarator case correctly but it would fall down during template instantiation if the declarator didn't share the tag's type. We failed to handle the typedef-name case at all. Instead, keep track of the association between the two and keep it up to date in the face of template instantiation. llvm-svn: 246469
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp5
1 files changed, 0 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index d38e58766a2..24e07c42a41 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -378,9 +378,6 @@ void ASTDeclWriter::VisitTagDecl(TagDecl *D) {
Record.push_back(2);
Writer.AddDeclRef(TD, Record);
Writer.AddIdentifierRef(TD->getDeclName().getAsIdentifierInfo(), Record);
- } else if (auto *DD = D->getDeclaratorForAnonDecl()) {
- Record.push_back(3);
- Writer.AddDeclRef(DD, Record);
} else {
Record.push_back(0);
}
@@ -410,7 +407,6 @@ void ASTDeclWriter::VisitEnumDecl(EnumDecl *D) {
!D->isUsed(false) &&
!D->hasExtInfo() &&
!D->getTypedefNameForAnonDecl() &&
- !D->getDeclaratorForAnonDecl() &&
D->getFirstDecl() == D->getMostRecentDecl() &&
!D->isInvalidDecl() &&
!D->isReferenced() &&
@@ -439,7 +435,6 @@ void ASTDeclWriter::VisitRecordDecl(RecordDecl *D) {
!D->isUsed(false) &&
!D->hasExtInfo() &&
!D->getTypedefNameForAnonDecl() &&
- !D->getDeclaratorForAnonDecl() &&
D->getFirstDecl() == D->getMostRecentDecl() &&
!D->isInvalidDecl() &&
!D->isReferenced() &&
OpenPOWER on IntegriCloud