LLVM 20.0.0git
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::sandboxir::PassManager< ParentPass, ContainedPass > Class Template Reference

Base class. More...

#include "llvm/SandboxIR/PassManager.h"

Inheritance diagram for llvm::sandboxir::PassManager< ParentPass, ContainedPass >:
Inheritance graph
[legend]

Public Types

using CreatePassFunc = std::function< std::unique_ptr< ContainedPass >(StringRef, StringRef)>
 

Public Member Functions

void addPass (std::unique_ptr< ContainedPass > Pass)
 Adds Pass to the pass pipeline.
 
void setPassPipeline (StringRef Pipeline, CreatePassFunc CreatePass)
 Parses Pipeline as a comma-separated sequence of pass names and sets the pass pipeline, using CreatePass to instantiate passes by name.
 
void print (raw_ostream &OS) const override
 
LLVM_DUMP_METHOD void dump () const override
 
void printPipeline (raw_ostream &OS) const override
 Similar to print() but prints one pass per line. Used for testing.
 

Protected Member Functions

 PassManager (StringRef Name)
 
 PassManager (StringRef Name, StringRef Pipeline, CreatePassFunc CreatePass)
 
 PassManager (const PassManager &)=delete
 
 PassManager (PassManager &&)=default
 
virtual ~PassManager ()=default
 
PassManageroperator= (const PassManager &)=delete
 

Protected Attributes

SmallVector< std::unique_ptr< ContainedPass > > Passes
 The list of passes that this pass manager will run.
 

Detailed Description

template<typename ParentPass, typename ContainedPass>
class llvm::sandboxir::PassManager< ParentPass, ContainedPass >

Base class.

Definition at line 34 of file PassManager.h.

Member Typedef Documentation

◆ CreatePassFunc

template<typename ParentPass , typename ContainedPass >
using llvm::sandboxir::PassManager< ParentPass, ContainedPass >::CreatePassFunc = std::function<std::unique_ptr<ContainedPass>(StringRef, StringRef)>

Definition at line 37 of file PassManager.h.

Constructor & Destructor Documentation

◆ PassManager() [1/4]

template<typename ParentPass , typename ContainedPass >
llvm::sandboxir::PassManager< ParentPass, ContainedPass >::PassManager ( StringRef  Name)
inlineprotected

Definition at line 44 of file PassManager.h.

◆ PassManager() [2/4]

template<typename ParentPass , typename ContainedPass >
llvm::sandboxir::PassManager< ParentPass, ContainedPass >::PassManager ( StringRef  Name,
StringRef  Pipeline,
CreatePassFunc  CreatePass 
)
inlineprotected

◆ PassManager() [3/4]

template<typename ParentPass , typename ContainedPass >
llvm::sandboxir::PassManager< ParentPass, ContainedPass >::PassManager ( const PassManager< ParentPass, ContainedPass > &  )
protecteddelete

◆ PassManager() [4/4]

template<typename ParentPass , typename ContainedPass >
llvm::sandboxir::PassManager< ParentPass, ContainedPass >::PassManager ( PassManager< ParentPass, ContainedPass > &&  )
protecteddefault

◆ ~PassManager()

template<typename ParentPass , typename ContainedPass >
virtual llvm::sandboxir::PassManager< ParentPass, ContainedPass >::~PassManager ( )
protectedvirtualdefault

Member Function Documentation

◆ addPass()

template<typename ParentPass , typename ContainedPass >
void llvm::sandboxir::PassManager< ParentPass, ContainedPass >::addPass ( std::unique_ptr< ContainedPass >  Pass)
inline

◆ dump()

template<typename ParentPass , typename ContainedPass >
LLVM_DUMP_METHOD void llvm::sandboxir::PassManager< ParentPass, ContainedPass >::dump ( ) const
inlineoverride

◆ operator=()

template<typename ParentPass , typename ContainedPass >
PassManager & llvm::sandboxir::PassManager< ParentPass, ContainedPass >::operator= ( const PassManager< ParentPass, ContainedPass > &  )
protecteddelete

◆ print()

template<typename ParentPass , typename ContainedPass >
void llvm::sandboxir::PassManager< ParentPass, ContainedPass >::print ( raw_ostream OS) const
inlineoverride

◆ printPipeline()

template<typename ParentPass , typename ContainedPass >
void llvm::sandboxir::PassManager< ParentPass, ContainedPass >::printPipeline ( raw_ostream OS) const
inlineoverride

Similar to print() but prints one pass per line. Used for testing.

Definition at line 197 of file PassManager.h.

References getName(), OS, and llvm::sandboxir::PassManager< ParentPass, ContainedPass >::Passes.

Referenced by llvm::sandboxir::BottomUpVec::printPipeline().

◆ setPassPipeline()

template<typename ParentPass , typename ContainedPass >
void llvm::sandboxir::PassManager< ParentPass, ContainedPass >::setPassPipeline ( StringRef  Pipeline,
CreatePassFunc  CreatePass 
)
inline

Parses Pipeline as a comma-separated sequence of pass names and sets the pass pipeline, using CreatePass to instantiate passes by name.

Passes can have arguments, for example: "pass1<arg1,arg2>,pass2,pass3<arg3,arg4>"

The arguments between angle brackets are treated as a mostly opaque string and each pass is responsible for parsing its arguments. The exception to this are nested angle brackets, which must match pair-wise to allow arguments to contain nested pipelines, like:

"pass1<subpass1,subpass2<arg1,arg2>,subpass3>"

An empty args string is treated the same as no args, so "pass" and "pass<>" are equivalent.

Definition at line 76 of file PassManager.h.

References llvm::sandboxir::PassManager< ParentPass, ContainedPass >::addPass(), assert(), llvm::CallingConv::C, llvm::SmallVectorBase< Size_T >::empty(), llvm::StringRef::empty(), llvm::enumerate(), llvm::errs(), Idx, llvm::sandboxir::PassManager< ParentPass, ContainedPass >::Passes, PassName, and llvm::StringRef::slice().

Referenced by llvm::sandboxir::PassManager< ParentPass, ContainedPass >::PassManager(), and llvm::SandboxVectorizerPass::SandboxVectorizerPass().

Member Data Documentation

◆ Passes

template<typename ParentPass , typename ContainedPass >
SmallVector<std::unique_ptr<ContainedPass> > llvm::sandboxir::PassManager< ParentPass, ContainedPass >::Passes
protected

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