<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Support/GlobPattern.cpp, branch users/ojhunt/ptrauth-additions</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Support] Extract simple suffix from GlobPattern (#162118)</title>
<updated>2025-10-06T21:42:52+00:00</updated>
<author>
<name>Vitaly Buka</name>
<email>vitalybuka@google.com</email>
</author>
<published>2025-10-06T21:42:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5b24b558b3b780fb0f3d4587c7f4a3b4fddeec8b'/>
<id>5b24b558b3b780fb0f3d4587c7f4a3b4fddeec8b</id>
<content type='text'>
Existing glob is optimized with prefix for "src:/dir1/dir2/*",
but I notices we often use patterns like "src:*dir1/dir2/file.h".

So suffix will help.

It will be hard to notice in most cases, but I use ignore list to bisect
some falures.
E.g. put 100k entries in the file, and build/test as needed.

On one of hard compilation units glob matching was 400s, after the
change 20s.

Still, there is higher level inefficiency in ignore list matching, which
I will
address in followup patches and remove 20s above.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Existing glob is optimized with prefix for "src:/dir1/dir2/*",
but I notices we often use patterns like "src:*dir1/dir2/file.h".

So suffix will help.

It will be hard to notice in most cases, but I use ignore list to bisect
some falures.
E.g. put 100k entries in the file, and build/test as needed.

On one of hard compilation units glob matching was 400s, after the
change 20s.

Still, there is higher level inefficiency in ignore list matching, which
I will
address in followup patches and remove 20s above.</pre>
</div>
</content>
</entry>
<entry>
<title>[GlobPattern] Fix build error on gcc7.5</title>
<updated>2023-09-12T23:51:58+00:00</updated>
<author>
<name>Ellis Hoag</name>
<email>ellis.sparky.hoag@gmail.com</email>
</author>
<published>2023-09-12T23:48:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dfd0cd1cc182789d351953d2c40b8ccd9fdec34f'/>
<id>dfd0cd1cc182789d351953d2c40b8ccd9fdec34f</id>
<content type='text'>
This fixes a build error introduced by https://reviews.llvm.org/D153587
when using an old version of GCC. See
https://reviews.llvm.org/D153587#4644735 for details.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a build error introduced by https://reviews.llvm.org/D153587
when using an old version of GCC. See
https://reviews.llvm.org/D153587#4644735 for details.
</pre>
</div>
</content>
</entry>
<entry>
<title>[GlobPattern] Fix build error</title>
<updated>2023-08-30T15:55:44+00:00</updated>
<author>
<name>Ellis Hoag</name>
<email>ellis.sparky.hoag@gmail.com</email>
</author>
<published>2023-08-30T15:45:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2bfb41426bf2feef8b97b7a63e57416d1cf45dba'/>
<id>2bfb41426bf2feef8b97b7a63e57416d1cf45dba</id>
<content type='text'>
This fixes a build error introduced by https://reviews.llvm.org/D153587
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a build error introduced by https://reviews.llvm.org/D153587
</pre>
</div>
</content>
</entry>
<entry>
<title>[GlobPattern] Support brace expansions</title>
<updated>2023-08-30T15:30:39+00:00</updated>
<author>
<name>Ellis Hoag</name>
<email>ellis.sparky.hoag@gmail.com</email>
</author>
<published>2023-08-28T22:31:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8daace8b2d89b50daeeb2634ef96c915d1800e5f'/>
<id>8daace8b2d89b50daeeb2634ef96c915d1800e5f</id>
<content type='text'>
Extend `GlobPattern` to support brace expansions, e.g., `foo.{c,cpp}` as discussed in https://reviews.llvm.org/D152762#4425203.

The high level change was to turn `Tokens` into a list that gets larger when we see a new brace expansion term. Then in `GlobPattern::match()` we must check against each token group.

This is a breaking change since `{` will no longer match a literal without escaping. However, `\{` will match the literal `{` before and after this change. Also, from a brief survey of LLVM, it seems that `GlobPattern` is mostly used for symbol and path matching, which likely won't need `{` in their patterns.

See https://github.com/devongovett/glob-match#syntax for a nice glob reference.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D153587
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extend `GlobPattern` to support brace expansions, e.g., `foo.{c,cpp}` as discussed in https://reviews.llvm.org/D152762#4425203.

The high level change was to turn `Tokens` into a list that gets larger when we see a new brace expansion term. Then in `GlobPattern::match()` we must check against each token group.

This is a breaking change since `{` will no longer match a literal without escaping. However, `\{` will match the literal `{` before and after this change. Also, from a brief survey of LLVM, it seems that `GlobPattern` is mostly used for symbol and path matching, which likely won't need `{` in their patterns.

See https://github.com/devongovett/glob-match#syntax for a nice glob reference.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D153587
</pre>
</div>
</content>
</entry>
<entry>
<title>[GlobPattern] Update invalid glob pattern diagnostic for unmatched '['</title>
<updated>2023-08-09T03:25:10+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2023-08-09T03:25:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ebb0a210995dcf69d9696f8e14629e1378e63a21'/>
<id>ebb0a210995dcf69d9696f8e14629e1378e63a21</id>
<content type='text'>
Update this diagnostic to mention the reason (unmatched '['), matching
the other diagnostic about stray '\'. The original pattern is omitted,
as some users may mention the original pattern in another position, not
repeating it.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Update this diagnostic to mention the reason (unmatched '['), matching
the other diagnostic about stray '\'. The original pattern is omitted,
as some users may mention the original pattern in another position, not
repeating it.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Support] Rewrite GlobPattern</title>
<updated>2023-07-26T01:46:55+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2023-07-26T01:46:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4553dc46a05ec6f1e2aebcde1ce185772a26780b'/>
<id>4553dc46a05ec6f1e2aebcde1ce185772a26780b</id>
<content type='text'>
The current implementation has two primary issues:

