[PATCH] D86509: [LLD][MinGW] Cleanup Options.td file

Mateusz MikuĊ‚a via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 00:40:36 PDT 2020


mati865 created this revision.
mati865 added a reviewer: mstorsjo.
mati865 added a project: lld.
Herald added subscribers: llvm-commits, dang.
Herald added a project: LLVM.
mati865 requested review of this revision.

Based on ELF driver Options.td


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86509

Files:
  lld/MinGW/Options.td


Index: lld/MinGW/Options.td
===================================================================
--- lld/MinGW/Options.td
+++ lld/MinGW/Options.td
@@ -16,6 +16,11 @@
     HelpText<help>;
 }
 
+multiclass B<string name, string help1, string help2> {
+  def NAME: Flag<["--", "-"], name>, HelpText<help1>;
+  def no_ # NAME: Flag<["--", "-"], "no-" # name>, HelpText<help2>;
+}
+
 def L: JoinedOrSeparate<["-"], "L">, MetaVarName<"<dir>">,
   HelpText<"Add a directory to the library search path">;
 def Bdynamic: F<"Bdynamic">, HelpText<"Link against shared libraries">;
@@ -35,12 +40,15 @@
 def export_all_symbols: F<"export-all-symbols">,
     HelpText<"Export all symbols even if a def file or dllexport attributes are used">;
 defm file_alignment: Eq<"file-alignment", "Set file alignment">;
-def gc_sections: F<"gc-sections">, HelpText<"Remove unused sections">;
+defm gc_sections: B<"gc-sections",
+    "Remove unused sections",
+    "Don't remove unused sections">;
 def help: F<"help">, HelpText<"Print option help">;
 def icf: J<"icf=">, HelpText<"Identical code folding">;
 def image_base: S<"image-base">, HelpText<"Base address of the program">;
-def insert_timestamp: F<"insert-timestamp">,
-    HelpText<"Include PE header timestamp">;
+defm insert_timestamp: B<"insert-timestamp",
+    "Include PE header timestamp",
+    "Don't include PE header timestamp">;
 def kill_at: F<"kill-at">, HelpText<"Remove @n from exported symbols">;
 def l: JoinedOrSeparate<["-"], "l">, MetaVarName<"<libName>">,
   HelpText<"Root name of library to use">;
@@ -54,14 +62,9 @@
      "Set the OS and subsystem minor version">;
 defm minor_subsystem_version: EqLong<"minor-subsystem-version",
      "Set the OS and subsystem minor version">;
-def no_insert_timestamp: F<"no-insert-timestamp">,
-    HelpText<"Don't include PE header timestamp">;
 def no_seh: F<"no-seh">, HelpText<"Set the 'no SEH' flag in the executable">;
-def no_whole_archive: F<"no-whole-archive">,
-    HelpText<"No longer include all object files for following archives">;
 def large_address_aware: Flag<["--"], "large-address-aware">,
     HelpText<"Enable large addresses">;
-def no_gc_sections: F<"no-gc-sections">, HelpText<"Don't remove unused sections">;
 def o: JoinedOrSeparate<["-"], "o">, MetaVarName<"<path>">,
   HelpText<"Path to file to write output">;
 defm out_implib: Eq<"out-implib", "Import library name">;
@@ -76,8 +79,9 @@
     HelpText<"Omit all debug information, but keep symbol information">;
 defm reproduce: Eq<"reproduce", "Write a tar file containing input files and command line options to reproduce link">;
 defm undefined: Eq<"undefined", "Include symbol in the link, if available">;
-def whole_archive: F<"whole-archive">,
-    HelpText<"Include all object files for following archives">;
+defm whole_archive: B<"whole-archive",
+    "Include all object files for following archives",
+    "No longer include all object files for following archives">;
 def v: Flag<["-"], "v">, HelpText<"Display the version number">;
 def verbose: F<"verbose">, HelpText<"Verbose mode">;
 def version: F<"version">, HelpText<"Display the version number and exit">;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86509.287583.patch
Type: text/x-patch
Size: 3150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200825/fff19d33/attachment.bin>


More information about the llvm-commits mailing list