[PATCH] D49318: Give llvm-lib rudimentary help output.

Nico Weber via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 13 13:20:42 PDT 2018


thakis created this revision.
thakis added a reviewer: pcc.

https://reviews.llvm.org/D49318

Files:
  lib/ToolDrivers/llvm-lib/LibDriver.cpp
  lib/ToolDrivers/llvm-lib/Options.td


Index: lib/ToolDrivers/llvm-lib/Options.td
===================================================================
--- lib/ToolDrivers/llvm-lib/Options.td
+++ lib/ToolDrivers/llvm-lib/Options.td
@@ -12,7 +12,11 @@
 def libpath: P<"libpath", "Object file search path">;
 def out    : P<"out", "Path to file to write output">;
 
-def llvmlibthin : F<"llvmlibthin">;
+def llvmlibthin : F<"llvmlibthin">,
+    HelpText<"Make .lib point to .obj files instead of copying their contents">;
+
+def help : F<"help">;
+def help_q : Flag<["/?", "-?"], "">, Alias<help>;
 
 //==============================================================================
 // The flags below do nothing. They are defined only for lib.exe compatibility.
Index: lib/ToolDrivers/llvm-lib/LibDriver.cpp
===================================================================
--- lib/ToolDrivers/llvm-lib/LibDriver.cpp
+++ lib/ToolDrivers/llvm-lib/LibDriver.cpp
@@ -121,6 +121,12 @@
   for (auto *Arg : Args.filtered(OPT_UNKNOWN))
     llvm::errs() << "ignoring unknown argument: " << Arg->getSpelling() << "\n";
 
+  // Handle /help
+  if (Args.hasArg(OPT_help)) {
+    Table.PrintHelp(outs(), ArgsArr[0], "LLVM Lib");
+    return 0;
+  }
+
   // If no input files, silently do nothing to match lib.exe.
   if (!Args.hasArgNoClaim(OPT_INPUT))
     return 0;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D49318.155470.patch
Type: text/x-patch
Size: 1317 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180713/c384b2e8/attachment.bin>


More information about the llvm-commits mailing list