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
|
|
|
#ifdef HAVE_VCS_VERSION_INC
|
|
|
|
#include "VCSVersion.inc"
|
|
|
|
#endif
|
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() {
|
2019-02-22 02:37:26 +08:00
|
|
|
#if defined(LLD_REPOSITORY) && defined(LLD_REVISION)
|
|
|
|
return "LLD " LLD_VERSION_STRING " (" LLD_REPOSITORY " " LLD_REVISION ")";
|
|
|
|
#else
|
|
|
|
return "LLD " LLD_VERSION_STRING;
|
|
|
|
#endif
|
2016-10-26 11:52:06 +08:00
|
|
|
}
|