LLVM 20.0.0git
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Friends | List of all members
llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs > Struct Template Reference

A template wrapper used to implement the polymorphic API. More...

#include "llvm/IR/PassManagerInternal.h"

Inheritance diagram for llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >:
Inheritance graph
[legend]

Public Types

template<typename T >
using has_required_t = decltype(std::declval< T & >().isRequired())
 

Public Member Functions

 PassModel (PassT Pass)
 
 PassModel (const PassModel &Arg)
 
 PassModel (PassModel &&Arg)
 
PassModeloperator= (PassModel RHS)
 
PreservedAnalyses run (IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs) override
 The polymorphic API which runs the pass over a given IR entity.
 
void printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) override
 
StringRef name () const override
 Polymorphic method to access the name of a pass.
 
bool isRequired () const override
 Polymorphic method to let a pass optionally exempted from skipping by PassInstrumentation.
 
- Public Member Functions inherited from llvm::detail::PassConcept< IRUnitT, AnalysisManagerT, ExtraArgTs... >
virtual ~PassConcept ()=default
 
virtual PreservedAnalyses run (IRUnitT &IR, AnalysisManagerT &AM, ExtraArgTs... ExtraArgs)=0
 The polymorphic API which runs the pass over a given IR entity.
 
virtual void printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName)=0
 
virtual StringRef name () const=0
 Polymorphic method to access the name of a pass.
 
virtual bool isRequired () const=0
 Polymorphic method to let a pass optionally exempted from skipping by PassInstrumentation.
 

Static Public Member Functions

template<typename T >
static std::enable_if_t< is_detected< has_required_t, T >::value, boolpassIsRequiredImpl ()
 
template<typename T >
static std::enable_if_t<!is_detected< has_required_t, T >::value, boolpassIsRequiredImpl ()
 

Public Attributes

PassT Pass
 

Friends

void swap (PassModel &LHS, PassModel &RHS)
 

Detailed Description

template<typename IRUnitT, typename PassT, typename AnalysisManagerT, typename... ExtraArgTs>
struct llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >

A template wrapper used to implement the polymorphic API.

Can be instantiated for any object which provides a run method accepting an IRUnitT& and an AnalysisManager<IRUnit>&. It requires the pass to be a copyable object.

Definition at line 71 of file PassManagerInternal.h.

Member Typedef Documentation

◆ has_required_t

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
template<typename T >
using llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::has_required_t = decltype(std::declval<T &>().isRequired())

Definition at line 102 of file PassManagerInternal.h.

Constructor & Destructor Documentation

◆ PassModel() [1/3]

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::PassModel ( PassT  Pass)
inlineexplicit

Definition at line 72 of file PassManagerInternal.h.

◆ PassModel() [2/3]

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::PassModel ( const PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs > &  Arg)
inline

Definition at line 75 of file PassManagerInternal.h.

◆ PassModel() [3/3]

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::PassModel ( PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs > &&  Arg)
inline

Definition at line 76 of file PassManagerInternal.h.

Member Function Documentation

◆ isRequired()

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
bool llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::isRequired ( ) const
inlineoverridevirtual

Polymorphic method to let a pass optionally exempted from skipping by PassInstrumentation.

To opt-in, pass should implement static bool isRequired(). It's no-op to have isRequired always return false since that is the default.

Implements llvm::detail::PassConcept< IRUnitT, AnalysisManagerT, ExtraArgTs... >.

Definition at line 115 of file PassManagerInternal.h.

◆ name()

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
StringRef llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::name ( ) const
inlineoverridevirtual

Polymorphic method to access the name of a pass.

Implements llvm::detail::PassConcept< IRUnitT, AnalysisManagerT, ExtraArgTs... >.

Definition at line 99 of file PassManagerInternal.h.

◆ operator=()

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
PassModel & llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::operator= ( PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >  RHS)
inline

◆ passIsRequiredImpl() [1/2]

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
template<typename T >
static std::enable_if_t< is_detected< has_required_t, T >::value, bool > llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::passIsRequiredImpl ( )
inlinestatic

Definition at line 106 of file PassManagerInternal.h.

◆ passIsRequiredImpl() [2/2]

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
template<typename T >
static std::enable_if_t<!is_detected< has_required_t, T >::value, bool > llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::passIsRequiredImpl ( )
inlinestatic

Definition at line 111 of file PassManagerInternal.h.

◆ printPipeline()

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
void llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::printPipeline ( raw_ostream OS,
function_ref< StringRef(StringRef)>  MapClassName2PassName 
)
inlineoverridevirtual

◆ run()

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
PreservedAnalyses llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::run ( IRUnitT &  IR,
AnalysisManagerT &  AM,
ExtraArgTs...  ExtraArgs 
)
inlineoverridevirtual

The polymorphic API which runs the pass over a given IR entity.

Note that actual pass object can omit the analysis manager argument if desired. Also that the analysis manager may be null if there is no analysis manager in the pass pipeline.

Implements llvm::detail::PassConcept< IRUnitT, AnalysisManagerT, ExtraArgTs... >.

Definition at line 88 of file PassManagerInternal.h.

References IR.

Friends And Related Function Documentation

◆ swap

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
void swap ( PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs > &  LHS,
PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs > &  RHS 
)
friend

Member Data Documentation

◆ Pass

template<typename IRUnitT , typename PassT , typename AnalysisManagerT , typename... ExtraArgTs>
PassT llvm::detail::PassModel< IRUnitT, PassT, AnalysisManagerT, ExtraArgTs >::Pass

Definition at line 117 of file PassManagerInternal.h.


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