[PATCH] Add support to print version.

Rui Ueyama ruiu at google.com
Tue Oct 7 10:51:48 PDT 2014


Please write more descriptive commit message for this patch.
Something like "Add -version option to the universal driver to
print out LLD version and SVN revision number.".

================
Comment at: CMakeLists.txt:99
@@ +98,3 @@
+
+  execute_process(COMMAND ${CMAKE_SOURCE_DIR}/utils/GetRepositoryPath ${LLD_SOURCE_DIR}
+                  OUTPUT_VARIABLE LLD_REPOSITORY)
----------------
I don't think we need this. It's always https://llvm.org/svn/llvm-project/lld/trunk.

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

================
Comment at: include/lld/Config/Version.h:45
@@ +44,3 @@
+/// the information in getLLDRepositoryPath() and getLLDRevision().
+std::string getLLDRepositoryVersion();
+
----------------
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?

================
Comment at: lib/Config/Version.cpp:1
@@ +1,2 @@
+//===- Version.cpp - LLD Version Number --------------------------*- C++-=====//
+//
----------------
lib/Config/Version.cpp.

================
Comment at: lib/Config/Version.cpp:24
@@ +23,3 @@
+StringRef getLLDRepositoryPath() {
+#ifdef LLD_REPOSITORY_STRING
+  return LLD_REPOSITORY_STRING;
----------------
It's always defined, no?

================
Comment at: lib/Config/Version.cpp:32
@@ +31,3 @@
+StringRef getLLDRevision() {
+#ifdef LLD_REVISION_STRING
+  return LLD_REVISION_STRING;
----------------
Ditto

================
Comment at: lib/Config/Version.cpp:39
@@ +38,3 @@
+
+std::string getLLDRepositoryVersion() {
+  std::string buf;
----------------
Remove?

================
Comment at: lib/Config/Version.cpp:59
@@ +58,3 @@
+StringRef getLLDVersion() {
+#ifdef LLD_VERSION_STRING
+  return LLD_VERSION_STRING;
----------------
Ditto

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

http://reviews.llvm.org/D5641






More information about the llvm-commits mailing list