History log of /llvm-project/llvm/lib/FileCheck/FileCheck.cpp (Results 1 – 25 of 54)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# d3d605b7 23-Jan-2025 Jay Foad <jay.foad@amd.com>

[FileCheck] Use move semantics instead of std::swap. NFC. (#123304)

This code was using a pre-move-semantics trick of using std::swap to
avoid expensive vector copies.


# c10e8261 16-Jan-2025 Jay Foad <jay.foad@amd.com>

[FileCheck] Remove unneeded unique_ptr. NFC. (#123216)


Revision tags: llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4
# 22e55ba3 28-Aug-2024 Kazu Hirata <kazu@google.com>

[llvm] Prefer StringRef::substr to StringRef::slice (NFC) (#106330)

S.substr(N) is simpler than S.slice(N, StringRef::npos). Also, substr
is probably better recognizable than slice thanks to
std::

[llvm] Prefer StringRef::substr to StringRef::slice (NFC) (#106330)

S.substr(N) is simpler than S.slice(N, StringRef::npos). Also, substr
is probably better recognizable than slice thanks to
std::string_view::substr.

show more ...


Revision tags: llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 34855405 05-Jul-2024 Youngsuk Kim <youngsuk.kim@hpe.com>

[llvm] Avoid 'raw_string_ostream::str' (NFC)

Since `raw_string_ostream` doesn't own the string buffer, it is
desirable (in terms of memory safety) for users to directly reference
the string buffer r

[llvm] Avoid 'raw_string_ostream::str' (NFC)

Since `raw_string_ostream` doesn't own the string buffer, it is
desirable (in terms of memory safety) for users to directly reference
the string buffer rather than use `raw_string_ostream::str()`.

Work towards TODO item to remove `raw_string_ostream::str()`.

show more ...


Revision tags: llvmorg-18.1.8
# d4a01549 13-Jun-2024 Jay Foad <jay.foad@amd.com>

[llvm-project] Fix typo "seperate" (#95373)


Revision tags: llvmorg-18.1.7, llvmorg-18.1.6
# bb6df080 08-May-2024 Kazu Hirata <kazu@google.com>

[llvm] Use StringRef::operator== instead of StringRef::equals (NFC) (#91441)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator==/!= outnumber Stri

[llvm] Use StringRef::operator== instead of StringRef::equals (NFC) (#91441)

I'm planning to remove StringRef::equals in favor of
StringRef::operator==.

- StringRef::operator==/!= outnumber StringRef::equals by a factor of
70 under llvm/ in terms of their usage.

- The elimination of StringRef::equals brings StringRef closer to
std::string_view, which has operator== but not equals.

- S == "foo" is more readable than S.equals("foo"), especially for
!Long.Expression.equals("str") vs Long.Expression != "str".

show more ...


Revision tags: llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1
# 3105cfe7 05-Mar-2024 Daniil Kovalev <dkovalev@accesssoftek.com>

[FileCheck] Fix parsing empty global and pseudo variable names (#83667)

Reland #82595 with fixes of build failures related to colored output.
See https://lab.llvm.org/buildbot/#/builders/139/builds

[FileCheck] Fix parsing empty global and pseudo variable names (#83667)

Reland #82595 with fixes of build failures related to colored output.
See https://lab.llvm.org/buildbot/#/builders/139/builds/60549
Use `%ProtectFileCheckOutput` to avoid colored output.
Original commit message below.

In `Pattern::parseVariable`, for global variables (those starting with '$')
and for pseudo variables (those starting with '@') the first character is
consumed before actual variable name parsing. If the name is empty, it
leads to out-of-bound access to the corresponding `StringRef`.

This patch adds an if statement against the case described.

show more ...


# 28b354a9 02-Mar-2024 Daniil Kovalev <dkovalev@accesssoftek.com>

Revert "[FileCheck] Fix parsing empty global and pseudo variable names" (#83657)

Reverts llvm/llvm-project#82595

See build failure
https://lab.llvm.org/buildbot/#/builders/139/builds/60549


# aab3d131 02-Mar-2024 Daniil Kovalev <dkovalev@accesssoftek.com>

[FileCheck] Fix parsing empty global and pseudo variable names (#82595)

In `Pattern::parseVariable`, for global variables (those starting with
'$') and for pseudo variables (those starting with '@'

[FileCheck] Fix parsing empty global and pseudo variable names (#82595)

In `Pattern::parseVariable`, for global variables (those starting with
'$') and for pseudo variables (those starting with '@') the first
character is consumed before actual variable name parsing. If the name
is empty, it leads to out-of-bound access to the corresponding
`StringRef`.

This patch adds an if statement against the case described.

show more ...


Revision tags: llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2
# e7d3a4f3 04-Feb-2024 Kazu Hirata <kazu@google.com>

[FileCheck] Simplify a use of StringRef::consume_front (NFC)


# 3be989e8 04-Feb-2024 Kazu Hirata <kazu@google.com>

[FileCheck] Use StringRef::rtrim (NFC)


Revision tags: llvmorg-18.1.0-rc1, llvmorg-19-init
# 497a8604 19-Jan-2024 Vinayak Dev <104419489+vinayakdsci@users.noreply.github.com>

[FileCheck]: Fix diagnostics for NOT prefixes (#78412)

Fixes #70221

Fix a bug in FileCheck that corrects the error message when multiple
prefixes are provided
through --check-prefixes and one

[FileCheck]: Fix diagnostics for NOT prefixes (#78412)

Fixes #70221

Fix a bug in FileCheck that corrects the error message when multiple
prefixes are provided
through --check-prefixes and one of them is a PREFIX-NOT.

Earlier, only the first of the provided prefixes was displayed as the
erroneous prefix, while the
actual error might be on the prefix that occurred at the end of the
prefix list in the input file.

Now, the right NOT prefix is shown in the error message.

show more ...


# 586ecdf2 12-Dec-2023 Kazu Hirata <kazu@google.com>

[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::

[llvm] Use StringRef::{starts,ends}_with (NFC) (#74956)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.

show more ...


Revision tags: llvmorg-17.0.6
# 261b4710 15-Nov-2023 Nikita Popov <npopov@redhat.com>

[FileCheck] Don't use regex to find prefixes (#72237)

FileCheck currently compiles a regular expression of the form
`Prefix1|Prefix2|...` and uses it to find the next prefix in the input.

If we

[FileCheck] Don't use regex to find prefixes (#72237)

FileCheck currently compiles a regular expression of the form
`Prefix1|Prefix2|...` and uses it to find the next prefix in the input.

If we had a fast regex implementation, this would be a useful thing to
do, as the regex implementation would be able to match multiple prefixes
more efficiently than a naive approach. However, with our actual regex
implementation, finding the prefixes basically becomes O(InputLen *
RegexLen * LargeConstantFactor), which is a lot worse than a simple
string search.

Replace the regex with StringRef::find(), and keeping track of the next
position of each prefix. There are various ways this could be improved
on, but it's already significantly faster that the previous approach.

For me, this improves check-llvm time from 138.5s to 132.5s, so by
around 4-5%.

For vector-interleaved-load-i16-stride-7.ll in particular, test time
drops from 5s to 2.5s.

show more ...


Revision tags: llvmorg-17.0.5
# a3eeef82 14-Nov-2023 Nikita Popov <npopov@redhat.com>

[FileCheck] Avoid capturing group for {{regex}} (#72136)

For `{{regex}}` we don't really need a capturing group, and only add it
to properly handle cases like `{{foo|bar}}`. This is problematic,
b

[FileCheck] Avoid capturing group for {{regex}} (#72136)

For `{{regex}}` we don't really need a capturing group, and only add it
to properly handle cases like `{{foo|bar}}`. This is problematic,
because the use of capturing groups makes our regex implementation
slower (we have to go through the "dissect" stage, which can have
quadratic complexity).

Unfortunately, our regex implementation does not support non-capturing
groups like `(?:regex)`. So instead, avoid adding the group entirely if
the regex doesn't contain any alternations.

This causes a slight difference in escaping behavior, where previously
it was possible to write `{{{{}}` and get the same behavior as
`{{\{\{}}`. This will no longer work. I don't think this is a problem,
especially as we recently taught update_analyze_test_checks.py to emit
`{{\{\{}}`, so this shouldn't get introduced in any new tests.

For CodeGen/X86/vector-interleaved-store-i16-stride-7.ll (our slowest
X86 test) this drops FileCheck time from 6s to 5s (the remainder is
spent in a different regex issue). I expect similar speedups in other
tests using a lot of `{{}}`.

show more ...


Revision tags: llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# b743c193 30-Jun-2023 Thomas Preud'homme <thomas.preudhomme@arm.com>

[FileCheck] Turn errors into assert in valueFromStringRepr()

getWildcardRegex() guarantees that only valid hex numbers are matched by
FileCheck numeric expressions. This commit therefore only assert

[FileCheck] Turn errors into assert in valueFromStringRepr()

getWildcardRegex() guarantees that only valid hex numbers are matched by
FileCheck numeric expressions. This commit therefore only asserts the
lack of parsing failure in valueFromStringRepr().

Depends On D154430

Reviewed By: arichardson

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

show more ...


# e15e969a 03-Jul-2023 Thomas Preud'homme <thomas.preudhomme@arm.com>

[FileCheck, 4/4] NFC: Stop using ExpressionValue

Use APInt directly instead.

Depends On D150880

Reviewed By: arichardson

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


# 0726cb00 07-Aug-2023 Thomas Preud'homme <thomas.preudhomme@arm.com>

[FileCheck, 3/4] Allow AP value for numeric expressions

Use APInt to represent numeric variables and expressions, therefore
removing overflow concerns. Only remains underflow when the format of an
e

[FileCheck, 3/4] Allow AP value for numeric expressions

Use APInt to represent numeric variables and expressions, therefore
removing overflow concerns. Only remains underflow when the format of an
expression is unsigned (incl. hex values) but the result is negative.
Note that this can only happen when substituting an expression, not when
capturing since the regex used to capture unsigned value will not include
minus sign, hence all the code removal for match propagation testing.
This is what this patch implement.

Reviewed By: arichardson

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

show more ...


# fc0d1c05 29-Jun-2023 Thomas Preud'homme <thomas.preudhomme@arm.com>

[FileCheck, 2/4] NFC: Switch to APInt getter for ExpressionValue

Use an APInt getter as the only interface to getting the value out of an
ExpressionValue. This paves the way to switch ExpressionValu

[FileCheck, 2/4] NFC: Switch to APInt getter for ExpressionValue

Use an APInt getter as the only interface to getting the value out of an
ExpressionValue. This paves the way to switch ExpressionValue to handle
any integer without causing too big of a patch.

Reviewed By: arichardson

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

show more ...


# cf57fcfa 28-Jun-2023 Thomas Preud'homme <thomas.preudhomme@arm.com>

[FileCheck, 1/4] NFC: Switch ExpressionValue to APInt

Use APInt internally to store values represented by ExpressionValue.
This will allow to support any integer values in FileCheck numeric
expressi

[FileCheck, 1/4] NFC: Switch ExpressionValue to APInt

Use APInt internally to store values represented by ExpressionValue.
This will allow to support any integer values in FileCheck numeric
expression in a subsequent commit.

Reviewed By: arichardson

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

show more ...


# b0abd489 17-Jun-2023 Elliot Goodrich <elliotgoodrich@gmail.com>

[llvm] Add missing StringExtras.h includes

In preparation for removing the `#include "llvm/ADT/StringExtras.h"`
from the header to source file of `llvm/Support/Error.h`, first add in
all the missing

[llvm] Add missing StringExtras.h includes

In preparation for removing the `#include "llvm/ADT/StringExtras.h"`
from the header to source file of `llvm/Support/Error.h`, first add in
all the missing includes that were previously included transitively
through this header.

show more ...


Revision tags: llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4
# 13eb298d 16-May-2023 Thomas Preud'homme <thomas.preudhomme@arm.com>

Turn unreachable error into assert

Function valueFromStringRepr() throws an error on missing 0x prefix when
parsing a number string into a value. However, getWildcardRegex() already
ensures that onl

Turn unreachable error into assert

Function valueFromStringRepr() throws an error on missing 0x prefix when
parsing a number string into a value. However, getWildcardRegex() already
ensures that only text with the 0x prefix will match and be parsed,
making that error throwing code dead code. This commit turn the code
into an assert and remove the unit tests exercising that test
accordingly.

Reviewed By: jhenderson

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

show more ...


Revision tags: llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0
# b595eb83 15-Mar-2023 Kazu Hirata <kazu@google.com>

[llvm] Use *{Set,Map}::contains (NFC)


Revision tags: llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7
# 20bdb451 19-Dec-2022 Benjamin Kramer <benny.kra@googlemail.com>

[FileCheck] Remove the last llvm::Optional

It doesn't seem necessary and it's blocking std::optional.


# 94081642 14-Dec-2022 Fangrui Song <i@maskray.me>

[FileCheck] llvm::Optional => std::optional

Don't touch FileCheck.cpp:698 StringSwitch<Optional<binop_eval_t>>(FuncName).
MSVC and older GCC may report errors:

error C2664: 'llvm::StringSwitch<std:

[FileCheck] llvm::Optional => std::optional

Don't touch FileCheck.cpp:698 StringSwitch<Optional<binop_eval_t>>(FuncName).
MSVC and older GCC may report errors:

error C2664: 'llvm::StringSwitch<std::optional<llvm::binop_eval_t>,T> &llvm::StringSwitch<T,T>::Case(llvm::StringLiteral,T)': cannot convert argument 2 from 'overloaded-function' to 'T'
with
[
T=std::optional<llvm::binop_eval_t>
]

llvm/lib/FileCheck/FileCheck.cpp:699:44: error: no matching function for call to ‘llvm::StringSwitch<std::optional<llvm::Expected<llvm::ExpressionValue> (*)(const llvm::ExpressionValue&, const llvm::ExpressionValue&)> >::Case(const char [4], <unresolved overloaded function type>)’
.Case("add", operator+)
^

show more ...


123