LLVM 19.0.0git
Public Types | Public Member Functions | List of all members
llvm::PassInfo Class Reference

PassInfo class - An instance of this class exists for every pass known by the system, and can be obtained from a live Pass by calling its getPassInfo() method. More...

#include "llvm/PassInfo.h"

Inheritance diagram for llvm::PassInfo:
Inheritance graph
[legend]

Public Types

using NormalCtor_t = Pass *(*)()
 

Public Member Functions

 PassInfo (StringRef name, StringRef arg, const void *pi, NormalCtor_t normal, bool isCFGOnly, bool is_analysis)
 PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass.
 
 PassInfo (StringRef name, const void *pi)
 PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass.
 
 PassInfo (const PassInfo &)=delete
 
PassInfooperator= (const PassInfo &)=delete
 
StringRef getPassName () const
 getPassName - Return the friendly name for the pass, never returns null
 
StringRef getPassArgument () const
 getPassArgument - Return the command line option that may be passed to 'opt' that will cause this pass to be run.
 
const void * getTypeInfo () const
 getTypeInfo - Return the id object for the pass... TODO : Rename
 
bool isPassID (const void *IDPtr) const
 Return true if this PassID implements the specified ID pointer.
 
bool isAnalysisGroup () const
 isAnalysisGroup - Return true if this is an analysis group, not a normal pass.
 
bool isAnalysis () const
 
bool isCFGOnlyPass () const
 isCFGOnlyPass - return true if this pass only looks at the CFG for the function.
 
NormalCtor_t getNormalCtor () const
 getNormalCtor - Return a pointer to a function, that when called, creates an instance of the pass and returns it.
 
void setNormalCtor (NormalCtor_t Ctor)
 
PasscreatePass () const
 createPass() - Use this method to create an instance of this pass.
 
void addInterfaceImplemented (const PassInfo *ItfPI)
 addInterfaceImplemented - This method is called when this pass is registered as a member of an analysis group with the RegisterAnalysisGroup template.
 
const std::vector< const PassInfo * > & getInterfacesImplemented () const
 getInterfacesImplemented - Return a list of all of the analysis group interfaces implemented by this pass.
 

Detailed Description

PassInfo class - An instance of this class exists for every pass known by the system, and can be obtained from a live Pass by calling its getPassInfo() method.

These objects are set up by the RegisterPass<> template.

Definition at line 30 of file PassInfo.h.

Member Typedef Documentation

◆ NormalCtor_t

Definition at line 32 of file PassInfo.h.

Constructor & Destructor Documentation

◆ PassInfo() [1/3]

llvm::PassInfo::PassInfo ( StringRef  name,
StringRef  arg,
const void *  pi,
NormalCtor_t  normal,
bool  isCFGOnly,
bool  is_analysis 
)
inline

PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass.

Definition at line 47 of file PassInfo.h.

◆ PassInfo() [2/3]

llvm::PassInfo::PassInfo ( StringRef  name,
const void *  pi 
)
inline

PassInfo ctor - Do not call this directly, this should only be invoked through RegisterPass.

This version is for use by analysis groups; it does not auto-register the pass.

Definition at line 55 of file PassInfo.h.

◆ PassInfo() [3/3]

llvm::PassInfo::PassInfo ( const PassInfo )
delete

Member Function Documentation

◆ addInterfaceImplemented()

void llvm::PassInfo::addInterfaceImplemented ( const PassInfo ItfPI)
inline

addInterfaceImplemented - This method is called when this pass is registered as a member of an analysis group with the RegisterAnalysisGroup template.

Definition at line 107 of file PassInfo.h.

Referenced by llvm::PassRegistry::registerAnalysisGroup().

◆ createPass()

Pass * llvm::PassInfo::createPass ( ) const
inline

createPass() - Use this method to create an instance of this pass.

Definition at line 96 of file PassInfo.h.

References assert(), and isAnalysisGroup().

Referenced by llvm::PMDataManager::add(), llvm::Pass::createPass(), and llvm::PMTopLevelManager::schedulePass().

◆ getInterfacesImplemented()

const std::vector< const PassInfo * > & llvm::PassInfo::getInterfacesImplemented ( ) const
inline

getInterfacesImplemented - Return a list of all of the analysis group interfaces implemented by this pass.

Definition at line 113 of file PassInfo.h.

Referenced by llvm::PMTopLevelManager::addImmutablePass(), llvm::PMDataManager::freePass(), and llvm::PMDataManager::recordAvailableAnalysis().

◆ getNormalCtor()

NormalCtor_t llvm::PassInfo::getNormalCtor ( ) const
inline

getNormalCtor - Return a pointer to a function, that when called, creates an instance of the pass and returns it.

This pointer may be null if there is no default constructor for the pass.

Definition at line 88 of file PassInfo.h.

Referenced by llvm::PassRegistry::registerAnalysisGroup().

◆ getPassArgument()

StringRef llvm::PassInfo::getPassArgument ( ) const
inline

getPassArgument - Return the command line option that may be passed to 'opt' that will cause this pass to be run.

This will return null if there is no argument.

Definition at line 67 of file PassInfo.h.

Referenced by llvm::PassRegistry::registerPass(), and llvm::PMTopLevelManager::schedulePass().

◆ getPassName()

StringRef llvm::PassInfo::getPassName ( ) const
inline

getPassName - Return the friendly name for the pass, never returns null

Definition at line 62 of file PassInfo.h.

Referenced by llvm::Pass::getPassName().

◆ getTypeInfo()

const void * llvm::PassInfo::getTypeInfo ( ) const
inline

getTypeInfo - Return the id object for the pass... TODO : Rename

Definition at line 71 of file PassInfo.h.

Referenced by llvm::AnalysisUsage::addPreserved(), getPassIDFromName(), and llvm::PassRegistry::registerPass().

◆ isAnalysis()

bool llvm::PassInfo::isAnalysis ( ) const
inline

Definition at line 79 of file PassInfo.h.

Referenced by llvm::PMTopLevelManager::schedulePass().

◆ isAnalysisGroup()

bool llvm::PassInfo::isAnalysisGroup ( ) const
inline

isAnalysisGroup - Return true if this is an analysis group, not a normal pass.

Definition at line 78 of file PassInfo.h.

Referenced by createPass(), and llvm::PassRegistry::registerAnalysisGroup().

◆ isCFGOnlyPass()

bool llvm::PassInfo::isCFGOnlyPass ( ) const
inline

isCFGOnlyPass - return true if this pass only looks at the CFG for the function.

Definition at line 83 of file PassInfo.h.

◆ isPassID()

bool llvm::PassInfo::isPassID ( const void *  IDPtr) const
inline

Return true if this PassID implements the specified ID pointer.

Definition at line 74 of file PassInfo.h.

◆ operator=()

PassInfo & llvm::PassInfo::operator= ( const PassInfo )
delete

◆ setNormalCtor()

void llvm::PassInfo::setNormalCtor ( NormalCtor_t  Ctor)
inline

Definition at line 91 of file PassInfo.h.

Referenced by llvm::PassRegistry::registerAnalysisGroup().


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