diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-10-05 16:15:19 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-10-05 16:15:19 +0000 |
commit | 1d9f1fe7173e3084325f43c78af812a36d8a2a7c (patch) | |
tree | 62cc4283ca4e25e7c0a3c51f88c37d4586e01ffe /lib/Serialization/ASTReader.cpp | |
parent | c3632730cc83ed7b51f0ab5c38997ae5a9439b0c (diff) |
Give every file that ASTReader loads a type: module, PCH, precompiled preamble or main file. Base Decls' PCHLevel on this to make it more sane.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@115626 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReader.cpp')
-rw-r--r-- | lib/Serialization/ASTReader.cpp | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp index bc898f1676..8413faa65d 100644 --- a/lib/Serialization/ASTReader.cpp +++ b/lib/Serialization/ASTReader.cpp @@ -1746,8 +1746,8 @@ ASTReader::ReadASTBlock(PerFileData &F) { return IgnorePCH; } - // Load the chained file. - switch(ReadASTCore(llvm::StringRef(BlobStart, BlobLen))) { + // Load the chained file, which is always a PCH file. + switch(ReadASTCore(llvm::StringRef(BlobStart, BlobLen), PCH)) { case Failure: return Failure; // If we have to ignore the dependency, we'll have to ignore this too. case IgnorePCH: return IgnorePCH; @@ -2025,8 +2025,9 @@ ASTReader::ReadASTBlock(PerFileData &F) { return Failure; } -ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName) { - switch(ReadASTCore(FileName)) { +ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName, + ASTFileType Type) { + switch(ReadASTCore(FileName, Type)) { case Failure: return Failure; case IgnorePCH: return IgnorePCH; case Success: break; @@ -2124,9 +2125,10 @@ ASTReader::ASTReadResult ASTReader::ReadAST(const std::string &FileName) { return Success; } -ASTReader::ASTReadResult ASTReader::ReadASTCore(llvm::StringRef FileName) { +ASTReader::ASTReadResult ASTReader::ReadASTCore(llvm::StringRef FileName, + ASTFileType Type) { PerFileData *Prev = Chain.empty() ? 0 : Chain.back(); - Chain.push_back(new PerFileData()); + Chain.push_back(new PerFileData(Type)); PerFileData &F = *Chain.back(); if (Prev) Prev->NextInSource = &F; @@ -4215,8 +4217,8 @@ ASTReader::~ASTReader() { } } -ASTReader::PerFileData::PerFileData() - : SizeInBits(0), LocalNumSLocEntries(0), SLocOffsets(0), LocalSLocSize(0), +ASTReader::PerFileData::PerFileData(ASTFileType Ty) + : Type(Ty), SizeInBits(0), LocalNumSLocEntries(0), SLocOffsets(0), LocalSLocSize(0), LocalNumIdentifiers(0), IdentifierOffsets(0), IdentifierTableData(0), IdentifierLookupTable(0), LocalNumMacroDefinitions(0), MacroDefinitionOffsets(0), LocalNumSelectors(0), SelectorOffsets(0), |