LLVM 20.0.0git
|
Trivial adaptor that maps from a module to its functions. More...
#include "llvm/IR/PassManager.h"
Public Types | |
using | PassConceptT = detail::PassConcept< Function, FunctionAnalysisManager > |
Public Member Functions | |
ModuleToFunctionPassAdaptor (std::unique_ptr< PassConceptT > Pass, bool EagerlyInvalidate) | |
PreservedAnalyses | run (Module &M, ModuleAnalysisManager &AM) |
Runs the function pass across every function in the module. | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Public Member Functions inherited from llvm::PassInfoMixin< ModuleToFunctionPassAdaptor > | |
void | printPipeline (raw_ostream &OS, function_ref< StringRef(StringRef)> MapClassName2PassName) |
Static Public Member Functions | |
static bool | isRequired () |
Static Public Member Functions inherited from llvm::PassInfoMixin< ModuleToFunctionPassAdaptor > | |
static StringRef | name () |
Gets the name of the pass we are mixed into. | |
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 823 of file PassManager.h.
using llvm::ModuleToFunctionPassAdaptor::PassConceptT = detail::PassConcept<Function, FunctionAnalysisManager> |
Definition at line 826 of file PassManager.h.
|
inlineexplicit |
Definition at line 828 of file PassManager.h.
|
inlinestatic |
Definition at line 837 of file PassManager.h.
void ModuleToFunctionPassAdaptor::printPipeline | ( | raw_ostream & | OS, |
function_ref< StringRef(StringRef)> | MapClassName2PassName | ||
) |
Definition at line 94 of file PassManager.cpp.
References OS.
PreservedAnalyses ModuleToFunctionPassAdaptor::run | ( | Module & | M, |
ModuleAnalysisManager & | AM | ||
) |
Runs the function pass across every function in the module.
Definition at line 104 of file PassManager.cpp.
References llvm::PreservedAnalyses::all(), F, FAM, llvm::AnalysisManager< IRUnitT, ExtraArgTs >::getResult(), llvm::AnalysisManager< IRUnitT, ExtraArgTs >::invalidate(), llvm::PreservedAnalyses::none(), llvm::PassInstrumentation::runAfterPass(), and llvm::PassInstrumentation::runBeforePass().