History log of /llvm-project/llvm/unittests/Support/CommandLineTest.cpp (Results 76 – 100 of 162)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-8.0.1, llvmorg-8.0.1-rc4, llvmorg-8.0.1-rc3
# 64b09245 22-Jun-2019 Don Hinton <hintonda@gmail.com>

Revert [CommandLine] Remove OptionCategory and SubCommand caches from the Option class.

This reverts r364134 (git commit a5b83bc9e3b8e8945b55068c762bd6c73621a4b0)

Caused errors in the asan bot, so

Revert [CommandLine] Remove OptionCategory and SubCommand caches from the Option class.

This reverts r364134 (git commit a5b83bc9e3b8e8945b55068c762bd6c73621a4b0)

Caused errors in the asan bot, so the GeneralCategory global needs to
be changed to ManagedStatic.

Differential Revision: https://reviews.llvm.org/D62105

llvm-svn: 364141

show more ...


# a5b83bc9 22-Jun-2019 Don Hinton <hintonda@gmail.com>

[CommandLine] Remove OptionCategory and SubCommand caches from the Option class.

Summary:
This change processes `OptionCategory`s and `SubCommand`s as they
are seen instead of caching them in the O

[CommandLine] Remove OptionCategory and SubCommand caches from the Option class.

Summary:
This change processes `OptionCategory`s and `SubCommand`s as they
are seen instead of caching them in the Option class and processing
them later. Doing so simplifies the work needed to be done by the Global
parser and significantly reduces the size of the Option class to a mere 64
bytes.

Removing the `OptionCategory` cache saved 24 bytes, and removing
the `SubCommand` cache saved an additional 48 bytes, for a total of a
72 byte reduction.

Reviewers: beanz, zturner, MaskRay, serge-sans-paille

Reviewed By: serge-sans-paille

Subscribers: serge-sans-paille, tstellar, zturner, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D62105

llvm-svn: 364134

show more ...


Revision tags: llvmorg-8.0.1-rc2
# 5062cf59 10-Jun-2019 Shoaib Meenai <smeenai@fb.com>

[Support] Explicitly detect recursive response files

Previous detection relied upon an arbitrary hard coded limit of 21
response files, which some code bases were running up against.

The new detect

[Support] Explicitly detect recursive response files

Previous detection relied upon an arbitrary hard coded limit of 21
response files, which some code bases were running up against.

The new detection maintains a stack of processing response files and
explicitly checks if a newly encountered file is in the current stack.
Some bookkeeping data is necessary in order to detect when to pop the
stack.

Patch by Chris Glover.

Differential Revision: https://reviews.llvm.org/D62798

llvm-svn: 363005

show more ...


Revision tags: llvmorg-8.0.1-rc1
# 8249a888 16-May-2019 Don Hinton <hintonda@gmail.com>

[CommandLine] Don't allow duplicate categories.

Summary:
This is a fix to D61574, r360179, that allowed duplicate
OptionCategory's. This change adds a check to make sure a category can
only be adde

[CommandLine] Don't allow duplicate categories.

Summary:
This is a fix to D61574, r360179, that allowed duplicate
OptionCategory's. This change adds a check to make sure a category can
only be added once even if the user passes it twice.

Reviewed By: MaskRay

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61972

llvm-svn: 360913

show more ...


# 3cce2374 13-May-2019 David L. Jones <dlj@google.com>

[Support] Ensure redirected outputs don't contain output from previous tests.

stdout may be buffered, and may not flush on every write. Explicitly flushing
before redirecting the output ensures that

[Support] Ensure redirected outputs don't contain output from previous tests.

stdout may be buffered, and may not flush on every write. Explicitly flushing
before redirecting the output ensures that the captured output does not contain
output from other tests.

llvm-svn: 360617

show more ...


# 0303e8a3 11-May-2019 Don Hinton <hintonda@gmail.com>

[CommandLine] Add long option flag for cl::ParseCommandLineOptions . Part 5 of 5

Summary:
If passed, the long option flag makes the CommandLine parser
mimic the behavior or GNU getopt_long. Short o

[CommandLine] Add long option flag for cl::ParseCommandLineOptions . Part 5 of 5

Summary:
If passed, the long option flag makes the CommandLine parser
mimic the behavior or GNU getopt_long. Short options are a single
character prefixed by a single dash, and long options are multiple
characters prefixed by a double dash.

This patch was motivated by the discussion in the following thread:
http://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Reviewed By: MaskRay

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61294

llvm-svn: 360532

show more ...


# 102ec097 07-May-2019 Don Hinton <hintonda@gmail.com>

[CommandLine] Allow Options to specify multiple OptionCategory's.