* Matching `a*a*a*b` against `aaaaaa` has exponential complexity.
* BitVector harms data cache and is inefficient for literal matching.

and a minor issue that `\` at the end may cause an out of bounds access
in `StringRef::operator[]`.

Switch to an O(|S|*|P|) greedy algorithm instead: factor the pattern
into segments split by '*'. The segment is matched sequentianlly by
finding the first occurrence past the end of the previous match. This
algorithm is used by lots of fnmatch implementations, including musl and
NetBSD's.

In addition, `optional&lt;StringRef&gt; Exact, Suffix, Prefix` wastes space.
Instead, match the non-metacharacter prefix against the haystack, then
match the pattern with the rest.

In practice `*suffix` style patterns are less common and our new
algorithm is fast enough, so don't bother storing the non-metacharacter
suffix.

Note: brace expansions (D153587) can leverage the `matchOne` function.

Differential Revision: https://reviews.llvm.org/D156046
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current implementation has two primary issues:

* Matching `a*a*a*b` against `aaaaaa` has exponential complexity.
* BitVector harms data cache and is inefficient for literal matching.

and a minor issue that `\` at the end may cause an out of bounds access
in `StringRef::operator[]`.

Switch to an O(|S|*|P|) greedy algorithm instead: factor the pattern
into segments split by '*'. The segment is matched sequentianlly by
finding the first occurrence past the end of the previous match. This
algorithm is used by lots of fnmatch implementations, including musl and
NetBSD's.

In addition, `optional&lt;StringRef&gt; Exact, Suffix, Prefix` wastes space.
Instead, match the non-metacharacter prefix against the haystack, then
match the pattern with the rest.

In practice `*suffix` style patterns are less common and our new
algorithm is fast enough, so don't bother storing the non-metacharacter
suffix.

Note: brace expansions (D153587) can leverage the `matchOne` function.

Differential Revision: https://reviews.llvm.org/D156046
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove unused #include "llvm/ADT/Optional.h"</title>
<updated>2022-12-05T06:31:11+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2022-12-05T06:31:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a996cc217cefb9071888de38c6f05e5742d0106f'/>
<id>a996cc217cefb9071888de38c6f05e5742d0106f</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] LLVM_FALLTHROUGH =&gt; [[fallthrough]]. NFC</title>
<updated>2022-08-08T18:24:15+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2022-08-08T18:24:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=de9d80c1c579e39cc658a508f1d4ba1cd792e4d5'/>
<id>de9d80c1c579e39cc658a508f1d4ba1cd792e4d5</id>
<content type='text'>
With C++17 there is no Clang pedantic warning or MSVC C5051.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With C++17 there is no Clang pedantic warning or MSVC C5051.
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert rGca18ce1a00cd8b7cb7ce0e130440f5ae1ffe86ee "GlobPattern.h - remove unnecessary BitVector.h/StringRef.h includes. NFC"</title>
<updated>2020-05-17T17:51:21+00:00</updated>
<author>
<name>Simon Pilgrim</name>
<email>llvm-dev@redking.me.uk</email>
</author>
<published>2020-05-17T17:51:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=090cf4591fbac2fd8445080953bf0eadaa9c7f46'/>
<id>090cf4591fbac2fd8445080953bf0eadaa9c7f46</id>
<content type='text'>
Causes lld build errors
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Causes lld build errors
</pre>
</div>
</content>
</entry>
<entry>
<title>GlobPattern.h - remove unnecessary BitVector.h/StringRef.h includes. NFC</title>
<updated>2020-05-17T17:29:41+00:00</updated>
<author>
<name>Simon Pilgrim</name>
<email>llvm-dev@redking.me.uk</email>
</author>
<published>2020-05-17T17:29:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ca18ce1a00cd8b7cb7ce0e130440f5ae1ffe86ee'/>
<id>ca18ce1a00cd8b7cb7ce0e130440f5ae1ffe86ee</id>
<content type='text'>
Use forward declarations (BitVector already had one) and an headers to source file that were implicitly using them.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use forward declarations (BitVector already had one) and an headers to source file that were implicitly using them.
</pre>
</div>
</content>
</entry>
</feed>
