LLVM  14.0.0git
Classes | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
llvm::SpecialCaseList Class Reference

#include "llvm/Support/SpecialCaseList.h"

Collaboration diagram for llvm::SpecialCaseList:
Collaboration graph
[legend]

Classes

class  Matcher
 Represents a set of regular expressions. More...
 
struct  Section
 

Public Member Functions

 ~SpecialCaseList ()
 
bool inSection (StringRef Section, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const
 Returns true, if special case list contains a line. More...
 
unsigned inSectionBlame (StringRef Section, StringRef Prefix, StringRef Query, StringRef Category=StringRef()) const
 Returns the line number corresponding to the special case list entry if the special case list contains a line. More...
 

Static Public Member Functions

static std::unique_ptr< SpecialCaseListcreate (const std::vector< std::string > &Paths, llvm::vfs::FileSystem &FS, std::string &Error)
 Parses the special case list entries from files. More...
 
static std::unique_ptr< SpecialCaseListcreate (const MemoryBuffer *MB, std::string &Error)
 Parses the special case list from a memory buffer. More...
 
static std::unique_ptr< SpecialCaseListcreateOrDie (const std::vector< std::string > &Paths, llvm::vfs::FileSystem &FS)
 Parses the special case list entries from files. More...
 

Protected Types

using SectionEntries = StringMap< StringMap< Matcher > >
 

Protected Member Functions

bool createInternal (const std::vector< std::string > &Paths, vfs::FileSystem &VFS, std::string &Error)
 
bool createInternal (const MemoryBuffer *MB, std::string &Error)
 
 SpecialCaseList ()=default
 
 SpecialCaseList (SpecialCaseList const &)=delete
 
SpecialCaseListoperator= (SpecialCaseList const &)=delete
 
bool parse (const MemoryBuffer *MB, StringMap< size_t > &SectionsMap, std::string &Error)
 Parses just-constructed SpecialCaseList entries from a memory buffer. More...
 
unsigned inSectionBlame (const SectionEntries &Entries, StringRef Prefix, StringRef Query, StringRef Category) const
 

Protected Attributes

std::vector< SectionSections
 

Detailed Description

Definition at line 69 of file SpecialCaseList.h.

Member Typedef Documentation

◆ SectionEntries

Definition at line 134 of file SpecialCaseList.h.

Constructor & Destructor Documentation

◆ ~SpecialCaseList()

llvm::SpecialCaseList::~SpecialCaseList ( )

Definition at line 202 of file SpecialCaseList.cpp.

◆ SpecialCaseList() [1/2]

llvm::SpecialCaseList::SpecialCaseList ( )
protecteddefault

Referenced by create().

◆ SpecialCaseList() [2/2]

llvm::SpecialCaseList::SpecialCaseList ( SpecialCaseList const )
protecteddelete

Member Function Documentation

◆ create() [1/2]

std::unique_ptr< SpecialCaseList > llvm::SpecialCaseList::create ( const MemoryBuffer MB,
std::string &  Error 
)
static

Parses the special case list from a memory buffer.

On failure, returns 0 and writes an error message to string.

Definition at line 82 of file SpecialCaseList.cpp.

References SpecialCaseList().

◆ create() [2/2]

std::unique_ptr< SpecialCaseList > llvm::SpecialCaseList::create ( const std::vector< std::string > &  Paths,
llvm::vfs::FileSystem FS,
std::string &  Error 
)
static

Parses the special case list entries from files.

On failure, returns 0 and writes an error message to string.

Definition at line 74 of file SpecialCaseList.cpp.

References llvm::X86AS::FS, and SpecialCaseList().

Referenced by createOrDie().

◆ createInternal() [1/2]

bool llvm::SpecialCaseList::createInternal ( const MemoryBuffer MB,
std::string &  Error 
)
protected

Definition at line 118 of file SpecialCaseList.cpp.

References parse(), and Sections.

◆ createInternal() [2/2]

bool llvm::SpecialCaseList::createInternal ( const std::vector< std::string > &  Paths,
vfs::FileSystem VFS,
std::string &  Error 
)
protected

◆ createOrDie()

std::unique_ptr< SpecialCaseList > llvm::SpecialCaseList::createOrDie ( const std::vector< std::string > &  Paths,
llvm::vfs::FileSystem FS 
)
static

Parses the special case list entries from files.

On failure, reports a fatal error.

Definition at line 91 of file SpecialCaseList.cpp.

References create(), llvm::X86AS::FS, and llvm::report_fatal_error().

Referenced by llvm::ModuleSanitizerCoveragePass::ModuleSanitizerCoveragePass().

◆ inSection()

bool llvm::SpecialCaseList::inSection ( StringRef  Section,
StringRef  Prefix,
StringRef  Query,
StringRef  Category = StringRef() 
) const

Returns true, if special case list contains a line.

@Prefix:<E>=@Category

where @Query satisfies wildcard expression <E> in a given @Section.

Definition at line 204 of file SpecialCaseList.cpp.

References inSectionBlame(), and llvm::cl::Prefix.

◆ inSectionBlame() [1/2]

unsigned llvm::SpecialCaseList::inSectionBlame ( const SectionEntries Entries,
StringRef  Prefix,
StringRef  Query,
StringRef  Category 
) const
protected

Definition at line 222 of file SpecialCaseList.cpp.

◆ inSectionBlame() [2/2]

unsigned llvm::SpecialCaseList::inSectionBlame ( StringRef  Section,
StringRef  Prefix,
StringRef  Query,
StringRef  Category = StringRef() 
) const

Returns the line number corresponding to the special case list entry if the special case list contains a line.

@Prefix:<E>=@Category

where @Query satisfies wildcard expression <E> in a given @Section. Returns zero if there is no exclusion entry corresponding to this expression.

Definition at line 209 of file SpecialCaseList.cpp.

References llvm::cl::Prefix, and Sections.

Referenced by inSection().

◆ operator=()

SpecialCaseList& llvm::SpecialCaseList::operator= ( SpecialCaseList const )
protecteddelete

◆ parse()

bool llvm::SpecialCaseList::parse ( const MemoryBuffer MB,
StringMap< size_t > &  SectionsMap,
std::string &  Error 
)
protected

Member Data Documentation

◆ Sections

std::vector<Section> llvm::SpecialCaseList::Sections
protected

Definition at line 143 of file SpecialCaseList.h.

Referenced by createInternal(), inSectionBlame(), and parse().


The documentation for this class was generated from the following files:
llvm::cl::Prefix
@ Prefix
Definition: CommandLine.h:164
E
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")