Rui Ueyama | 3f85170 | 2017-10-02 21:00:41 +0000 | [diff] [blame] | 1 | //===- lib/Common/Version.cpp - LLD Version Number ---------------*- C++-=====// |
Shankar Easwaran | c3550f9 | 2014-10-08 03:47:51 +0000 | [diff] [blame] | 2 | // |
Chandler Carruth | 2946cd7 | 2019-01-19 08:50:56 +0000 | [diff] [blame] | 3 | // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | // See https://llvm.org/LICENSE.txt for license information. |
| 5 | // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
Shankar Easwaran | c3550f9 | 2014-10-08 03:47:51 +0000 | [diff] [blame] | 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | // |
| 9 | // This file defines several version-related utility functions for LLD. |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
Rui Ueyama | 3f85170 | 2017-10-02 21:00:41 +0000 | [diff] [blame] | 13 | #include "lld/Common/Version.h" |
Shankar Easwaran | c3550f9 | 2014-10-08 03:47:51 +0000 | [diff] [blame] | 14 | |
Rui Ueyama | 04661e1 | 2019-02-21 18:37:26 +0000 | [diff] [blame] | 15 | #ifdef HAVE_VCS_VERSION_INC |
| 16 | #include "VCSVersion.inc" |
| 17 | #endif |
Shankar Easwaran | c3550f9 | 2014-10-08 03:47:51 +0000 | [diff] [blame] | 18 | |
Rui Ueyama | 04661e1 | 2019-02-21 18:37:26 +0000 | [diff] [blame] | 19 | // Returns a version string, e.g.: |
| 20 | // lld 9.0.0 (https://github.com/llvm/llvm-project.git 9efdd7ac5e914d3c9fa1ef) |
Rui Ueyama | 80695c1 | 2016-10-26 03:52:06 +0000 | [diff] [blame] | 21 | std::string lld::getLLDVersion() { |
Rui Ueyama | 04661e1 | 2019-02-21 18:37:26 +0000 | [diff] [blame] | 22 | #if defined(LLD_REPOSITORY) && defined(LLD_REVISION) |
| 23 | return "LLD " LLD_VERSION_STRING " (" LLD_REPOSITORY " " LLD_REVISION ")"; |
| 24 | #else |
| 25 | return "LLD " LLD_VERSION_STRING; |
| 26 | #endif |
Rui Ueyama | 80695c1 | 2016-10-26 03:52:06 +0000 | [diff] [blame] | 27 | } |