12#ifndef LLVM_SUPPORT_SPECIALCASELIST_H
13#define LLVM_SUPPORT_SPECIALCASELIST_H
73 static constexpr std::pair<unsigned, unsigned>
NotFound = {0, 0};
76 LLVM_ABI static std::unique_ptr<SpecialCaseList>
81 LLVM_ABI static std::unique_ptr<SpecialCaseList>
85 LLVM_ABI static std::unique_ptr<SpecialCaseList>
106 LLVM_ABI std::pair<unsigned, unsigned>
140 std::vector<std::unique_ptr<Matcher::Glob>>
Globs;
141 std::vector<std::pair<std::unique_ptr<Regex>,
unsigned>>
RegExes;
159 unsigned FileIdx,
unsigned LineNo,
160 bool UseGlobs =
true);
This file defines the StringMap class.
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...
Represents a set of globs and their line numbers.
std::vector< std::pair< std::unique_ptr< Regex >, unsigned > > RegExes
LLVM_ABI unsigned match(StringRef Query) const
std::vector< std::unique_ptr< Matcher::Glob > > Globs
LLVM_ABI Error insert(StringRef Pattern, unsigned LineNumber, bool UseRegex)
SpecialCaseList & operator=(SpecialCaseList const &)=delete
SpecialCaseList(SpecialCaseList const &)=delete
std::vector< Section > Sections
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 Expected< Section * > addSection(StringRef SectionStr, unsigned FileIdx, unsigned LineNo, bool UseGlobs=true)
LLVM_ABI bool parse(unsigned FileIdx, const MemoryBuffer *MB, std::string &Error)
Parses just-constructed SpecialCaseList entries from a memory buffer.
StringMap< StringMap< Matcher > > SectionEntries
LLVM_ABI bool inSection(StringRef Section, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const
Returns true, if special case list contains a line.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
The virtual file system interface.
This is an optimization pass for GlobalISel generic memory operations.
Section(StringRef Str, unsigned FileIdx)
std::unique_ptr< Matcher > SectionMatcher