[lld][Darwin] fixing an accidentally removed change
authorShankar Easwaran <shankare@codeaurora.org>
Wed, 21 Aug 2013 23:31:58 +0000 (23:31 +0000)
committerShankar Easwaran <shankare@codeaurora.org>
Wed, 21 Aug 2013 23:31:58 +0000 (23:31 +0000)
llvm-svn: 188963

lld/lib/Driver/DarwinLdDriver.cpp

index 90469d8..8ebbb8c 100644 (file)
@@ -208,6 +208,16 @@ bool DarwinLdDriver::parse(int argc, const char *argv[],
 
   ctx.setInputGraph(std::move(inputGraph));
 
+  // Handle -help
+  if (parsedArgs->getLastArg(OPT_help)) {
+    table.PrintHelp(llvm::outs(), argv[0], "LLVM Darwin Linker", false);
+    // If only -help on command line, don't try to do any linking
+    if ( argc == 2 ) {
+      ctx.setDoNothing(true);
+      return false;
+    }
+  }
+
   // Validate the combination of options used.
   if (ctx.validate(diagnostics))
     return true;