12#ifndef LLVM_SUPPORT_SPECIALCASELIST_H
13#define LLVM_SUPPORT_SPECIALCASELIST_H
79 static constexpr std::pair<unsigned, unsigned>
NotFound = {0, 0};
82 LLVM_ABI static std::unique_ptr<SpecialCaseList>
87 LLVM_ABI static std::unique_ptr<SpecialCaseList>
91 LLVM_ABI static std::unique_ptr<SpecialCaseList>
112 LLVM_ABI std::pair<unsigned, unsigned>
122 bool OrderBySize =
false);
133 LLVM_ABI void preprocess(
bool BySize);
147 std::vector<Reg> RegExes;
153 LLVM_ABI void preprocess(
bool BySize);
167 std::vector<GlobMatcher::Glob> Globs;
182 LLVM_ABI Matcher(
bool UseGlobs,
bool RemoveDotSlash);
185 LLVM_ABI void preprocess(
bool BySize);
197 std::variant<RegexMatcher, GlobMatcher> M;
201 using SectionEntries = StringMap<StringMap<Matcher>>;
228 LLVM_ABI void preprocess(
bool OrderBySize);
229 LLVM_ABI const SpecialCaseList::Matcher *
237 std::vector<Section> Sections;
240 unsigned FileIdx,
unsigned LineNo,
245 std::string &
Error,
bool OrderBySize);
This file defines the StringMap class.
This file defines the BumpPtrAllocator interface.
static llvm::Error parse(DataExtractor &Data, uint64_t BaseAddr, LineEntryCallback const &Callback)
static Error addSection(const NewSectionInfo &NewSection, Object &Obj)
This file defines the SmallVector class.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
Lightweight error class with error context and mandatory checking.
Tagged union holding either a T or a Error.
This class implements a glob pattern matcher similar to the one found in bash, but with some key diff...
This interface provides simple read-only access to a block of memory, and provides simple methods for...
A Radix Tree implementation.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
ArrayRef< const Section > sections() const
SpecialCaseList & operator=(SpecialCaseList const &)=delete
SpecialCaseList(SpecialCaseList const &)=delete
static constexpr std::pair< unsigned, unsigned > NotFound
LLVM_ABI std::pair< unsigned, unsigned > inSectionBlame(StringRef Section, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const
Returns the file index and the line number <FileIdx, LineNo> corresponding to the special case list e...
LLVM_ABI bool createInternal(const std::vector< std::string > &Paths, vfs::FileSystem &VFS, std::string &Error)
static LLVM_ABI std::unique_ptr< SpecialCaseList > createOrDie(const std::vector< std::string > &Paths, llvm::vfs::FileSystem &FS)
Parses the special case list entries from files.
static LLVM_ABI std::unique_ptr< SpecialCaseList > create(const std::vector< std::string > &Paths, llvm::vfs::FileSystem &FS, std::string &Error)
Parses the special case list entries from files.
SpecialCaseList()=default
LLVM_ABI ~SpecialCaseList()
LLVM_ABI bool inSection(StringRef Section, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const
Returns true, if special case list contains a line.
StringRef - Represent a constant reference to a string, i.e.
An efficient, type-erasing, non-owning reference to a callable.
The virtual file system interface.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
bool match(Val *V, const Pattern &P)
This is an optimization pass for GlobalISel generic memory operations.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
BumpPtrAllocatorImpl<> BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
Implement std::hash so that hash_code can be used in STL containers.
Glob(StringRef Name, unsigned LineNo, GlobPattern &&Pattern)
Reg(StringRef Name, unsigned LineNo, Regex &&Rg)
Section(StringRef Str, unsigned FileIdx, bool UseGlobs)
LLVM_ABI StringRef getLongestMatch(StringRef Prefix, StringRef Query, StringRef Category) const
friend class SpecialCaseList
Section(Section &&)=default
LLVM_ABI unsigned getLastMatch(StringRef Prefix, StringRef Query, StringRef Category) const