1 //===- lib/Config/Version.cpp - LLD Version Number ---------------*- C++-=====//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file defines several version-related utility functions for LLD.
12 //===----------------------------------------------------------------------===//
14 #include "lld/Config/Version.h"
15 #include "llvm/Support/raw_ostream.h"
21 StringRef getLLDRepositoryPath() {
22 #ifdef LLD_REPOSITORY_STRING
23 return LLD_REPOSITORY_STRING;
29 StringRef getLLDRevision() {
30 #ifdef LLD_REVISION_STRING
31 return LLD_REVISION_STRING;
37 std::string getLLDRepositoryVersion() {
38 std::string S = getLLDRepositoryPath();
39 std::string T = getLLDRevision();
40 if (S.empty() && T.empty())
42 if (!S.empty() && !T.empty())
43 return "(" + S + " " + T + ")";
49 StringRef getLLDVersion() {
50 #ifdef LLD_VERSION_STRING
51 return LLD_VERSION_STRING;
57 } // end namespace lld