1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 21:42:54 +02:00
Go to file
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
bindings [OCaml] Add functions for accessing metadata nodes. 2016-06-22 03:30:24 +00:00
cmake [LLVMConfig.cmake.in] Create a new variable LLVM_CONFIG_EXPORTED_TARGETS that contains the list of all targets exported via LLVMExports.cmake. 2016-06-29 17:32:37 +00:00
docs [Docs][CodeGenerator] Don't specify the number of operands in BuildMI 2016-06-29 14:14:59 +00:00
examples [MCJIT] Update MCJIT and get the fibonacci example working again. 2016-06-11 05:47:04 +00:00
include Resubmit "Update llvm command line parser to support subcommands." 2016-06-29 21:48:26 +00:00
lib Resubmit "Update llvm command line parser to support subcommands." 2016-06-29 21:48:26 +00:00
projects Remove autoconf support 2016-01-26 21:29:08 +00:00
resources
runtimes [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
test Revert r273313 "[NVPTX] Improve lowering of byval args of device functions." 2016-06-29 20:51:15 +00:00
tools Change Archive::create() from ErrorOr<...> to Expected<...> and update 2016-06-29 20:35:44 +00:00
unittests Resubmit "Update llvm command line parser to support subcommands." 2016-06-29 21:48:26 +00:00
utils [lit] Add SANITIZER_IGNORE_CVE_2016_2143 to pass_vars. 2016-06-26 21:49:58 +00:00
.arcconfig
.clang-format
.clang-tidy Don't use misc-unused-parameters check on LLVM. 2016-04-13 08:58:52 +00:00
.gitignore [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
CMakeLists.txt [CMake] Add LLVM runtimes directory 2016-06-23 22:07:21 +00:00
CODE_OWNERS.TXT Sort my entry in CODE_OWNERS.TXT 2016-05-26 23:10:37 +00:00
configure Remove autoconf support 2016-01-26 21:29:08 +00:00
CREDITS.TXT Update my email address. 2016-05-10 16:23:54 +00:00
LICENSE.TXT Update copyright year to 2016. 2016-03-30 22:41:06 +00:00
llvm.spec.in
LLVMBuild.txt
README.txt Revert previous test commit. 2016-01-04 19:13:29 +00:00

Low Level Virtual Machine (LLVM)
================================

This directory and its subdirectories contain source code for LLVM,
a toolkit for the construction of highly optimized compilers,
optimizers, and runtime environments.

LLVM is open source software. You may freely distribute it under the terms of
the license agreement found in LICENSE.txt.

Please see the documentation provided in docs/ for further
assistance with LLVM, and in particular docs/GettingStarted.rst for getting
started with LLVM and docs/README.txt for an overview of LLVM's
documentation setup.

If you are writing a package for LLVM, see docs/Packaging.rst for our
suggestions.