aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/Version.cpp
AgeCommit message (Collapse)AuthorFilesLines
2021-12-09[NFC][clang] Return underlying strings directly instead of OS.str()Logan Smith1-3/+3
This avoids an unnecessary copy required by 'return OS.str()', allowing instead for NRVO or implicit move. The .str() call (which flushes the stream) is no longer required since 65b13610a5226b84889b923bae884ba395ad084d, which made raw_string_ostream unbuffered by default. Differential Revision: https://reviews.llvm.org/D115374
2020-10-29Remove HAVE_VCS_VERSION_INC, not neededMarcel Hlopko1-2/+0
This preprocessor define was meant to be used to conditionally include VCSVersion.inc. However, the define was always set, and it was the content of the header that was conditionally generated. Therefore HAVE_VCS_VERSION_INC should be cleaned up. Reviewed By: gribozavr2, MaskRay Differential Revision: https://reviews.llvm.org/D84623
2020-07-08clang: Don't show a trailing space with --version when not built from the repoSylvestre Ledru1-3/+13
Reported here: https://bugs.llvm.org/show_bug.cgi?id=38998#c15 Reviewers: hans Differential Revision: https://reviews.llvm.org/D83386
2020-01-16Remove some SVN-specific code.Nico Weber1-31/+4
$URL$ is an SVN keyword substitution enabled via `svn propset svn:keywords "URL" tools/clang/lib/Basic/Version.cpp`. Now that we no longer use SVN, it's no longer being replaced by anything, and we no longer offer svn exports. So remove the $URL$-specific logic. The "cfe" path prefix removal also no longer makes sense now that we're on git: Both CLANG_REPOSITORY and LLVM_REPOSITORY are usually set to https://github.com/llvm/llvm-project.git So remove that too, and remove the "llvm" prefix removal for symmetry. With the github url, "llvm" _is_ found in the string, but not in the place the function expected. Nobody noticed since the llvm repository path is only used if CLANG_REVISION and LLVM_REVISION are different, which in the git monorepo world they never should be. (I might remove the "// Support LLVM in a separate repository" block in a separate commit.) Differential Revision: https://reviews.llvm.org/D72848
2019-11-08remove redundant LLVM version from version string when setting CLANG_VENDORNick Desaulniers1-5/+0
Summary: When downstream LLVM distributions (like AOSP) set the CLANG_VENDOR cmake variable, the version string printed by the clang driver looks like: $ clang --version [CLANG_VENDOR] clang version X.X.X ([CLANG_REPOSITORY_STRING] sha) (based on LLVM X.X.X) Rather than the more standard: $ clang --version clang version X.X.X ([CLANG_REPOSITORY_STRING] sha) Based on feedback the the version string is a little long, the trailing "(based on LLVM X.X.X)" is redundant and makes less sense after moving LLVM to the monorepo. And it is only added should vendors set the cmake variable CLANG_VENDOR. Let's remove it. Reviewers: jyknight, eli.friedman, rsmith, rjmccall, efriedma Reviewed By: efriedma Subscribers: arphaman, efriedma, cfe-commits, srhines Tags: #clang Differential Revision: https://reviews.llvm.org/D69925
2019-07-13This reverts commit 632a36bfcfc8273c1861f04ff6758d863c47c784.Sylvestre Ledru1-0/+2
Some targets such as Python 2.7.16 still use VERSION in their builds. Without VERSION defined, the source code has syntax errors. Reverting as it will probably break many other things. Noticed by Sterling Augustine llvm-svn: 365992
2019-07-12Remove __VERSION__Sylvestre Ledru1-2/+0
Summary: It has been introduced in 2011 for gcc compat: https://github.com/llvm-mirror/clang/commit/ad1a4c6e89594e704775ddb6b036ac982fd68cad it is probably time to remove it Reviewers: rnk, dexonsmith Reviewed By: rnk Subscribers: dschuff, aheejin, fedor.sergeev, arphaman, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D64062 llvm-svn: 365962
2019-02-06[CMake] Unify scripts for generating VCS headersPetr Hosek1-7/+7
Previously, there were two different scripts for generating VCS headers: one used by LLVM and one used by Clang and lldb. They were both similar, but different. They were both broken in their own ways, for example the one used by Clang didn't properly handle monorepo resulting in an incorrect version information reported by Clang. This change unifies two the scripts by introducing a new script that's used from both LLVM, Clang and lldb, ensures that the new script supports both monorepo and standalone SVN and Git setups, and removes the old scripts. Differential Revision: https://reviews.llvm.org/D57063 llvm-svn: 353268
2019-01-31Revert "[CMake] Unify scripts for generating VCS headers"Petr Hosek1-6/+9
This reverts commits r352729 and r352731: this broke Sanitizer Windows bots llvm-svn: 352733
2019-01-31[CMake] Unify scripts for generating VCS headersPetr Hosek1-9/+6
Previously, there were two different scripts for generating VCS headers: one used by LLVM and one used by Clang. They were both similar, but different. They were both broken in their own ways, for example the one used by Clang didn't properly handle monorepo resulting in an incorrect version information reported by Clang. This change unifies two the scripts by introducing a new script that's used from both LLVM and Clang, ensures that the new script supports both monorepo and standalone SVN and Git setups, and removes the old scripts. Differential Revision: https://reviews.llvm.org/D57063 llvm-svn: 352729
2019-01-19Update the file headers across all of the LLVM projects in the monorepoChandler Carruth1-4/+3
to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
2014-12-10Revert r223578, perf data collection depends on the old symbol name.Paul Robinson1-5/+5
llvm-svn: 223987
2014-12-06Rename a couple of preprocessor symbols to be more descriptive. NFC.Paul Robinson1-5/+5
Review feedback from recent changes to GetSVN.cmake. llvm-svn: 223578
2014-06-06Revert "Revert "Devise a package-private means to determine the LLVM version ↵Alp Toker1-2/+2
string"" We probably just need to touch LLVM's configure this time to work around the totally inadequate Makefile build server integration. This reverts commit r210314. llvm-svn: 210320
2014-06-06Revert "Devise a package-private means to determine the LLVM version string"Alp Toker1-2/+2
This didn't work out on the build servers. Investigating This reverts commit r210313. llvm-svn: 210314
2014-06-06Devise a package-private means to determine the LLVM version stringAlp Toker1-2/+2
This will unbreak clang vendor builds as a follow-up to r210238, now that we can't poke into LLVM's private config.h (nor should the string be exposed by llvm-config.h). This hopefully removes for good the last include of LLVM's config.h. llvm-svn: 210313
2014-06-05Changing this line of code back to the way it was before Alp's config.h ↵Puyan Lotfi1-0/+1
clean up changes. I've already spoken to Alp and he signed off on making this one change, so that our buildbots go green in the short term. llvm-svn: 210238
2014-06-04Remove the last remaining llvm/Config/config.h includesAlp Toker1-1/+0
This corrects long-standing misuses of LLVM's internal config.h. In most cases the public llvm-config.h header was intended and we can now remove the old hacks thanks to LLVM r210144. The config.h header is private, won't be installed and should no longer be included by clang or other modules. llvm-svn: 210145
2014-01-14Remove trailing spacesSylvestre Ledru1-2/+2
llvm-svn: 199199
2014-01-07Shorten the output of `clang-format --version`, include revision number.Nico Weber1-1/+5
Before: $ clang-format --version LLVM (http://llvm.org/): LLVM version 3.5svn Optimized build with assertions. Built Jan 3 2014 (14:28:46). Default target: x86_64-apple-darwin13.0.0 Host CPU: core-avx-i Now: $ bin/clang-format --version clang-format version 3.5 (198452) llvm-svn: 198694
2013-08-09Remove "static" on simple temporary StringRef.Benjamin Kramer1-1/+1
llvm-svn: 188088
2013-03-25<rdar://problem/13358795> Teach CMake to check Subversion version ↵Douglas Gregor1-0/+4
information at build time, not configure time. llvm-svn: 177939
2012-12-04Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth1-2/+2
uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
2012-05-26Only emit one set of braces for __VERSION__, getClangFullRepositoryVersion ↵Benjamin Kramer1-2/+1
already adds some. No test as the output is highly dependend on the local configuration. llvm-svn: 157520
2012-03-07More git-svn compatible version string, by request.Andrew Trick1-11/+18
If you're using git-svn, the clang and llvm repository will typically map to a different revision. Before we had: clang version 3.1 (trunk 152167 trunk 152162) After this change: clang version 3.1 (trunk 152167) (llvm/trunk 152162) So it's self-descriptive with an extra parens group. Which is more compatible with version string parsers is probably debatable, but this style was requested. llvm-svn: 152183
2012-03-02clang -v support for separate clang.git and llvm.git, patch by Andrew Trick.Jia Liu1-2/+33
llvm-svn: 151910
2011-12-26Partially revert r147195; lib/Basic/Version.cpp conditionally depends on ↵Eli Friedman1-0/+1
config.h. llvm-svn: 147282
2011-12-22remove unneeded config.h includesDylan Noblesmith1-1/+0
llvm-svn: 147195
2011-07-23remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner1-4/+5
LLVM.h imports them into the clang namespace. llvm-svn: 135852
2011-04-23Like the coding standards say, do not use "using namespace std".Jay Foad1-2/+0
llvm-svn: 130054
2011-03-31Change Clang's __VERSION__ to include the same basic info as in clang -v.Daniel Dunbar1-0/+13
- Please never ever ever ever write a tool that sniffs this. llvm-svn: 128599
2011-03-31Basic: Add support for a build variable to set the repository path that goesDaniel Dunbar1-0/+4
into the Clang version. llvm-svn: 128595
2010-10-11Basic: Tweak attempt to make version tags work from 'svn export's again, clipDaniel Dunbar1-2/+4
off the extra parts of the $URL$ SVN keyword. llvm-svn: 116269
2010-10-11Basic: Attempt to make version tags work from 'svn export's again.Daniel Dunbar1-0/+6
llvm-svn: 116268
2010-10-07Driver: When clang is built with a VENDOR set, include the base LLVM version inDaniel Dunbar1-0/+7
the version information, to help prevent user confusion about vendor version numbers vs. LLVM version numbers. llvm-svn: 115915
2010-09-29Basic: Simplify getClangRepositoryPath and getClangRevision.Daniel Dunbar1-25/+18
- I don't like returning StringRef's ever, unless it is actually important for performance, which it isn't here. - Also, stop validating getClangRevision to be an integer, I don't see a good reason to do this. llvm-svn: 115071
2010-09-29Basic: Add support for git svn to get the repo version in clang executable,Daniel Dunbar1-19/+25
patch by Jonathan Mulder! llvm-svn: 115049
2010-05-06Basic: Update getClangRepositoryPath for my change to integration branch layout.Daniel Dunbar1-1/+2
llvm-svn: 103192
2010-03-05Make sure the raw_string_ostream gets flushed so we don't accidentally ↵Benjamin Kramer1-3/+3
return an empty string. llvm-svn: 97809
2010-03-03Use SVN_REVISION, not SVN_VERSION.Ted Kremenek1-1/+1
llvm-svn: 97625
2010-03-03Make getClangRevision() check that SVN_VERSION is an empty string Ted Kremenek1-8/+8
(even if it is defined). This fixes the issue of this function returning '0' when SVN_VERSION is defined to be "". Fixes: <rdar://problem/7663667> llvm-svn: 97620
2010-02-12Fix bug I introduced with assinging a temporary to a StringRef.Ted Kremenek1-1/+1
llvm-svn: 96041
2010-02-12Make the following functions thread-safe but having them return an ↵Ted Kremenek1-27/+20
std::string that is reconstructed every time they are called: getClangRevision() getClangFullRepositoryVersion() getClangFullVersion() llvm-svn: 96033
2010-01-30We don't need to place 0 in the URL string now that we return a StringRef.Benjamin Kramer1-18/+13
- URL can go into read only memory now. - Compilers will fold away all the strstr calls. llvm-svn: 94887
2010-01-23Rename getClangFullVendorVersion() to getClangFullVersion().Ted Kremenek1-1/+1
llvm-svn: 94273
2010-01-22Add 'clang_getClangVersion()' function to CIndex. This exposes the full ↵Ted Kremenek1-2/+2
Clang version string through the CIndex API. llvm-svn: 94242
2010-01-22Move version string generation (e.g., "clang 1.1 ...") to ↵Ted Kremenek1-6/+19
libBasic/Version.cpp, getClangFullVendorVersion(). llvm-svn: 94235
2010-01-22(1) Rename getClangSubversionRevision() to getClangRevision(), andTed Kremenek1-3/+21
have it return a StringRef instead of an integer (to be more VCS agnostic). (2) Add getClangFullRepositoryVersion(), which contains an amalgamation of the repository name and the revision. (3) Change PCH to only emit the string returned by getClangFullRepositoryVersion() instead of also emitting the value of getClangSubversionRevision() (which has been removed). This is functionally equivalent. More cleanup to version string generation pending... llvm-svn: 94231
2010-01-22Rename getClangSubversionPath() -> getClangRepositoryPath() and have it ↵Ted Kremenek1-1/+4
return a StringRef. llvm-svn: 94213
2009-11-05Strip off the /clang/tools/clang at the end of the Subversion URL, if it's thereDouglas Gregor1-0/+4
llvm-svn: 86195