diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-24 22:50:24 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-08-24 22:50:24 +0000 |
commit | 401b39a736e7c139710f5fc7edcd672026139d6b (patch) | |
tree | 55b8149af0465fbf43eeeddc957f870672b4642a /clang/lib/Serialization/ASTWriter.cpp | |
parent | aba202b4306b8fc1679e64e82860d92d228a31a0 (diff) | |
download | bcm5719-llvm-401b39a736e7c139710f5fc7edcd672026139d6b.tar.gz bcm5719-llvm-401b39a736e7c139710f5fc7edcd672026139d6b.zip |
AST writer support for having specializations of templates from earlier in the chain. This ought to finish C++ chained PCH support.
llvm-svn: 111986
Diffstat (limited to 'clang/lib/Serialization/ASTWriter.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 5c3e24a0a27..be181f44069 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -2129,6 +2129,21 @@ void ASTWriter::WriteDeclContextVisibleUpdate(const DeclContext *DC) { Stream.EmitRecordWithBlob(UpdateVisibleAbbrev, Record, LookupTable.str()); } +/// \brief Write ADDITIONAL_TEMPLATE_SPECIALIZATIONS blocks for all templates +/// that have new specializations in the current AST file. +void ASTWriter::WriteAdditionalTemplateSpecializations() { + RecordData Record; + for (AdditionalTemplateSpecializationsMap::iterator + I = AdditionalTemplateSpecializations.begin(), + E = AdditionalTemplateSpecializations.end(); + I != E; ++I) { + Record.clear(); + Record.push_back(I->first); + Record.insert(Record.end(), I->second.begin(), I->second.end()); + Stream.EmitRecord(ADDITIONAL_TEMPLATE_SPECIALIZATIONS, Record); + } +} + //===----------------------------------------------------------------------===// // General Serialization Routines //===----------------------------------------------------------------------===// @@ -2638,6 +2653,10 @@ void ASTWriter::WriteASTChain(Sema &SemaRef, MemorizeStatCalls *StatCalls, I != E; ++I) WriteDeclContextVisibleUpdate(*I); + // Write the updates to C++ template specialization lists. + if (!AdditionalTemplateSpecializations.empty()) + WriteAdditionalTemplateSpecializations(); + Record.clear(); Record.push_back(NumStatements); Record.push_back(NumMacros); |