2017-10-03 05:00:41 +08:00
|
|
|
//===- lib/Common/Version.cpp - LLD Version Number ---------------*- C++-=====//
|
2014-10-08 11:47:51 +08:00
|
|
|
//
|
2019-01-19 16:50:56 +08:00
|
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2014-10-08 11:47:51 +08:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file defines several version-related utility functions for LLD.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2017-10-03 05:00:41 +08:00
|
|
|
#include "lld/Common/Version.h"
|
2014-10-08 11:47:51 +08:00
|
|
|
|
2019-02-22 02:37:26 +08:00
|
|
|
#include "VCSVersion.inc"
|
2014-10-08 11:47:51 +08:00
|
|
|
|
2019-02-22 02:37:26 +08:00
|
|
|
// Returns a version string, e.g.:
|
|
|
|
// lld 9.0.0 (https://github.com/llvm/llvm-project.git 9efdd7ac5e914d3c9fa1ef)
|
2016-10-26 11:52:06 +08:00
|
|
|
std::string lld::getLLDVersion() {
|
2020-05-12 06:33:55 +08:00
|
|
|
#ifdef LLD_VENDOR
|
|
|
|
#define LLD_VENDOR_DISPLAY LLD_VENDOR " "
|
|
|
|
#else
|
|
|
|
#define LLD_VENDOR_DISPLAY
|
|
|
|
#endif
|
2019-02-22 02:37:26 +08:00
|
|
|
#if defined(LLD_REPOSITORY) && defined(LLD_REVISION)
|
2020-05-12 06:33:55 +08:00
|
|
|
return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING " (" LLD_REPOSITORY
|
|
|
|
" " LLD_REVISION ")";
|
2019-02-22 02:37:26 +08:00
|
|
|
#else
|
2020-05-12 06:33:55 +08:00
|
|
|
return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING;
|
2019-02-22 02:37:26 +08:00
|
|
|
#endif
|
2020-05-12 06:33:55 +08:00
|
|
|
#undef LLD_VENDOR_DISPLAY
|
2016-10-26 11:52:06 +08:00
|
|
|
}
|