Lazily load the controlling macros for all of the headers known in the

PCH file. In the Cocoa-prefixed "Hello, World" benchmark, this takes
us from reading 503 identifiers down to 37 and from 470 macros down to
4. It also results in an 8% performance improvement.

llvm-svn: 70094
This commit is contained in:
Douglas Gregor
2009-04-25 23:30:02 +00:00
parent c06ce0f710
commit 99734e7669
6 changed files with 77 additions and 13 deletions

View File

@@ -1717,7 +1717,7 @@ bool PCHReader::ReadPreprocessorBlock() {
HFI.isImport = Record[0];
HFI.DirInfo = Record[1];
HFI.NumIncludes = Record[2];
HFI.ControllingMacro = DecodeIdentifierInfo(Record[3]);
HFI.ControllingMacroID = Record[3];
PP.getHeaderSearchInfo().setHeaderFileInfoForUID(HFI, NumHeaderInfos++);
break;
}
@@ -1854,6 +1854,7 @@ PCHReader::ReadPCHBlock(uint64_t &PreprocessorBlockOffset) {
}
IdentifierOffsets = (const uint32_t *)BlobStart;
IdentifiersLoaded.resize(Record[0]);
PP.getHeaderSearchInfo().SetExternalLookup(this);
break;
case pch::EXTERNAL_DEFINITIONS: