aboutsummaryrefslogtreecommitdiff
path: root/include/clang/Frontend/PCHBitCodes.h
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-27 22:23:34 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-27 22:23:34 +0000
commitab41e63821dc60ad144d0684df8d79a9eef86b75 (patch)
treed6dca3ced09515b1aa4a7e5d024c32c4129bf96b /include/clang/Frontend/PCHBitCodes.h
parent6bf690fd464b76d35cdf1ac8e4ed693585b36a4d (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 'include/clang/Frontend/PCHBitCodes.h')
-rw-r--r--include/clang/Frontend/PCHBitCodes.h25
1 files changed, 22 insertions, 3 deletions
diff --git a/include/clang/Frontend/PCHBitCodes.h b/include/clang/Frontend/PCHBitCodes.h
index 7f5e7c500f..a4da704386 100644
--- a/include/clang/Frontend/PCHBitCodes.h
+++ b/include/clang/Frontend/PCHBitCodes.h
@@ -22,6 +22,25 @@
namespace clang {
namespace pch {
+ /// \brief PCH major version number supported by this version of
+ /// Clang.
+ ///
+ /// Whenever the PCH format changes in a way that makes it
+ /// incompatible with previous versions (such that a reader
+ /// designed for the previous version could not support reading
+ /// the new version), this number should be increased.
+ const unsigned VERSION_MAJOR = 1;
+
+ /// \brief PCH minor version number supported by this version of
+ /// Clang.
+ ///
+ /// Whenever the PCH format changes in a way that is still
+ /// compatible with previous versions (such that a reader designed
+ /// for the previous version could still support reading the new
+ /// version by ignoring new kinds of subblocks), this number
+ /// should be increased.
+ const unsigned VERSION_MINOR = 0;
+
/// \brief An ID number that refers to a declaration in a PCH file.
///
/// The ID numbers of types are consecutive (in order of
@@ -108,9 +127,9 @@ namespace clang {
/// actually important to check.
LANGUAGE_OPTIONS = 3,
- /// \brief Record code for the target triple used to build the
- /// PCH file.
- TARGET_TRIPLE = 4,
+ /// \brief PCH metadata, including the PCH file version number
+ /// and the target triple used to build the PCH file.
+ METADATA = 4,
/// \brief Record code for the table of offsets of each
/// identifier ID.