Path: blob/main/contrib/llvm-project/lld/Common/Version.cpp
34879 views
//===- lib/Common/Version.cpp - LLD Version Number ---------------*- C++-=====//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file defines several version-related utility functions for LLD.9//10//===----------------------------------------------------------------------===//1112#include "lld/Common/Version.h"13#include "VCSVersion.inc"14#include "llvm/Support/VCSRevision.h"1516// Returns a version string, e.g.:17// LLD 14.0.0 (https://github.com/llvm/llvm-project.git18// 2d9759c7902c5cbc9a7e3ab623321d5578d51687)19std::string lld::getLLDVersion() {20#ifdef LLD_VENDOR21#define LLD_VENDOR_DISPLAY LLD_VENDOR " "22#else23#define LLD_VENDOR_DISPLAY24#endif25#if defined(LLVM_REPOSITORY) && defined(LLVM_REVISION)26return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING " (" LLVM_REPOSITORY27" " LLVM_REVISION ")";28#else29return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING;30#endif31#undef LLD_VENDOR_DISPLAY32}333435