LLVM 17.0.0git
Public Member Functions | List of all members
llvm::RecordKeeper Class Reference

#include "llvm/TableGen/Record.h"

Public Member Functions

 RecordKeeper ()
 
 ~RecordKeeper ()
 
detail::RecordKeeperImplgetImpl ()
 Return the internal implementation of the RecordKeeper.
 
const std::string getInputFilename () const
 Get the main TableGen input file's name.
 
const RecordMap & getClasses () const
 Get the map of classes.
 
const RecordMap & getDefs () const
 Get the map of records (defs).
 
const GlobalMap & getGlobals () const
 Get the map of global variables.
 
RecordgetClass (StringRef Name) const
 Get the class with the specified name.
 
RecordgetDef (StringRef Name) const
 Get the concrete record with the specified name.
 
InitgetGlobal (StringRef Name) const
 Get the Init value of the specified global variable.
 
void saveInputFilename (std::string Filename)
 
void addClass (std::unique_ptr< Record > R)
 
void addDef (std::unique_ptr< Record > R)
 
void addExtraGlobal (StringRef Name, Init *I)
 
InitgetNewAnonymousName ()
 GetNewAnonymousName - Generate a unique anonymous name that can be used as an identifier.
 
void startPhaseTiming ()
 Start phase timing; called if the –time-phases option is specified.
 
void startTimer (StringRef Name)
 Start timing a phase. Automatically stops any previous phase timer.
 
void stopTimer ()
 Stop timing a phase.
 
void startBackendTimer (StringRef Name)
 Start timing the overall backend.
 
void stopBackendTimer ()
 Stop timing the overall backend.
 
void stopPhaseTiming ()
 Stop phase timing and print the report.
 
std::vector< Record * > getAllDerivedDefinitions (StringRef ClassName) const
 Get all the concrete records that inherit from the one specified class.
 
std::vector< Record * > getAllDerivedDefinitions (ArrayRef< StringRef > ClassNames) const
 Get all the concrete records that inherit from all the specified classes.
 
std::vector< Record * > getAllDerivedDefinitionsIfDefined (StringRef ClassName) const
 Get all the concrete records that inherit from specified class, if the class is defined.
 
void dump () const
 

Detailed Description

Definition at line 1903 of file Record.h.

Constructor & Destructor Documentation

◆ RecordKeeper()

RecordKeeper::RecordKeeper ( )

Definition at line 2912 of file Record.cpp.

◆ ~RecordKeeper()

RecordKeeper::~RecordKeeper ( )
default

Member Function Documentation

◆ addClass()

void llvm::RecordKeeper::addClass ( std::unique_ptr< Record R)
inline

Definition at line 1950 of file Record.h.

References assert().

◆ addDef()

void llvm::RecordKeeper::addDef ( std::unique_ptr< Record R)
inline

Definition at line 1957 of file Record.h.

References assert().

◆ addExtraGlobal()

void llvm::RecordKeeper::addExtraGlobal ( StringRef  Name,
Init I 
)
inline

Definition at line 1964 of file Record.h.

References assert(), getDef(), I, and Name.

◆ dump()

LLVM_DUMP_METHOD void RecordKeeper::dump ( ) const

Definition at line 2917 of file Record.cpp.

References llvm::errs().

◆ getAllDerivedDefinitions() [1/2]

std::vector< Record * > RecordKeeper::getAllDerivedDefinitions ( ArrayRef< StringRef ClassNames) const

Get all the concrete records that inherit from all the specified classes.

The classes must be defined.

Definition at line 2989 of file Record.cpp.

References llvm::all_of(), assert(), getClass(), getDefs(), llvm::PrintFatalError(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), and llvm::ArrayRef< T >::size().

◆ getAllDerivedDefinitions() [2/2]

std::vector< Record * > RecordKeeper::getAllDerivedDefinitions ( StringRef  ClassName) const

Get all the concrete records that inherit from the one specified class.

The class must be defined.

Definition at line 2979 of file Record.cpp.

References getAllDerivedDefinitions().

Referenced by getAllDerivedDefinitions(), getAllDerivedDefinitionsIfDefined(), llvm::DirectiveLanguage::getClauses(), and llvm::DirectiveLanguage::getDirectives().

◆ getAllDerivedDefinitionsIfDefined()

