diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-24 21:59:32 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-08-24 21:59:32 +0000 |
| commit | d8879c85f68250baa6f2ebc463259201782e8460 (patch) | |
| tree | 5620bbc3c8111058e26e69123c027ee38722889b /clang/lib/Serialization | |
| parent | 20348229812c6592bf72e14cf6f5fa5ff00df157 (diff) | |
| download | bcm5719-llvm-d8879c85f68250baa6f2ebc463259201782e8460.tar.gz bcm5719-llvm-d8879c85f68250baa6f2ebc463259201782e8460.zip | |
[modules] Remove unnecessary deserialization of fully-external HeaderFileInfos for all files we've seen in this compilation.
llvm-svn: 245881
Diffstat (limited to 'clang/lib/Serialization')
| -rw-r--r-- | clang/lib/Serialization/ASTReader.cpp | 6 | ||||
| -rw-r--r-- | clang/lib/Serialization/ASTWriter.cpp | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp index 8e19c708f73..7c94ca435de 100644 --- a/clang/lib/Serialization/ASTReader.cpp +++ b/clang/lib/Serialization/ASTReader.cpp @@ -1603,11 +1603,13 @@ HeaderFileInfoTrait::ReadData(internal_key_ref key, const unsigned char *d, // going to use this information to rebuild the module, so it doesn't make // a lot of difference. Module::Header H = { key.Filename, FileMgr.getFile(Filename) }; - ModMap.addHeader(Mod, H, HeaderRole); + ModMap.addHeader(Mod, H, HeaderRole, /*Imported*/true); + HFI.isModuleHeader |= !(HeaderRole & ModuleMap::TextualHeader); } // This HeaderFileInfo was externally loaded. HFI.External = true; + HFI.IsValid = true; return HFI; } @@ -2790,7 +2792,7 @@ ASTReader::ReadASTBlock(ModuleFile &F, unsigned ClientLoadCapabilities) { RemapBuilder DeclRemap(F.DeclRemap); RemapBuilder TypeRemap(F.TypeRemap); - while(Data < DataEnd) { + while (Data < DataEnd) { using namespace llvm::support; uint16_t Len = endian::readNext<uint16_t, little, unaligned>(Data); StringRef Name = StringRef((const char*)Data, Len); diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp index 678258eb44f..7058ba3eb9b 100644 --- a/clang/lib/Serialization/ASTWriter.cpp +++ b/clang/lib/Serialization/ASTWriter.cpp @@ -1736,9 +1736,9 @@ void ASTWriter::WriteHeaderSearch(const HeaderSearch &HS) { // changed since it was loaded. Also skip it if it's for a modular header // from a different module; in that case, we rely on the module(s) // containing the header to provide this information. - const HeaderFileInfo *HFI = HS.getExistingFileInfo(File); - if (!HFI || (HFI->External && Chain) || - (HFI->isModuleHeader && !HFI->isCompilingModuleHeader)) + const HeaderFileInfo *HFI = + HS.getExistingFileInfo(File, /*WantExternal*/!Chain); + if (!HFI || (HFI->isModuleHeader && !HFI->isCompilingModuleHeader)) continue; // Massage the file path into an appropriate form. |

