[llvm-commits] [lld] r172204 - in /lld/trunk: include/lld/Driver/LinkerOptions.h lib/Driver/CoreOptions.td lib/Driver/Drivers.cpp lib/Driver/LDOptions.td lib/Driver/LinkerInvocation.cpp test/Driver/x86_64-target.test

Shankar Easwaran shankare at codeaurora.org
Fri Jan 11 07:11:48 PST 2013


Author: shankare
Date: Fri Jan 11 09:11:47 2013
New Revision: 172204

URL: http://llvm.org/viewvc/llvm-project?rev=172204&view=rev
Log:
add noinhibit exec option

Removed:
    lld/trunk/test/Driver/x86_64-target.test
Modified:
    lld/trunk/include/lld/Driver/LinkerOptions.h
    lld/trunk/lib/Driver/CoreOptions.td
    lld/trunk/lib/Driver/Drivers.cpp
    lld/trunk/lib/Driver/LDOptions.td
    lld/trunk/lib/Driver/LinkerInvocation.cpp

Modified: lld/trunk/include/lld/Driver/LinkerOptions.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/include/lld/Driver/LinkerOptions.h?rev=172204&r1=172203&r2=172204&view=diff
==============================================================================
--- lld/trunk/include/lld/Driver/LinkerOptions.h (original)
+++ lld/trunk/include/lld/Driver/LinkerOptions.h Fri Jan 11 09:11:47 2013
@@ -116,7 +116,8 @@
     , _entrySymbol(std::move(other._entrySymbol))
     , _relocatable(other._relocatable)
     , _outputCommands(other._outputCommands)
-    , _outputYAML(other._outputYAML) {}
+    , _outputYAML(other._outputYAML)
+    , _noInhibitExec(other._noInhibitExec) {}
 
   std::vector<LinkerInput> _input;
   std::vector<std::string> _llvmArgs;
@@ -127,6 +128,7 @@
   /// \brief -###
   unsigned _outputCommands : 1;
   unsigned _outputYAML : 1;
+  unsigned _noInhibitExec : 1;
 
 private:
   LinkerOptions(const LinkerOptions&) LLVM_DELETED_FUNCTION;

Modified: lld/trunk/lib/Driver/CoreOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/CoreOptions.td?rev=172204&r1=172203&r2=172204&view=diff
==============================================================================
--- lld/trunk/lib/Driver/CoreOptions.td (original)
+++ lld/trunk/lib/Driver/CoreOptions.td Fri Jan 11 09:11:47 2013
@@ -11,3 +11,6 @@
 def OCTOTHORPE_OCTOTHORPE_OCTOTHORPE : Flag<["-"], "###">;
 
 def emit_yaml : Flag<["-"], "emit-yaml">;
+
+def noinhibit_exec : Flag<["-"], "noinhibit-exec">, 
+    HelpText<"Retain the executable output file whenever it is still usable">;

Modified: lld/trunk/lib/Driver/Drivers.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/Drivers.cpp?rev=172204&r1=172203&r2=172204&view=diff
==============================================================================
--- lld/trunk/lib/Driver/Drivers.cpp (original)
+++ lld/trunk/lib/Driver/Drivers.cpp Fri Jan 11 09:11:47 2013
@@ -146,6 +146,9 @@
     if (llvm::opt::Arg *A = _inputArgs->getLastArg(ld::OPT_emit_yaml))
       newArgs->AddFlagArg(A, _core.getOption(core::OPT_emit_yaml));
 
+    if (llvm::opt::Arg *A = _inputArgs->getLastArg(ld::OPT_noinhibit_exec))
+      newArgs->AddFlagArg(A, _core.getOption(core::OPT_noinhibit_exec));
+
     // Copy input args.
     for (llvm::opt::arg_iterator it = _inputArgs->filtered_begin(ld::OPT_INPUT),
                                  ie = _inputArgs->filtered_end();
@@ -228,6 +231,7 @@
   ret._relocatable = args.hasArg(core::OPT_relocatable);
   ret._outputCommands = args.hasArg(core::OPT_OCTOTHORPE_OCTOTHORPE_OCTOTHORPE);
   ret._outputYAML = args.hasArg(core::OPT_emit_yaml);
+  ret._noInhibitExec = args.hasArg(core::OPT_noinhibit_exec);
 
   return std::move(ret);
 }

Modified: lld/trunk/lib/Driver/LDOptions.td
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/LDOptions.td?rev=172204&r1=172203&r2=172204&view=diff
==============================================================================
--- lld/trunk/lib/Driver/LDOptions.td (original)
+++ lld/trunk/lib/Driver/LDOptions.td Fri Jan 11 09:11:47 2013
@@ -23,3 +23,6 @@
 def static : Flag<["-"], "static">;
 
 def L : Joined<["-"], "L">;
+
+def noinhibit_exec : Flag<["--"], "noinhibit-exec">,
+    HelpText<"Retain the executable output file whenever it is still usable">;

Modified: lld/trunk/lib/Driver/LinkerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/Driver/LinkerInvocation.cpp?rev=172204&r1=172203&r2=172204&view=diff
==============================================================================
--- lld/trunk/lib/Driver/LinkerInvocation.cpp (original)
+++ lld/trunk/lib/Driver/LinkerInvocation.cpp Fri Jan 11 09:11:47 2013
@@ -67,11 +67,11 @@
   }
 
   struct Blah : ResolverOptions {
-    Blah()
+    Blah(const LinkerOptions &options)
       : ResolverOptions() {
-      _undefinesAreErrors = true;
+      _undefinesAreErrors = !options._noInhibitExec;
     }
-  } ro;
+  } ro(_options);
 
   auto writer = target->getWriter();
 

Removed: lld/trunk/test/Driver/x86_64-target.test
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/Driver/x86_64-target.test?rev=172203&view=auto
==============================================================================
--- lld/trunk/test/Driver/x86_64-target.test (original)
+++ lld/trunk/test/Driver/x86_64-target.test (removed)
@@ -1,2 +0,0 @@
-# Will fail with unersolved symbol 
-RUN: lld -flavor ld -target x86_64-linux || exit 0 





More information about the llvm-commits mailing list