1ece8a530Spatrick //===- lib/Common/Version.cpp - LLD Version Number ---------------*- C++-=====// 2ece8a530Spatrick // 3ece8a530Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4ece8a530Spatrick // See https://llvm.org/LICENSE.txt for license information. 5ece8a530Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6ece8a530Spatrick // 7ece8a530Spatrick //===----------------------------------------------------------------------===// 8ece8a530Spatrick // 9ece8a530Spatrick // This file defines several version-related utility functions for LLD. 10ece8a530Spatrick // 11ece8a530Spatrick //===----------------------------------------------------------------------===// 12ece8a530Spatrick 13ece8a530Spatrick #include "lld/Common/Version.h" 14ece8a530Spatrick 15ece8a530Spatrick #include "VCSVersion.inc" 16ece8a530Spatrick 17ece8a530Spatrick // Returns a version string, e.g.: 18*dfe94b16Srobert // LLD 14.0.0 (https://github.com/llvm/llvm-project.git 19*dfe94b16Srobert // 2d9759c7902c5cbc9a7e3ab623321d5578d51687) getLLDVersion()20ece8a530Spatrickstd::string lld::getLLDVersion() { 21bb684c34Spatrick #ifdef LLD_VENDOR 22bb684c34Spatrick #define LLD_VENDOR_DISPLAY LLD_VENDOR " " 23ece8a530Spatrick #else 24bb684c34Spatrick #define LLD_VENDOR_DISPLAY 25ece8a530Spatrick #endif 26bb684c34Spatrick return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING; 27bb684c34Spatrick #undef LLD_VENDOR_DISPLAY 28ece8a530Spatrick } 29