blob: ae10f2f28b2296bda6e64cdc6008817a50af6730 [file] [log] [blame]
Rui Ueyama3f851702017-10-02 21:00:41 +00001//===- lib/Common/Version.cpp - LLD Version Number ---------------*- C++-=====//
Shankar Easwaranc3550f92014-10-08 03:47:51 +00002//
Chandler Carruth2946cd72019-01-19 08:50:56 +00003// 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 Easwaranc3550f92014-10-08 03:47:51 +00006//
7//===----------------------------------------------------------------------===//
8//
9// This file defines several version-related utility functions for LLD.
10//
11//===----------------------------------------------------------------------===//
12
Rui Ueyama3f851702017-10-02 21:00:41 +000013#include "lld/Common/Version.h"
Shankar Easwaranc3550f92014-10-08 03:47:51 +000014
Rui Ueyama04661e12019-02-21 18:37:26 +000015#ifdef HAVE_VCS_VERSION_INC
16#include "VCSVersion.inc"
17#endif
Shankar Easwaranc3550f92014-10-08 03:47:51 +000018
Rui Ueyama04661e12019-02-21 18:37:26 +000019// Returns a version string, e.g.:
20// lld 9.0.0 (https://github.com/llvm/llvm-project.git 9efdd7ac5e914d3c9fa1ef)
Rui Ueyama80695c12016-10-26 03:52:06 +000021std::string lld::getLLDVersion() {
Rui Ueyama04661e12019-02-21 18:37:26 +000022#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 Ueyama80695c12016-10-26 03:52:06 +000027}