[PATCH] Add support to print version.

Shankar Kalpathi Easwaran shankarke at gmail.com
Tue Oct 7 10:57:56 PDT 2014


================
Comment at: CMakeLists.txt:99
@@ +98,3 @@
+
+  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLD_SOURCE_DIR}
+                  OUTPUT_VARIABLE LLD_REPOSITORY)
----------------
ruiu wrote:
> I don't think we need this. It's always https://llvm.org/svn/llvm-project/lld/trunk.
Its a standard thing followed by other projects like lldb/clang. 

================
Comment at: include/lld/Config/Version.h:1
@@ +1,2 @@
+//===- Version.h - LLD Version Number ---------------------------*- C++ -*-===//
+//
----------------
ruiu wrote:
> lib/Config/Version.h
Sure.

================
Comment at: include/lld/Config/Version.h:45
@@ +44,3 @@
+/// the information in getLLDRepositoryPath() and getLLDRevision().
+std::string getLLDRepositoryVersion();
+
----------------
ruiu wrote:
> We could print out revision number along with the version number like "version 3.5 (r205863)". I don't see the reason to print out repository name. Remove it?
Same thing the style is followed by clang/lldb as well. so kept it consistent.

lldb --version 2>/dev/null
lldb version 3.6.0 ( https://llvm.org/svn/llvm-project/lldb/trunk revision  218537)



================
Comment at: lib/Config/Version.cpp:24
@@ +23,3 @@
+StringRef getLLDRepositoryPath() {
+#ifdef LLD_REPOSITORY_STRING
+  return LLD_REPOSITORY_STRING;
----------------
ruiu wrote:
> It's always defined, no?
The repository path and the version is empty on windows. Its a TODO. 

================
Comment at: lib/Driver/UniversalDriver.cpp:194
@@ +193,3 @@
+  if (parsedArgs->getLastArg(OPT_version)) {
+    diagnostics << "LLVM Linker Version : " << getLLDVersion() << "\n";
+    return true;
----------------
ruiu wrote:
> Remove space before :.
ok.

http://reviews.llvm.org/D5641






More information about the llvm-commits mailing list