diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-27 22:23:34 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-27 22:23:34 +0000 |
commit | ab41e63821dc60ad144d0684df8d79a9eef86b75 (patch) | |
tree | d6dca3ced09515b1aa4a7e5d024c32c4129bf96b /lib/Frontend/PCHReader.cpp | |
parent | 6bf690fd464b76d35cdf1ac8e4ed693585b36a4d (diff) |
Add a header containing the Clang version; make the driver use this
Clang version value rather than hard-coding "1.0".
Add PCH and Clang version information into the PCH file. Reject PCH
files with the wrong version information.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70264 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 24e4e2b02f..c1cb87bc16 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -928,7 +928,13 @@ PCHReader::ReadPCHBlock() { return IgnorePCH; break; - case pch::TARGET_TRIPLE: { + case pch::METADATA: { + if (Record[0] != pch::VERSION_MAJOR) { + Diag(Record[0] < pch::VERSION_MAJOR? diag::warn_pch_version_too_old + : diag::warn_pch_version_too_new); + return IgnorePCH; + } + std::string TargetTriple(BlobStart, BlobLen); if (TargetTriple != PP.getTargetInfo().getTargetTriple()) { Diag(diag::warn_pch_target_triple) |