aboutsummaryrefslogtreecommitdiff
path: root/lib/Serialization/ASTReader.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2012-10-18 18:27:37 +0000
committerDouglas Gregor <dgregor@apple.com>2012-10-18 18:27:37 +0000
commit7ae467f02b0f2ba3897ee03e0d011433789b5434 (patch)
tree01353e70f0dc3d33466ae2019806570e65cfc17b /lib/Serialization/ASTReader.cpp
parent7ae5717de7a6a20df60b7b058eb04c2452e39906 (diff)
Collapse the "version control revision/tag" AST file record into the
metadata record, which already had other version information. Clean up the block info block along the way. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@166204 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTReader.cpp')
-rw-r--r--lib/Serialization/ASTReader.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/lib/Serialization/ASTReader.cpp b/lib/Serialization/ASTReader.cpp
index 3d6d31d20e..019e7c1fbd 100644
--- a/lib/Serialization/ASTReader.cpp
+++ b/lib/Serialization/ASTReader.cpp
@@ -1800,6 +1800,13 @@ ASTReader::ASTReadResult ASTReader::ReadControlBlock(ModuleFile &F,
}
RelocatablePCH = Record[4];
+
+ const std::string &CurBranch = getClangFullRepositoryVersion();
+ StringRef ASTBranch(BlobStart, BlobLen);
+ if (StringRef(CurBranch) != ASTBranch && !DisableValidation) {
+ Diag(diag::warn_pch_different_branch) << ASTBranch << CurBranch;
+ return IgnorePCH;
+ }
break;
}
@@ -1877,16 +1884,6 @@ ASTReader::ASTReadResult ASTReader::ReadControlBlock(ModuleFile &F,
OriginalDir.assign(BlobStart, BlobLen);
}
break;
-
- case VERSION_CONTROL_BRANCH_REVISION: {
- const std::string &CurBranch = getClangFullRepositoryVersion();
- StringRef ASTBranch(BlobStart, BlobLen);
- if (StringRef(CurBranch) != ASTBranch && !DisableValidation) {
- Diag(diag::warn_pch_different_branch) << ASTBranch << CurBranch;
- return IgnorePCH;
- }
- break;
- }
}
}
@@ -3069,7 +3066,7 @@ ASTReader::ASTReadResult ASTReader::ReadASTCore(StringRef FileName,
unsigned BlockID = Stream.ReadSubBlockID();
- // We only know the AST subblock ID.
+ // We only know the control subblock ID.
switch (BlockID) {
case llvm::bitc::BLOCKINFO_BLOCK_ID:
if (Stream.ReadBlockInfoBlock()) {