1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
llvm-mirror/unittests
Zachary Turner 873731b063 Resubmit "Update llvm command line parser to support subcommands."
This fixes an issue where occurrence counts would be unexpectedly
reset when parsing different parts of a command line multiple
times.

**ORIGINAL COMMIT MESSAGE**

This allows command line tools to use syntaxes like the following:

      llvm-foo.exe command1 -o1 -o2
      llvm-foo.exe command2 -p1 -p2

Where command1 and command2 contain completely different sets of
valid options.  This is backwards compatible with previous uses
of llvm cl which did not support subcommands, as any option
which specifies no optional subcommand (e.g. all existing
code) goes into a special "top level" subcommand that expects
dashed options to appear immediately after the program name.
For example, code which is subcommand unaware would generate
a command line such as the following, where no subcommand
is specified:

      llvm-foo.exe -q1 -q2

The top level subcommand can co-exist with actual subcommands,
as it is implemented as an actual subcommand which is searched
if no explicit subcommand is specified.  So llvm-foo.exe as
specified above could be written so as to support all three
aforementioned command lines simultaneously.

There is one additional "special" subcommand called AllSubCommands,
which can be used to inject an option into every subcommand.
This is useful to support things like help, so that commands
such as:

      llvm-foo.exe --help
      llvm-foo.exe command1 --help
      llvm-foo.exe command2 --help

All work and display the help for the selected subcommand
without having to explicitly go and write code to handle each
one separately.

This patch is submitted without an example of anything actually
using subcommands, but a followup patch will convert the
llvm-pdbdump tool to use subcommands.

Reviewed By: beanz

llvm-svn: 274171
2016-06-29 21:48:26 +00:00
..
ADT [Triple] Reimplement isLittleEndian(). Now it works for arm too. 2016-06-29 20:01:39 +00:00
Analysis [PM] Sink the module parsing from the fixture to the test as subsequent 2016-06-28 00:38:42 +00:00
AsmParser Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
Bitcode Remove every uses of getGlobalContext() in LLVM (but the C API) 2016-04-14 21:59:01 +00:00
CodeGen Remove autoconf support 2016-01-26 21:29:08 +00:00
DebugInfo DebugInfoPDBTests:MappedBlockStreamTest.TestWriteThenRead: Avoid assigning temporary object to ArrayRef. 2016-06-11 06:37:28 +00:00
ExecutionEngine [Orc] Add conversion to/from RuntimeDyld::SymbolInfo for JITSymbol. 2016-05-31 23:14:26 +00:00
IR IR: Allow metadata attachments on declarations, and fix lazy loaded metadata issue with globals. 2016-06-21 23:42:48 +00:00
LineEditor Remove autoconf support 2016-01-26 21:29:08 +00:00
Linker Remangle intrinsics names when types are renamed 2016-06-24 15:10:29 +00:00
MC Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
MI LiveIntervalAnalysis: findLastUseBefore() must ignore undef uses. 2016-06-11 00:31:28 +00:00
ObjectYAML Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00
Option Option parser: class for consuming a joined arg in addition to all remaining args 2016-04-15 00:23:30 +00:00
ProfileData Remove specializations of ProfileSummary 2016-05-19 21:53:28 +00:00
Support Resubmit "Update llvm command line parser to support subcommands." 2016-06-29 21:48:26 +00:00
Transforms IR: New representation for CFI and virtual call optimization pass metadata. 2016-06-24 21:21:32 +00:00
CMakeLists.txt Move ObjectYAML code to a new library. 2016-03-01 19:15:06 +00:00