diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-14 14:07:59 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-04-14 14:07:59 +0000 |
commit | 9ab988fe00b803c15cc9450ecb4926d53ebf32ba (patch) | |
tree | 88d486e8808b0861eb74303a4d0fb48206d9a88a /clang/lib/Serialization/ASTWriter.cpp | |
parent | 05d73a10a2164a134b3bc23571736093f6db1d1c (diff) | |
download | bcm5719-llvm-9ab988fe00b803c15cc9450ecb4926d53ebf32ba.tar.gz bcm5719-llvm-9ab988fe00b803c15cc9450ecb4926d53ebf32ba.zip |
Chained PCH: Remember when additional specializations are added to a function template from a previous PCH. Fixes the only crasher when using massive chains on Clang's Sema component. We still have some incomplete codegen there.
llvm-svn: 129516
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index f7dfc38224d..0e925a2691b 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -3936,4 +3936,16 @@ void ASTWriter::AddedCXXTemplateSpecialization(const ClassTemplateDecl *TD, AddDeclRef(D, Record); } +void ASTWriter::AddedCXXTemplateSpecialization(const FunctionTemplateDecl *TD, + const FunctionDecl *D) { + // The specializations set is kept in the canonical template. + TD = TD->getCanonicalDecl(); + if (!(D->getPCHLevel() == 0 && TD->getPCHLevel() > 0)) + return; // Not a source specialization added to a template from PCH. + + UpdateRecord &Record = DeclUpdates[TD]; + Record.push_back(UPD_CXX_ADDED_TEMPLATE_SPECIALIZATION); + AddDeclRef(D, Record); +} + ASTSerializationListener::~ASTSerializationListener() { } |