12#ifndef LLVM_SUPPORT_SPECIALCASELIST_H
13#define LLVM_SUPPORT_SPECIALCASELIST_H
76 static constexpr std::pair<unsigned, unsigned>
NotFound = {0, 0};
79 LLVM_ABI static std::unique_ptr<SpecialCaseList>
84 LLVM_ABI static std::unique_ptr<SpecialCaseList>
88 LLVM_ABI static std::unique_ptr<SpecialCaseList>
109 LLVM_ABI std::pair<unsigned, unsigned>
119 bool OrderBySize =
false);
130 LLVM_ABI void preprocess(
bool BySize);
144 std::vector<Reg> RegExes;
150 LLVM_ABI void preprocess(
bool BySize);
164 std::vector<GlobMatcher::Glob> Globs;
170 LLVM_ABI Matcher(
bool UseGlobs,
bool RemoveDotSlash);
173 LLVM_ABI void preprocess(
bool BySize);
185 std::variant<RegexMatcher, GlobMatcher> M;
189 using SectionEntries = StringMap<StringMap<Matcher>>;
216 LLVM_ABI void preprocess(
bool OrderBySize);
217 LLVM_ABI const SpecialCaseList::Matcher *
225 std::vector<Section> Sections;
228 unsigned FileIdx,
unsigned LineNo,
233 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)
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...
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.
bool match(Val *V, const Pattern &P)
This is an optimization pass for GlobalISel generic memory operations.
BumpPtrAllocatorImpl BumpPtrAllocator
The standard BumpPtrAllocator which just uses the default template parameters.
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
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