1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00
llvm-mirror/unittests
Fangrui Song 3744006268 [OptTable] Support grouped short options
POSIX.1-2017 12.2 Utility Syntax Guidelines, Guideline 5 says:

> One or more options without option-arguments, followed by at most one option that takes an option-argument, should be accepted when grouped behind one '-' delimiter.

i.e. -abc represents -a -b -c. The grouped short options are very common.  Many
utilities extend the syntax by allowing (an option with an argument) following a
sequence of short options.

This patch adds the support to OptTable, similar to cl::Group for CommandLine
(D58711).  llvm-symbolizer will use the feature (D83530). CommandLine is exotic
in some aspects. OptTable is preferred if the user wants to get rid of the
behaviors.

* `cl::opt<bool> i(...)` can be disabled via -i=false or -i=0, which is
  different from conventional --no-i.
* Handling --foo & --no-foo requires a comparison of argument positions,
  which is a bit clumsy in user code.

OptTable::parseOneArg (non-const reference InputArgList) is added along with
ParseOneArg (const ArgList &). The duplicate does not look great at first
glance. However, The implementation can be simpler if ArgList is mutable.
(ParseOneArg is used by clang-cl (FlagsToInclude/FlagsToExclude) and lld COFF
(case-insensitive). Adding grouped short options can make the function even more
complex.)

The implementation allows a long option following a group of short options. We
probably should refine the code to disallow this in the future. Allowing this
seems benign for now.

Reviewed By: grimar, jhenderson

Differential Revision: https://reviews.llvm.org/D83639
2020-07-17 09:32:43 -07:00
..
ADT Add hashing support for std::tuple 2020-07-16 19:01:25 +02:00
Analysis [llvm] Moved InlineSizeEstimatorAnalysis test to .ll 2020-07-16 12:25:16 -07:00
AsmParser [SVE] Remove calls to VectorType::getNumElements from AsmParserTest 2020-07-07 14:55:42 -07:00
BinaryFormat [BinaryFormat] Add formatv support for DW_OP constants 2020-06-08 15:27:44 +02:00
Bitcode [strictfp] Replace dangling strictfp attrs with nobuiltin 2020-06-15 10:05:35 -04:00
Bitstream [Bitcode] Move Bitstream to a separate library 2019-07-03 22:40:07 +00:00
CodeGen GlobalISel: Add unit tests for some utils functions 2020-06-24 12:00:38 -04:00
DebugInfo [DebugInfo] Add unit tests for DWARFListTableHeader::length(). 2020-07-14 16:35:17 +07:00
Demangle
ExecutionEngine [ORC] Share ownership of JITDylibs between ExecutionSession and 2020-05-10 16:37:17 -07:00
Frontend [OpenMPIRBuilder][Fix] Move llvm::omp::types to OpenMPIRBuilder. 2020-07-08 17:23:55 +02:00
FuzzMutate [SVE] Deprecate default false variant of VectorType::get 2020-06-16 15:16:11 -07:00
IR [SVE] Make cstfp_pred_ty and cst_pred_ty work with scalable splats 2020-07-14 14:20:39 -07:00
LineEditor
Linker [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
MC [AIX][XCOFF] add symbol priority for the llvm-objdump -D -symbol-description 2020-05-29 11:08:51 -04:00
MI LIS: fix handleMove to properly extend main range 2020-07-07 11:52:32 -07:00
Object [ELF] Fixing an issue in Elf_Note_Impl::getDescAsStringRef 2020-06-16 10:08:31 +00:00
ObjectYAML [DWARFYAML][unittest] Refactor parseDWARFYAML(). 2020-07-09 12:00:22 +08:00
Option [OptTable] Support grouped short options 2020-07-17 09:32:43 -07:00
Passes Don't export symbols from clang/opt/llc if plugins are disabled. 2020-03-23 12:17:09 -07:00
ProfileData [PGO] Extend the value profile buckets for mem op sizes. 2020-07-15 10:26:15 -07:00
Remarks [Remarks] Fix error message check in unit test 2019-10-31 15:51:36 -07:00
Support [Support] Fix Windows directory_iterator_construct out of bounds 2020-07-15 10:13:45 +01:00
TableGen Make unittests include path relative 2020-02-21 10:19:11 +01:00
Target [ARM] Remove hasSideEffects from FP converts 2020-07-05 16:23:24 +01:00
TextAPI [llvm][TextAPI/MachO] clean up auto usages in tests, NFC 2020-06-15 19:59:42 -07:00
tools [llvm-exegesis][NFC] Let the pfm::Counter own the PerfHelper. 2020-04-08 15:37:30 +02:00
Transforms [Attributor] Fix build of unittest with DBUILD_SHARED_LIBS=True 2020-07-15 05:05:31 +01:00
XRay Use std::foo_t rather than std::foo in LLVM. 2020-02-11 15:12:51 -08:00
CMakeLists.txt CMake: Make most target symbols hidden by default 2020-01-14 19:46:52 -08:00
unittest.cfg.in