[lld] r249964 - ELF2: Add --verbose.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 10 19:03:04 PDT 2015


Author: ruiu
Date: Sat Oct 10 21:03:03 2015
New Revision: 249964

URL: http://llvm.org/viewvc/llvm-project?rev=249964&view=rev
Log:
ELF2: Add --verbose.

It is currently not actually verbose but rather terse,
but that's intentional.

Modified:
    lld/trunk/ELF/Config.h
    lld/trunk/ELF/Driver.cpp
    lld/trunk/ELF/Options.td

Modified: lld/trunk/ELF/Config.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Config.h?rev=249964&r1=249963&r2=249964&view=diff
==============================================================================
--- lld/trunk/ELF/Config.h (original)
+++ lld/trunk/ELF/Config.h Sat Oct 10 21:03:03 2015
@@ -49,6 +49,7 @@ struct Configuration {
   bool NoUndefined;
   bool Shared;
   bool Static = false;
+  bool Verbose;
   bool ZNow = false;
   ELFKind ElfKind = ELFNoneKind;
   uint16_t EMachine = llvm::ELF::EM_NONE;

Modified: lld/trunk/ELF/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Driver.cpp?rev=249964&r1=249963&r2=249964&view=diff
==============================================================================
--- lld/trunk/ELF/Driver.cpp (original)
+++ lld/trunk/ELF/Driver.cpp Sat Oct 10 21:03:03 2015
@@ -18,6 +18,7 @@
 #include "llvm/ADT/StringExtras.h"
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/raw_ostream.h"
 
 using namespace llvm;
 using namespace llvm::ELF;
@@ -128,6 +129,8 @@ static std::string searchLibrary(StringR
 // Newly created memory buffers are owned by this driver.
 void LinkerDriver::addFile(StringRef Path) {
   using namespace llvm::sys::fs;
+  if (Config->Verbose)
+    llvm::outs() << Path << "\n";
   auto MBOrErr = MemoryBuffer::getFile(Path);
   error(MBOrErr, Twine("cannot open ") + Path);
   std::unique_ptr<MemoryBuffer> &MB = *MBOrErr;
@@ -209,6 +212,7 @@ void LinkerDriver::createFiles(opt::Inpu
   Config->NoInhibitExec = Args.hasArg(OPT_noinhibit_exec);
   Config->NoUndefined = Args.hasArg(OPT_no_undefined);
   Config->Shared = Args.hasArg(OPT_shared);
+  Config->Verbose = Args.hasArg(OPT_verbose);
 
   Config->DynamicLinker = getString(Args, OPT_dynamic_linker);
   Config->Entry = getString(Args, OPT_entry);

Modified: lld/trunk/ELF/Options.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Options.td?rev=249964&r1=249963&r2=249964&view=diff
==============================================================================
--- lld/trunk/ELF/Options.td (original)
+++ lld/trunk/ELF/Options.td Sat Oct 10 21:03:03 2015
@@ -79,6 +79,8 @@ def sysroot : Joined<["--"], "sysroot=">
 def undefined : Joined<["--"], "undefined=">,
   HelpText<"Force undefined symbol during linking">;
 
+def verbose : Flag<["--"], "verbose">;
+
 def whole_archive : Flag<["--"], "whole-archive">,
   HelpText<"Force load of all members in a static library">;
 




More information about the llvm-commits mailing list