diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-06 15:37:04 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-07-06 15:37:04 +0000 |
commit | d455add086f1dfa16ae87dc310e49493bbc2b0a6 (patch) | |
tree | be6653edd7f1afc6ba53accbbfdf403affc63933 /lib/Frontend/PCHWriter.cpp | |
parent | 0f47bb98cbc52a6ead2aef8a2f8315c0b6167e6c (diff) |
Add to PCH missing Sema information about VTable uses and dynamic classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107664 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHWriter.cpp')
-rw-r--r-- | lib/Frontend/PCHWriter.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/Frontend/PCHWriter.cpp b/lib/Frontend/PCHWriter.cpp index 1177b9452b..e0009f44ab 100644 --- a/lib/Frontend/PCHWriter.cpp +++ b/lib/Frontend/PCHWriter.cpp @@ -2132,6 +2132,20 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, for (unsigned I = 0, N = SemaRef.ExtVectorDecls.size(); I != N; ++I) AddDeclRef(SemaRef.ExtVectorDecls[I], ExtVectorDecls); + // Build a record containing all of the VTable uses information. + RecordData VTableUses; + VTableUses.push_back(SemaRef.VTableUses.size()); + for (unsigned I = 0, N = SemaRef.VTableUses.size(); I != N; ++I) { + AddDeclRef(SemaRef.VTableUses[I].first, VTableUses); + AddSourceLocation(SemaRef.VTableUses[I].second, VTableUses); + VTableUses.push_back(SemaRef.VTablesUsed[SemaRef.VTableUses[I].first]); + } + + // Build a record containing all of dynamic classes declarations. + RecordData DynamicClasses; + for (unsigned I = 0, N = SemaRef.DynamicClasses.size(); I != N; ++I) + AddDeclRef(SemaRef.DynamicClasses[I], DynamicClasses); + // Write the remaining PCH contents. RecordData Record; Stream.EnterSubblock(pch::PCH_BLOCK_ID, 5); @@ -2227,6 +2241,14 @@ void PCHWriter::WritePCH(Sema &SemaRef, MemorizeStatCalls *StatCalls, if (!ExtVectorDecls.empty()) Stream.EmitRecord(pch::EXT_VECTOR_DECLS, ExtVectorDecls); + // Write the record containing VTable uses information. + if (!VTableUses.empty()) + Stream.EmitRecord(pch::VTABLE_USES, VTableUses); + + // Write the record containing dynamic classes declarations. + if (!DynamicClasses.empty()) + Stream.EmitRecord(pch::DYNAMIC_CLASSES, DynamicClasses); + // Some simple statistics Record.clear(); Record.push_back(NumStatements); |