Summary:
It's not uncommon for separate components to share common
Options, e.g., it's common for related Passes to share Options in

[CommandLine] Allow Options to specify multiple OptionCategory's.

Summary:
It's not uncommon for separate components to share common
Options, e.g., it's common for related Passes to share Options in
addition to the Pass specific ones.

With this change, components can use OptionCategory's to simply help
output even if some of the options are shared.

Reviewed By: MaskRay

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61574

llvm-svn: 360179

show more ...


# c242be40 03-May-2019 Don Hinton <hintonda@gmail.com>

[CommandLine] Change help output to prefix long options with `--` instead of `-`. NFC . Part 3 of 5

Summary:
By default, `parseCommandLineOptions()` will accept either a
`-` or `--` prefix for long

[CommandLine] Change help output to prefix long options with `--` instead of `-`. NFC . Part 3 of 5

Summary:
By default, `parseCommandLineOptions()` will accept either a
`-` or `--` prefix for long options -- options with names longer than
a single character.

While this change does not affect behavior, it will be helpful with a
subsequent change that requires long options use the `--` prefix.

Reviewers: rnk, thopre

Reviewed By: thopre

Subscribers: thopre, cfe-commits, hiraditya, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D61269

llvm-svn: 359909

show more ...


# cabf1e22 30-Apr-2019 Don Hinton <hintonda@gmail.com>

[CommandLine} Wire-up cl::list::setDefault() so it will work correctly with cl::ResetAllOptionOccurrences() in unittests. Part 2 of 5

Summary:
With this change, cl::ResetAllOptionOccurrences() clea

[CommandLine} Wire-up cl::list::setDefault() so it will work correctly with cl::ResetAllOptionOccurrences() in unittests. Part 2 of 5

Summary:
With this change, cl::ResetAllOptionOccurrences() clears
cl::list just like cl::opt, allowing users to call
cl::ParseCommandLineOptions() multiple times without interference from
previous calls.

Reviewers: rnk

Reviewed By: rnk

Subscribers: llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61234

llvm-svn: 359522

show more ...


# 1826095a 16-Apr-2019 Shoaib Meenai <smeenai@fb.com>

Reapply [Support] Fix recursive response file expansion guard

The test in the dependent revision has been fixed for Windows.

Original commit message:

Response file expansion limits the amount of e

Reapply [Support] Fix recursive response file expansion guard

The test in the dependent revision has been fixed for Windows.

Original commit message:

Response file expansion limits the amount of expansion to prevent
potential infinite recursion. However, the current logic assumes that
any argument beginning with @ is a response file, which is not true for
e.g. `-Xlinker -rpath -Xlinker @executable_path/../lib` on Darwin.
Having too many of these non-response file arguments beginning with @
prevents actual response files from being expanded. Instead, limit based
on the number of successful response file expansions, which should still
prevent infinite recursion but also avoid false positives.

Differential Revision: https://reviews.llvm.org/D60631

> llvm-svn: 358452

llvm-svn: 358466

show more ...


# 0a61be96 16-Apr-2019 Shoaib Meenai <smeenai@fb.com>

Reapply [Support] Add a test for recursive response file expansion

Use the appropriate tokenizer to fix the test on Windows.

Original commit message:

I'm going to be modifying the logic to avoid i

Reapply [Support] Add a test for recursive response file expansion

Use the appropriate tokenizer to fix the test on Windows.

Original commit message:

I'm going to be modifying the logic to avoid infinitely recursing on
self-referential response files, so add a unit test to verify the
expected behavior.

Differential Revision: https://reviews.llvm.org/D60630

> llvm-svn: 358451

llvm-svn: 358465

show more ...


# 8eeb56d1 15-Apr-2019 Shoaib Meenai <smeenai@fb.com>

Revert [Support] Add a test for recursive response file expansion

This reverts r358451 (git commit c8497467edc5766ae81ffbde58159f8c6af50803)

The test breaks a Windows buildbot:
http://lab.llvm.org:

Revert [Support] Add a test for recursive response file expansion

This reverts r358451 (git commit c8497467edc5766ae81ffbde58159f8c6af50803)

The test breaks a Windows buildbot:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17016/steps/test-check-all/logs/stdio

llvm-svn: 358461

show more ...


# d60ac111 15-Apr-2019 Shoaib Meenai <smeenai@fb.com>

Revert [Support] Fix recursive response file expansion guard

This reverts r358452 (git commit c8df4fb9c3865eac52a99602c26bbc070098c3d4)

A dependent commit breaks the Windows buildbots.

llvm-svn: 3

Revert [Support] Fix recursive response file expansion guard

