brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 59183c7 Raw
34 lines · cpp
1//===- lib/Common/Version.cpp - LLD Version Number ---------------*- C++-=====//2//3// 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-exception6//7//===----------------------------------------------------------------------===//8//9// This file defines several version-related utility functions for LLD.10//11//===----------------------------------------------------------------------===//12 13#include "lld/Common/Version.h"14#include "VCSVersion.inc"15#include "llvm/Support/VCSRevision.h"16 17// Returns a version string, e.g.:18// LLD 14.0.0 (https://github.com/llvm/llvm-project.git19// 2d9759c7902c5cbc9a7e3ab623321d5578d51687)20std::string lld::getLLDVersion() {21#ifdef LLD_VENDOR22#define LLD_VENDOR_DISPLAY LLD_VENDOR " "23#else24#define LLD_VENDOR_DISPLAY25#endif26#if defined(LLVM_REPOSITORY) && defined(LLVM_REVISION)27  return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING " (" LLVM_REPOSITORY28                            " " LLVM_REVISION ")";29#else30  return LLD_VENDOR_DISPLAY "LLD " LLD_VERSION_STRING;31#endif32#undef LLD_VENDOR_DISPLAY33}34