LLVM  8.0.1
Public Member Functions | List of all members
llvm::ModuleToFunctionPassAdaptor< FunctionPassT > Class Template Reference

Trivial adaptor that maps from a module to its functions. More...

#include "llvm/IR/PassManager.h"

Inheritance diagram for llvm::ModuleToFunctionPassAdaptor< FunctionPassT >:
Inheritance graph
[legend]
Collaboration diagram for llvm::ModuleToFunctionPassAdaptor< FunctionPassT >:
Collaboration graph
[legend]

Public Member Functions

 ModuleToFunctionPassAdaptor (FunctionPassT Pass)
 
PreservedAnalyses run (Module &M, ModuleAnalysisManager &AM)
 Runs the function pass across every function in the module. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from llvm::PassInfoMixin< ModuleToFunctionPassAdaptor< FunctionPassT > >
static StringRef name ()
 Gets the name of the pass we are mixed into. More...
 

Detailed Description

template<typename FunctionPassT>
class llvm::ModuleToFunctionPassAdaptor< FunctionPassT >

Trivial adaptor that maps from a module to its functions.

Designed to allow composition of a FunctionPass(Manager) and a ModulePassManager, by running the FunctionPass(Manager) over every function in the module.

Function passes run within this adaptor can rely on having exclusive access to the function they are run over. They should not read or modify any other functions! Other threads or systems may be manipulating other functions in the module, and so their state should never be relied on. FIXME: Make the above true for all of LLVM's actual passes, some still violate this principle.

Function passes can also read the module containing the function, but they should not modify that module outside of the use lists of various globals. For example, a function pass is not permitted to add functions to the module. FIXME: Make the above true for all of LLVM's actual passes, some still violate this principle.

Note that although function passes can access module analyses, module analyses are not invalidated while the function passes are running, so they may be stale. Function analyses will not be stale.

Definition at line 1276 of file PassManager.h.

Constructor & Destructor Documentation

◆ ModuleToFunctionPassAdaptor()

template<typename FunctionPassT>
llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::ModuleToFunctionPassAdaptor ( FunctionPassT  Pass)
inlineexplicit

Definition at line 1279 of file PassManager.h.

Member Function Documentation

◆ run()

template<typename FunctionPassT>
PreservedAnalyses llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::run ( Module M,
ModuleAnalysisManager AM 
)
inline

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