This reverts r358452 (git commit c8df4fb9c3865eac52a99602c26bbc070098c3d4)

A dependent commit breaks the Windows buildbots.

llvm-svn: 358460

show more ...


# c8df4fb9 15-Apr-2019 Shoaib Meenai <smeenai@fb.com>

[Support] Fix recursive response file expansion guard

Response file expansion limits the amount of expansion to prevent
potential infinite recursion. However, the current logic assumes that
any argu

[Support] Fix recursive response file expansion guard

Response file expansion limits the amount of expansion to prevent
potential infinite recursion. However, the current logic assumes that
any argument beginning with @ is a response file, which is not true for
e.g. `-Xlinker -rpath -Xlinker @executable_path/../lib` on Darwin.
Having too many of these non-response file arguments beginning with @
prevents actual response files from being expanded. Instead, limit based
on the number of successful response file expansions, which should still
prevent infinite recursion but also avoid false positives.

Differential Revision: https://reviews.llvm.org/D60631

llvm-svn: 358452

show more ...


# c8497467 15-Apr-2019 Shoaib Meenai <smeenai@fb.com>

[Support] Add a test for recursive response file expansion

I'm going to be modifying the logic to avoid infinitely recursing on
self-referential response files, so add a unit test to verify the
expe

[Support] Add a test for recursive response file expansion

I'm going to be modifying the logic to avoid infinitely recursing on
self-referential response files, so add a unit test to verify the
expected behavior.

Differential Revision: https://reviews.llvm.org/D60630

llvm-svn: 358451

show more ...


# b85f74a2 15-Apr-2019 Don Hinton <hintonda@gmail.com>

[CommandLineParser] Add DefaultOption flag

Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as ne

[CommandLineParser] Add DefaultOption flag

Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.

Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.

(relanding after revert, r358414)
Added DefaultOptions.clear() to reset().

Reviewers: alexfh, klimek

Reviewed By: klimek

Subscribers: kristina, MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D59746

llvm-svn: 358428

show more ...


# 70921d4a 15-Apr-2019 Ilya Biryukov <ibiryukov@google.com>

Revert r358337: "[CommandLineParser] Add DefaultOption flag"

The change causes test failures under asan. Reverting to unbreak our
integrate.

llvm-svn: 358414


# 7d2021de 13-Apr-2019 Don Hinton <hintonda@gmail.com>

[CommandLineParser] Add DefaultOption flag

Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as ne

[CommandLineParser] Add DefaultOption flag

Summary: Add DefaultOption flag to CommandLineParser which provides a
default option or alias, but allows users to override it for some
other purpose as needed.

Also, add `-h` as a default alias to `-help`, which can be seamlessly
overridden by applications like llvm-objdump and llvm-readobj which
use `-h` as an alias for other options.

Reviewers: alexfh, klimek

Reviewed By: klimek

Subscribers: MaskRay, mehdi_amini, inglorion, dexonsmith, hiraditya, llvm-commits, jhenderson, arphaman, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D59746

llvm-svn: 358337

show more ...


Revision tags: llvmorg-8.0.0
# 6823c823 14-Mar-2019 Sunil Srivastava <sunil_srivastava@playstation.sony.com>

Handle consecutive-double-quotes in Windows argument parsing

Windows command line argument processing treats consecutive double quotes
as a single double-quote. This patch implements this functional

Handle consecutive-double-quotes in Windows argument parsing

Windows command line argument processing treats consecutive double quotes
as a single double-quote. This patch implements this functionality.

Differential Revision: https://reviews.llvm.org/D58662

llvm-svn: 356193

show more ...


Revision tags: llvmorg-8.0.0-rc5, llvmorg-8.0.0-rc4
# a38432ce 01-Mar-2019 Igor Kudrin <ikudrin@accesssoftek.com>

[CommandLine] Allow grouping options which can have values.

This patch allows all forms of values for options to be used at the end
of a group. With the fix, it is possible to follow the way GNU bin

[CommandLine] Allow grouping options which can have values.

This patch allows all forms of values for options to be used at the end
of a group. With the fix, it is possible to follow the way GNU binutils
tools handle grouping options better. For example, the -j option can be
used with objdump in any of the following ways:

$ objdump -d -j .text a.o
$ objdump -d -j.text a.o
$ objdump -dj .text a.o
$ objdump -dj.text a.o

Differential Revision: https://reviews.llvm.org/D58711

llvm-svn: 355185

show more ...


# 875f0582 01-Mar-2019 Igor Kudrin <ikudrin@accesssoftek.com>

[CommandLine] Do not crash if an option has both ValueRequired and Grouping.

If an option, which requires a value, has a `cl::Grouping` formatting
modifier, it works well as far as it is used at the

