The attached patch adds llvm/Version.h, which provides the following defines:<div><br></div><div>LLVM_VERSION_MAJOR, LLVM_VERSION_MINOR - The major and minor LLVM version *numbers*.</div><div>LLVM_VERSION_BRANCH - The LLVM branch. The intent is for this to be blank for released versions or "svn".</div>
<div>LLVM_API_VERSION - An arbitrary number identifying the API version.</div><div><br></div><div>The purpose of these macros is to support clients who wish to be able to compile with different versions of LLVM. We currently have no defines to support this. </div>
<div><br></div><div>The macros are defined in the configure script and need to be manually updated. They are adjacent to the other code which needs to be manually updated; my autoconf foo is not sophisticated enough to derive them from the version string.</div>
<div><br></div><div>The API_VERSION is designed to support this behavior at a finer grained level than releases. Its success depends on a cooperative policy where API changes imply a  bump of this value. I believe Tanya has encourage developers to clearly mark what are API changes, with limited success. Making LLVM_API_VERSION successful requires people (or reviewers) to actively (a) recognize when they make an API change, and (b) bump the value.</div>
<div><br></div><div>Although this requires a bit more care, this has the following benefits:</div><div>(1) API changes are clearly marked; they are commits which update LLVM_API_VERSION.</div><div><br></div><div>(2) Reviewing API changes between releases is simplified, the revision log for Version.h can be consulted.</div>
<div><br></div><div>(3) Clients gain additional flexibility in tracking TOT. This has been important for me in the past on the klee project, where I would like to run with a known good LLVM version, but occasionally will test TOT in order to roll that known good version forward. This has historically been a pain since I need to update my code to work with TOT, test it, then roll back my changes if there are issues.</div>
<div><br></div><div>The LLVM_VERSION_* macros are necessary in my opinion. The LLVM_API_VERSION macro can be argued separately if it has opponents.</div><div><br></div><div> - Daniel</div>