diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-28 22:54:21 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-28 22:54:21 +0000 |
commit | 5fc727a0c29589d886d38aa074d9bcdff9e1ba5c (patch) | |
tree | b00d1be79e3ddebdd3fa10dc6ac9630de6c65b87 /clang/lib/Serialization/ASTReader.cpp | |
parent | 3d785edee273ee9fcb89d255dda1f787afa49197 (diff) | |
download | bcm5719-llvm-5fc727a0c29589d886d38aa074d9bcdff9e1ba5c.tar.gz bcm5719-llvm-5fc727a0c29589d886d38aa074d9bcdff9e1ba5c.zip |
[PCH] Keep track of file-level declarations that are contained by files.
Introduce a FILE_SORTED_DECLS [de]serialization record that contains
a file sorted array of file-level DeclIDs in a PCH/Module.
The rationale is to allow "targeted" deserialization of decls inside
a range of a source file.
Cocoa PCH increased by 0.8%
Difference of creation time for Cocoa PCH is below the noise level.
llvm-svn: 143238
Diffstat (limited to 'clang/lib/Serialization/ASTReader.cpp')
-rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 4678930702d..8a1ae3da1aa 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1134,6 +1134,13 @@ ASTReader::ASTReadResult ASTReader::ReadSLocEntryRecord(int ID) { FileInfo.NumCreatedFIDs = Record[6]; if (Record[3]) FileInfo.setHasLineDirectives(); + + const DeclID *FirstDecl = F->FileSortedDecls + Record[7]; + unsigned NumFileDecls = Record[8]; + if (NumFileDecls) { + assert(F->FileSortedDecls && "FILE_SORTED_DECLS not encountered yet ?"); + FileDeclIDs[FID] = llvm::makeArrayRef(FirstDecl, NumFileDecls); + } break; } @@ -1960,6 +1967,10 @@ ASTReader::ReadASTBlock(Module &F) { if (!Record.empty() && Listener) Listener->ReadCounter(Record[0]); break; + + case FILE_SORTED_DECLS: + F.FileSortedDecls = (const DeclID *)BlobStart; + break; case SOURCE_LOCATION_OFFSETS: { F.SLocEntryOffsets = (const uint32_t *)BlobStart; |