std::vector< Record * > RecordKeeper::getAllDerivedDefinitionsIfDefined ( StringRef  ClassName) const

Get all the concrete records that inherit from specified class, if the class is defined.

Returns an empty vector if the class is not defined.

Definition at line 3013 of file Record.cpp.

References getAllDerivedDefinitions(), and getClass().

◆ getClass()

Record * llvm::RecordKeeper::getClass ( StringRef  Name) const
inline

Get the class with the specified name.

Definition at line 1927 of file Record.h.

References I, and Name.

Referenced by getAllDerivedDefinitions(), and getAllDerivedDefinitionsIfDefined().

◆ getClasses()

const RecordMap & llvm::RecordKeeper::getClasses ( ) const
inline

Get the map of classes.

Definition at line 1918 of file Record.h.

Referenced by llvm::operator<<().

◆ getDef()

Record * llvm::RecordKeeper::getDef ( StringRef  Name) const
inline

Get the concrete record with the specified name.

Definition at line 1933 of file Record.h.

References I, and Name.

Referenced by addExtraGlobal(), llvm::UnOpInit::Fold(), llvm::ExistsOpInit::Fold(), and getGlobal().

◆ getDefs()

const RecordMap & llvm::RecordKeeper::getDefs ( ) const
inline

Get the map of records (defs).

Definition at line 1921 of file Record.h.

Referenced by getAllDerivedDefinitions(), and llvm::operator<<().

◆ getGlobal()

Init * llvm::RecordKeeper::getGlobal ( StringRef  Name) const
inline

Get the Init value of the specified global variable.

Definition at line 1939 of file Record.h.

References getDef(), and Name.

◆ getGlobals()

const GlobalMap & llvm::RecordKeeper::getGlobals ( ) const
inline

Get the map of global variables.

Definition at line 1924 of file Record.h.

◆ getImpl()

detail::RecordKeeperImpl & llvm::RecordKeeper::getImpl ( )
inline

◆ getInputFilename()

const std::string llvm::RecordKeeper::getInputFilename ( ) const
inline

Get the main TableGen input file's name.

Definition at line 1915 of file Record.h.

◆ getNewAnonymousName()

Init * RecordKeeper::getNewAnonymousName ( )

GetNewAnonymousName - Generate a unique anonymous name that can be used as an identifier.

Definition at line 2933 of file Record.cpp.

References llvm::AnonymousNameInit::get(), and getImpl().

◆ saveInputFilename()

void llvm::RecordKeeper::saveInputFilename ( std::string  Filename)
inline

Definition at line 1946 of file Record.h.

Referenced by llvm::TableGenMain(), and llvm::TableGenParseFile().

◆ startBackendTimer()

void RecordKeeper::startBackendTimer ( StringRef  Name)

Start timing the overall backend.

If the backend itself starts a timer, then this timer is cleared.

Definition at line 2962 of file Record.cpp.

References Name, and startTimer().

Referenced by llvm::TableGenMain().

◆ startPhaseTiming()

void llvm::RecordKeeper::startPhaseTiming ( )
inline

Start phase timing; called if the –time-phases option is specified.

Definition at line 1974 of file Record.h.

Referenced by llvm::TableGenMain().

◆ startTimer()

void RecordKeeper::startTimer ( StringRef  Name)

Start timing a phase. Automatically stops any previous phase timer.

Definition at line 2940 of file Record.cpp.

References llvm::Timer::clear(), llvm::Timer::isRunning(), Name, llvm::Timer::startTimer(), and llvm::Timer::stopTimer().

Referenced by startBackendTimer(), and llvm::TableGenMain().

◆ stopBackendTimer()

void RecordKeeper::stopBackendTimer ( )

Stop timing the overall backend.

Definition at line 2969 of file Record.cpp.

References stopTimer().

Referenced by llvm::TableGenMain().

◆ stopPhaseTiming()

void llvm::RecordKeeper::stopPhaseTiming ( )
inline

Stop phase timing and print the report.

Definition at line 1992 of file Record.h.

Referenced by llvm::TableGenMain().

◆ stopTimer()

void RecordKeeper::stopTimer ( )

Stop timing a phase.

Definition at line 2955 of file Record.cpp.

References assert(), and llvm::Timer::stopTimer().

Referenced by stopBackendTimer(), and llvm::TableGenMain().


The documentation for this class was generated from the following files: