64 Commits

Author SHA1 Message Date
Kazu Hirata
c2445d9c26
[Support] Use StringMap::contains (NFC) (#168673)
Identified with readability-container-contains.
2025-11-19 08:48:41 -08:00
Vitaly Buka
7016d43241
[NFC][SpecialCaseList] Convert preprocess into LazyInit (#167281)
Currently SpecialCaseList created at least twice,
one on by `Driver`, for diagnostics only, and then
the real one by the `ASTContext`.

Also, deppending on enabled sanitizers, not all
sections will be used.

In both cases there is unnecessary RadixTree
construction.

This patch changes `GlobMatcher` to do initialization
lazily only when needed.

And remove empty one from `RegexMatcher`.

This saves saves 0.5% of clang time building large project.
2025-11-14 19:22:56 -08:00
Vitaly Buka
825ebef51a
[NFC][Support] Remove unused getLongestMatch from SpecialCaseList (#167193)
This method is not used anywhere. Remove it.
2025-11-14 22:30:28 +00:00
Vitaly Buka
ba4babee6b
[NFC][SpecialCaseList] Move most of implementation in cpp file (#167280)
This commit moves the `RegexMatcher`, `GlobMatcher`, `Matcher` and
`Section` classes into an anonymous namespace within
`SpecialCaseList.cpp`. These classes are implementation details of
`SpecialCaseList` and do not need to be exposed in the header.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-11 04:29:00 +00:00
Vitaly Buka
2677c29d6d
[NFC][SpecialCaseList] Store SectionStr as StringRef (#167278)
The SectionStr is already copied in addSection, so
there is no need to copy it again in the Section
constructor.

Co-authored-by: Matt Arsenault <Matthew.Arsenault@amd.com>
2025-11-11 01:36:00 +00:00
Vitaly Buka
da996a3805
[NFC][SpecialCaseList] Refactor error handling (#167277)
Will help in future patches.
2025-11-10 22:43:46 +00:00
Vitaly Buka
a1934ee500
[NFC][SpecialCaseList] Replace callback with return value (#165943)
This commit introduces `SpecialCaseList::Match`, a small struct to hold
the matched rule and its line number. This simplifies the `match`
methods by allowing them to return a single value instead of using a
callback.

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-10 22:04:01 +00:00
Vitaly Buka
a37c4e0fad
[NFC][SpecialCaseList] Hide Section internals in private section (#167276)
Preparing to moving most of implementation out of the header file.

* https://github.com/llvm/llvm-project/pull/167280

---------

Co-authored-by: Naveen Seth Hanig <naveen.hanig@outlook.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-11-10 21:03:20 +00:00
Vitaly Buka
1322e71f2b
[SpecialCaseList] Add RadixTree for substring matching (#164545)
This commit adds a new RadixTree to `SpecialCaseList` for handling
substring matches. Previously, `SpecialCaseList` only supported prefix
and suffix matching. With this change, patterns that have neither
prefixes nor suffixes can now be efficiently filtered.

According to SpecialCaseListBM:

Lookup benchmarks (significant improvements):
```
OVERALL_GEOMEAN                       -0.7809
```

Lookup `*test*` like benchmarks (huge improvements):
```
OVERALL_GEOMEAN                       -0.9947
```

https://gist.github.com/vitalybuka/ee7f681b448eb18974386ab35e2d4d27
2025-10-27 05:30:38 +00:00
Vitaly Buka
05c495de13
[SpecialCaseList] Filtering Globs with matching prefix and suffix (#164543)
This commit enhances the `SpecialCaseList::GlobMatcher` to filter globs
more efficiently by considering both prefixes and suffixes.

Previously, the `GlobMatcher` used a `RadixTree` to store globs based
on their prefixes. This allowed for quick lookup of potential matches
by matching the query string's prefix against the stored prefixes.
However, for globs with common prefixes but different suffixes,
unnecessary glob matching attempts could still occur.

This change introduces a nested `RadixTree` structure:
`PrefixSuffixToGlob: RadixTree<Prefix, RadixTree<Suffix, Globs>>`.
Now, when a query string is matched, it first finds matching prefixes,
and then within those prefix matches, it further filters by matching
the reversed suffix of the query string against the reversed suffixes
of the globs. This significantly reduces the number of `Glob::match`
calls, especially for large special case lists with many globs sharing
common prefixes but differing in their suffixes.

According to SpecialCaseListBM:

Lookup benchmarks (significant improvements):
```
OVERALL_GEOMEAN                       -0.5815
```

Lookup `*suffix` and `prefix*suffix` like benchmarks (huge
improvements):
```
OVERALL_GEOMEAN                       -0.9316
```

https://gist.github.com/vitalybuka/e586751902760ced6beefcdf0d7b26fd
2025-10-25 09:47:56 -07:00
Vitaly Buka
168db5eca0
[SpecialCaseList] Filtering Globs with matching prefix (#164531)
This commit optimizes `SpecialCaseList` by using a `RadixTree` to filter
glob patterns based on their prefixes. When matching a query, the
`RadixTree` quickly identifies all glob patterns whose prefixes match
the query's prefix. This significantly reduces the number of glob
patterns that need to be fully evaluated, leading to performance
improvements, especially when dealing with a large number of patterns.

According to SpecialCaseListBM:

Lookup benchmarks (significant improvements):
```
OVERALL_GEOMEAN                       -0.8177
```

Lookup like `prefix*` benchmarks (huge improvements):
```
OVERALL_GEOMEAN                       -0.9819
```

https://gist.github.com/vitalybuka/824884bcbc1713e815068c279159dafe

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-10-25 05:59:24 +00:00
Vitaly Buka
c1212419a5
[NFC][SpecialCaseList] Remove LLVM_ABI from SpecialCaseList::Matcher::preprocess. (#164526)
Copied here from header by mistake.

---------

Co-authored-by: Marco Elver <elver@google.com>
2025-10-22 01:44:56 +00:00
Vitaly Buka
301d0089fe
[SpecialCaseList] Support early return from matching (#163279)
On average it saves half positive of Glob matching.

However, in real build most SpecialCaseList unmatched,
this change should not affect this case. 

To be able to do so without breaking behavior, we
need to re-order matches according precedence.

Usually it's LineNo, and it's already ordered,
but Diagnostic requires reordering by rule length.

Co-authored-by: Rahul Joshi <rjoshi@nvidia.com>
2025-10-14 00:19:23 +00:00
Vitaly Buka
c083fa1597
[NFC][SpecialCaseList] Use BumpPtrAllocator to own strings (#162304)
This simplifies structure of GlobMatcher, and
avoids "no copy/move" requirement.
2025-10-08 22:56:38 +00:00
Vitaly Buka
a2723ddf70
[NFC][SpecialCaseList] Split Matcher into RegexMatcher and GlobMatcher (#162303)
Glob will be optimized
Regex we we will keep intact.

Using std::variant to avoid virtual methods,
and allow to switch unique_ptr to move in future.
2025-10-08 15:26:13 -07:00
Vitaly Buka
4f6cb060b1
[NFC][SpecialCaseList] Move "LongestMatch" logic from WarningsSpecialCaseList into SpecialCaseList (#162409)
This way we can be more flexible optimizing SpecialCaseList internals.
2025-10-08 19:03:25 +00:00
Vitaly Buka
466f691f96
[SpecialCaseList] Remove ./ from file path (#162437)
This extends approach used in WarningsSpecialCaseList
on other types of SpecialCaseList.

SpecialCaseList will remove leading "./" from the Query
for prefixes which looks like file names.

Now affected prefixes are "src", "!src", "mainfile", "source".

To avoid breaking users, this behavior is enabled for
files starting "#!special-case-list-v3".
2025-10-08 17:44:20 +00:00
Vitaly Buka
7212d27a44
[NFC][SpecialCaseList] Add Name into Regex version (#162408)
To pass something into Cb in `match()`.

No need to bother with test coverage, as it's
legacy transitional code, maybe we can remove it
soon.
2025-10-08 01:22:26 +00:00
Vitaly Buka
aed53d19f9
[NFC][SpecialCaseList] Extract findMatcher and ::match with callback (#162397)
There are some users who rely on more than line
number. It would be easy to move some logic from
users side here with extracted methods.
2025-10-08 00:42:09 +00:00
Vitaly Buka
e5d15c1200
[NFC][SpecialCaseList] Make default version 2 instead of max() (#162398)
This way we can roll out new breaking features as opt-int.
E.g. "#!special-case-list-v3" will enabled something new.

Nothing to enabled yet, but with pinpointed default it's an option.

Follow up #162350.
2025-10-08 00:05:53 +00:00
Vitaly Buka
b7df533809
[NFC][SpecialCaseList] Rename SpecialCaseList::inSectionBlame and move into Section (#162390)
Co-authored-by: Craig Topper <craig.topper@sifive.com>
2025-10-07 23:55:29 +00:00
Vitaly Buka
ca1a1f47da
[NFC][SpecialCaseList] Generalize "#!special-case-list-v" parsing (#162350) 2025-10-07 15:43:32 -07:00
Vitaly Buka
7c5ad22878
[NFC][SpecialCaseList] Remove unnecessary indirection (#162211) 2025-10-07 15:58:03 +00:00
Aaron Ballman
479ae4aa8f
Revert "fix: replace report_fatal_error with Diags and exit" (#150662)
Reverts llvm/llvm-project#147959
2025-07-25 13:24:00 -04:00
woruyu
9d3dd8efe0
fix: replace report_fatal_error with Diags and exit (#147959)
report_fatal_error is not a good way to report diagnostics to the users, so this switches to using actual diagnostic reporting mechanisms instead.

Fixes #147187
2025-07-25 10:20:30 -04:00
Qinkun Bao
81bde1040c
[NFCI] Change SpecialCaseList::inSectionBlame to return pair<uint, uint> (FileIdx, LineNo). (#141540)
Accoring to the discussion in https://github.com/llvm/llvm-project/pull/140529, we need to SSCL can be created from multiple ignore list files, so we can repeat-fsanitize-ignorelist=. The change is necessary to achieve the feature described in https://github.com/llvm/llvm-project/issues/139128.
2025-05-28 00:18:37 -04:00
Qinkun Bao
1c3cff9856 [SpecialCaseList] Iterate sections and matchers in reverse order
Issue #139128 needs to find the last one in the file.

Pull Request: https://github.com/llvm/llvm-project/pull/141697
2025-05-27 18:47:09 -07:00
Qinkun Bao
e9dbf31be5
[NFCI][Sanitizer] Convert Matcher::Globs from StringMap to vector. (#140964)
As discussed in https://github.com/llvm/llvm-project/pull/139772 and
https://github.com/llvm/llvm-project/pull/140529, Matcher::Globs can
keep the order when parsing the case list.
2025-05-23 20:23:13 -04:00
Qinkun Bao
c6ad464347
[NFC] Run code formatter on Diagnostic.h/cpp ProfileList.cpp SpecialCaseList.cpp
Reviewers: vitalybuka

Reviewed By: vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/140316
2025-05-17 17:11:49 -04:00
Qinkun Bao
dd4a73069c
[NFCI][Sanitizer] Convert SpecialCaseList::Sections from StringMap to vector.
As discussed in https://github.com/llvm/llvm-project/pull/139772, SpecialCaseList::Sections can keep the order of Sections when parsing the case list.

Reviewers: thurstond, vitalybuka

Reviewed By: vitalybuka

Pull Request: https://github.com/llvm/llvm-project/pull/140127
2025-05-16 15:32:54 -04:00
Fangrui Song
81d1df2a39
[SpecialCaseList] Use glob by default (#74809)
https://reviews.llvm.org/D154014 addes glob support and enables it when
`#!special-case-list-v2` is the first line. This patch makes the glob
support the default (faster than regex after
https://reviews.llvm.org/D156046) and switches to the deprecated regex
support if `#!special-case-list-v1` is the first line.

I have surveyed many ignore lists. All ignore lists I find only use
basic `*` `.` and don't use regex metacharacters such as `(` and `)`.
(As neither `src:` nor `fun:` benefits from using regex.)
They are unaffected by the transition (with a caution that regex
`src:x/a.pb.*` matches `x/axpbx` but glob `src:x/a.pb.*` doesn't).

There is no deprecating warning. If a user finds
`#!special-case-list-v1`, they shall read that the old syntax is
deprecated.

Link:
https://discourse.llvm.org/t/use-glob-instead-of-regex-for-specialcaselists/71666
2023-12-11 15:30:28 -08:00
Simon Pilgrim
bcb685e119 [Support] Use StringRef::starts_with/ends_with instead of startswith/endswith. NFC.
startswith/endswith wrap starts_with/ends_with and will eventually go away (to more closely match string_view)
2023-11-03 18:19:33 +00:00
Ellis Hoag
8eb34700c2 [SpecialCaseList] Add option to use Globs instead of Regex to match patterns
Add an option in `SpecialCaseList` to use Globs instead of Regex to match patterns. `GlobPattern` was extended in https://reviews.llvm.org/D153587 to support brace expansions which allows us to use patterns like `*/src/foo.{c,cpp}`. It turns out that most patterns only take advantage of `*` so using Regex was overkill and required lots of escaping in practice. This often led to bugs due to forgetting to escape special characters.

Since this would be a breaking change, we temporarily support Regex by default and use Globs when `#!special-case-list-v2` is the first line in the file. Users should switch to the glob format described in https://llvm.org/doxygen/classllvm_1_1GlobPattern.html. For example, `(abc|def)` should become `{abc,def}`.

See discussion in https://reviews.llvm.org/D152762 and https://discourse.llvm.org/t/use-glob-instead-of-regex-for-specialcaselists/71666.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D154014
2023-09-01 09:06:11 -07:00
Ellis Hoag
1390675542 [SpecialCaseList] Remove TrigramIndex
`TrigramIndex` was added back in https://reviews.llvm.org/D27188 as an optimization to make `SpecialCaseList::match()` faster. I've found that `TrigramIndex` actually makes the function slower and it has no functional use, so we can remove it.

I grabbed the list of queries passed to `SpecialCaseList::match()` on a random very large file (`AArch64ISelLowering.cpp`) and measured the runtime to call `match()` on all of them with [this line](8e1f820bb4/llvm/lib/Support/SpecialCaseList.cpp (L64)) disabled and then enabled.

```
$ hyperfine --warmup 3 'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=1 build/unittests/Support/SupportTests' 'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=0 build/unittests/Support/SupportTests'
Benchmark 1: GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=1 build/unittests/Support/SupportTests
  Time (mean ± σ):     575.9 ms ±  20.3 ms    [User: 573.1 ms, System: 2.7 ms]
  Range (min … max):   555.5 ms … 620.0 ms    10 runs

Benchmark 2: GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=0 build/unittests/Support/SupportTests
  Time (mean ± σ):     283.4 ms ±   6.7 ms    [User: 280.3 ms, System: 3.0 ms]
  Range (min … max):   277.0 ms … 294.9 ms    10 runs

Summary
  'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=0 build/unittests/Support/SupportTests' ran
    2.03 ± 0.09 times faster than 'GTEST_FILTER="SpecialCaseListTest.Large" USE_TRIGRAMS=1 build/unittests/Support/SupportTests'
```

Using `perf` I found that most of the runtime in `TrigramIndex::isDefinitelyOut()` comes from a division operation that seems to come from `std::unordered_map`: 8e1f820bb4/llvm/include/llvm/Support/TrigramIndex.h (L62)

Removing `TrigramIndex` will make it easier to potentially switch to using `GlobPattern` instead of a full regex for `SpecialCaseList`. See discussion in https://reviews.llvm.org/D152762 for details.

Reviewed By: MaskRay, #sanitizers, vitalybuka

Differential Revision: https://reviews.llvm.org/D153171
2023-06-19 10:41:45 -07:00
Kazu Hirata
b595eb83e5 [llvm] Use *{Set,Map}::contains (NFC) 2023-03-14 18:56:07 -07:00
Kazu Hirata
3a3cb929ab [llvm] Use = default (NFC) 2022-02-06 22:18:35 -08:00
serge-sans-paille
75e164f61d [llvm] Cleanup header dependencies in ADT and Support
The cleanup was manual, but assisted by "include-what-you-use". It consists in

1. Removing unused forward declaration. No impact expected.
2. Removing unused headers in .cpp files. No impact expected.
3. Removing unused headers in .h files. This removes implicit dependencies and
   is generally considered a good thing, but this may break downstream builds.
   I've updated llvm, clang, lld, lldb and mlir deps, and included a list of the
   modification in the second part of the commit.
4. Replacing header inclusion by forward declaration. This has the same impact
   as 3.

Notable changes:

- llvm/Support/TargetParser.h no longer includes llvm/Support/AArch64TargetParser.h nor llvm/Support/ARMTargetParser.h
- llvm/Support/TypeSize.h no longer includes llvm/Support/WithColor.h
- llvm/Support/YAMLTraits.h no longer includes llvm/Support/Regex.h
- llvm/ADT/SmallVector.h no longer includes llvm/Support/MemAlloc.h nor llvm/Support/ErrorHandling.h

You may need to add some of these headers in your compilation units, if needs be.

As an hint to the impact of the cleanup, running

clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/Support/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l

before: 8000919 lines
after:  7917500 lines

Reduced dependencies also helps incremental rebuilds and is more ccache
friendly, something not shown by the above metric :-)

Discourse thread on the topic: https://llvm.discourse.group/t/include-what-you-use-include-cleanup/5831
2022-01-21 13:54:49 +01:00
Simon Pilgrim
21661607ca [llvm] Replace report_fatal_error(std::string) uses with report_fatal_error(Twine)
As described on D111049, we're trying to remove the <string> dependency from error handling and replace uses of report_fatal_error(const std::string&) with the Twine() variant which can be forward declared.
2021-10-06 12:04:30 +01:00
Kazu Hirata
3322354bfc [Support] Qualify auto (NFC)
Identified with readability-qualified-auto.
2021-09-06 09:10:07 -07:00
Eric Christopher
858d385578 As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.
2020-06-20 00:24:57 -07:00
Benjamin Kramer
adcd026838 Make llvm::StringRef to std::string conversions explicit.
This is how it should've been and brings it more in line with
std::string_view. There should be no functional change here.

This is mostly mechanical from a custom clang-tidy check, with a lot of
manual fixups. It uncovers a lot of minor inefficiencies.

This doesn't actually modify StringRef yet, I'll do that in a follow-up.
2020-01-28 23:25:25 +01:00
Ilya Biryukov
aa981c1802 Reland 9f3fdb0d7fab: [Driver] Use VFS to check if sanitizer blacklists exist
With updates to various LLVM tools that use SpecialCastList.

It was tempting to use RealFileSystem as the default, but that makes it
too easy to accidentally forget passing VFS in clang code.
2019-11-21 11:56:09 +01:00
Ilya Biryukov
9f3fdb0d7f Revert "[Driver] Use VFS to check if sanitizer blacklists exist"
This reverts commit ba6f906854263375cff3257d22d241a8a259cf77.
Commit caused compilation errors on llvm tests. Will fix and re-land.
2019-11-21 11:31:14 +01:00
Ilya Biryukov
ba6f906854 [Driver] Use VFS to check if sanitizer blacklists exist
Summary:
This is a follow-up to 590f279c456bbde632eca8ef89a85c478f15a249, which
moved some of the callers to use VFS.

It turned out more code in Driver calls into real filesystem APIs and
also needs an update.

Reviewers: gribozavr2, kadircet

Reviewed By: kadircet

Subscribers: ormris, mgorny, hiraditya, llvm-commits, jkorous, cfe-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D70440
2019-11-21 11:00:30 +01:00
Jan Korous
590f279c45 [clang] Add VFS support for sanitizers' blacklists
Differential Revision: https://reviews.llvm.org/D69648
2019-11-08 10:58:50 -08:00
Jonas Devlieghere
0eaee545ee [llvm] Migrate llvm::make_unique to std::make_unique
Now that we've moved to C++14, we no longer need the llvm::make_unique
implementation from STLExtras.h. This patch is a mechanical replacement
of (hopefully) all the llvm::make_unique instances across the monorepo.

llvm-svn: 369013
2019-08-15 15:54:37 +00:00
Chandler Carruth
2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
to reflect the new license.

We understand that people may be surprised that we're moving the header
entirely to discuss the new license. We checked this carefully with the
Foundation's lawyer and we believe this is the correct approach.

Essentially, all code in the project is now made available by the LLVM
project under our new license, so you will see that the license headers
include that license only. Some of our contributors have contributed
code under our old license, and accordingly, we have retained a copy of
our old license notice in the top-level files in each project and
repository.

llvm-svn: 351636
2019-01-19 08:50:56 +00:00
Mitch Phillips
40d6663367 Extend SpecialCaseList to allow users to blame matches on entries in the file.
Summary:
Extends SCL functionality to allow users to find the line number in the file the SCL is built from through SpecialCaseList::inSectionBlame(...).

Also removes the need to compile the SCL before use. As the matcher now contains a list of regexes to test against instead of a single regex, the regexes can be individually built on each insertion rather than one large compilation at the end of construction.

This change also fixes a bug where blank lines would cause the parser to become out-of-sync with the line number. An error on line `k` was being reported as being on line `k - num_blank_lines_before_k`.

Note: This change has a cyclical dependency on D39486. Both these changes must be submitted at the same time to avoid a build breakage.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: kcc, pcc, llvm-commits

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

llvm-svn: 317617
2017-11-07 21:16:46 +00:00
Mitch Phillips
fa2eda8609 Check special-case-list regex before insertion.
Summary:
Checks that the supplied regex to SpecialCaseList::Matcher::insert(..) is non-empty.

Reported by OSS-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=3688

Verified that this fixes the provided assertion failure (built with {asan, fuzzer}):
```
mitchp@mitchp2:~/llvm-build/git-fuzz$ ninja llvm-special-case-list-fuzzer[12/12] Linking CXX executable bin/llvm-special-case-list-fuzzer
mitchp@mitchp2:~/llvm-build/git-fuzz$ bin/llvm-special-case-list-fuzzer ~/Downloads/clusterfuzz-testcase-6748633157337088
INFO: Seed: 1697404507
INFO: Loaded 1 modules   (18581 inline 8-bit counters): 18581 [0x9e9f60, 0x9ee7f5),
INFO: Loaded 1 PC tables (18581 PCs): 18581 [0x9ee7f8,0xa37148),
bin/llvm-special-case-list-fuzzer: Running 1 inputs 1 time(s) each.
Running: /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-6748633157337088
Executed /usr/local/google/home/mitchp/Downloads/clusterfuzz-testcase-6748633157337088 in 0 ms
***
*** NOTE: fuzzing was not performed, you have only
***       executed the target code on a fixed set of inputs.
***
mitchp@mitchp2:~/llvm-build/git-fuzz$

```

Reviewers: kcc, vsk

Reviewed By: vsk

Subscribers: vsk, llvm-commits, vlad.tsyrklevich

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

llvm-svn: 316537
2017-10-24 23:56:12 +00:00
Vlad Tsyrklevich
998b220e97 Add section headers to SpecialCaseLists
Summary:
Sanitizer blacklist entries currently apply to all sanitizers--there
is no way to specify that an entry should only apply to a specific
sanitizer. This is important for Control Flow Integrity since there are
several different CFI modes that can be enabled at once. For maximum
security, CFI blacklist entries should be scoped to only the specific
CFI mode(s) that entry applies to.

Adding section headers to SpecialCaseLists allows users to specify more
information about list entries, like sanitizer names or other metadata,
like so:

  [section1]
  fun:*fun1*
  [section2|section3]
  fun:*fun23*

The section headers are regular expressions. For backwards compatbility,
blacklist entries entered before a section header are put into the '[*]'
section so that blacklists without sections retain the same behavior.

SpecialCaseList has been modified to also accept a section name when
matching against the blacklist. It has also been modified so the
follow-up change to clang can define a derived class that allows
matching sections by SectionMask instead of by string.

Reviewers: pcc, kcc, eugenis, vsk

Reviewed By: eugenis, vsk

Subscribers: vitalybuka, llvm-commits

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

llvm-svn: 314170
2017-09-25 22:11:11 +00:00