[CommandLine] Do not crash if an option has both ValueRequired and Grouping.

If an option, which requires a value, has a `cl::Grouping` formatting
modifier, it works well as far as it is used at the end of a group,
or as a separate argument. However, if the option appears accidentally
in the middle of a group, the program just crashes. This patch prints
an error message instead.

Differential Revision: https://reviews.llvm.org/D58499

llvm-svn: 355184

show more ...


Revision tags: llvmorg-8.0.0-rc3, llvmorg-7.1.0, llvmorg-7.1.0-rc1, llvmorg-8.0.0-rc2
# f929a0f8 05-Feb-2019 Thomas Preud'homme <thomasp@graphcore.ai>

Recommit: Add support for prefix-only CLI options

Summary:
Add support for options that always prefix their value, giving an error
if the value is in the next argument or if the option is given a va

Recommit: Add support for prefix-only CLI options

Summary:
Add support for options that always prefix their value, giving an error
if the value is in the next argument or if the option is given a value
assignment (ie. opt=val). This is the desired behavior for the -D option
of FileCheck for instance.

Copyright:
- Linaro (changes in version 2 of revision D55940)
- GraphCore (changes in later versions and introduced when creating
D56549)

Reviewers: jdenny

Subscribers: llvm-commits, probinson, kristina, hiraditya,
JonChesterfield

Differential Revision: https://reviews.llvm.org/D56549

llvm-svn: 353172

show more ...


# 9652652a 04-Feb-2019 James Henderson <jh7370@my.bristol.ac.uk>

[CommandLine] Don't print empty sentinel values from EnumValN lists in help text

In order to make an option value truly optional, both the ValueOptional
attribute and an empty-named value are requir

[CommandLine] Don't print empty sentinel values from EnumValN lists in help text

In order to make an option value truly optional, both the ValueOptional
attribute and an empty-named value are required. Prior to this change,
this empty-named value appears in the command-line help text:

-some-option - some help text
=v1 - description 1
=v2 - description 2
= -

This change improves the help text for these sort of options in a number
of ways:

1) ValueOptional options with an empty-named value now print their help
text twice: both without and then with '=<value>' after the name. The
latter version then lists the allowed values after it.
2) Empty-named values with no help text in ValueOptional options are not
listed in the permitted values.

-some-option - some help text
-some-option=<value> - some help text
=v1 - description 1
=v2 - description 2

3) Otherwise empty-named options are printed as =<empty> rather than
simply '='.
4) Option values without help text do not have the '-' separator
printed.

-some-option=<value> - some help text
=v1 - description 1
=v2
=<empty> - description

It also tweaks the llvm-symbolizer -functions help text to not print a
trailing ':' as that looks bad combined with 1) above.

This is mostly a reland of r353048 which in turn was a reland of
r352750.

Reviewed by: ruiu, thopre, mstorsjo

Differential Revision: https://reviews.llvm.org/D57030

llvm-svn: 353053

show more ...


# c9e6861a 04-Feb-2019 James Henderson <jh7370@my.bristol.ac.uk>

Revert r353048.

It was causing unexpected unit test failures on build bots.

llvm-svn: 353050


# d90b5a2e 04-Feb-2019 James Henderson <jh7370@my.bristol.ac.uk>

[CommandLine] Don't print empty sentinel values from EnumValN lists in help text

In order to make an option value truly optional, both the ValueOptional
attribute and an empty-named value are requir

[CommandLine] Don't print empty sentinel values from EnumValN lists in help text

In order to make an option value truly optional, both the ValueOptional
attribute and an empty-named value are required. Prior to this change,
this empty-named value appears in the command-line help text:

-some-option - some help text
=v1 - description 1
=v2 - description 2
= -

This change improves the help text for these sort of options in a number
of ways:

1) ValueOptional options with an empty-named value now print their help
text twice: both without and then with '=<value>' after the name. The
latter version then lists the allowed values after it.
2) Empty-named values with no help text in ValueOptional options are not
listed in the permitted values.

-some-option - some help text
-some-option=<value> - some help text
=v1 - description 1
=v2 - description 2

3) Otherwise empty-named options are printed as =<empty> rather than
simply '='.
4) Option values without help text do not have the '-' separator
printed.

-some-option=<value> - some help text
=v1 - description 1
=v2
=<empty> - description

It also tweaks the llvm-symbolizer -functions help text to not print a
trailing ':' as that looks bad combined with 1) above.

This is mostly a reland of r352750.

Reviewed by: ruiu, thopre, mstorsjo

Differential Revision: https://reviews.llvm.org/D57030

llvm-svn: 353048

show more ...


1234567