class ModuleToFunctionPassAdaptor

Declaration

class ModuleToFunctionPassAdaptor : public PassInfoMixin { /* full declaration omitted */ };

Description

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.

Declared at: llvm/include/llvm/IR/PassManager.h:1199

Inherits from: PassInfoMixin

Member Variables

private std::unique_ptr<PassConceptT> Pass
private bool EagerlyInvalidate

Method Overview

  • public ModuleToFunctionPassAdaptor(std::unique_ptr<PassConceptT> Pass, bool EagerlyInvalidate)
  • public static bool isRequired()
  • public void printPipeline(llvm::raw_ostream & OS, function_ref<llvm::StringRef (llvm::StringRef)> MapClassName2PassName)
  • public llvm::PreservedAnalyses run(llvm::Module & M, llvm::ModuleAnalysisManager & AM)

Methods

ModuleToFunctionPassAdaptor(
    std::unique_ptr<PassConceptT> Pass,
    bool EagerlyInvalidate)

Declared at: llvm/include/llvm/IR/PassManager.h:1204

Parameters

std::unique_ptr<PassConceptT> Pass
bool EagerlyInvalidate

static bool isRequired()

Declared at: llvm/include/llvm/IR/PassManager.h:1213

void printPipeline(
    llvm::raw_ostream& OS,
    function_ref<llvm::StringRef(llvm::StringRef)>
        MapClassName2PassName)

Declared at: llvm/include/llvm/IR/PassManager.h:1210

Parameters

llvm::raw_ostream& OS
function_ref<llvm::StringRef(llvm::StringRef)> MapClassName2PassName

llvm::PreservedAnalyses run(
    llvm::Module& M,
    llvm::ModuleAnalysisManager& AM)

Description

Runs the function pass across every function in the module.

Declared at: llvm/include/llvm/IR/PassManager.h:1209

Parameters

llvm::Module& M
llvm::ModuleAnalysisManager& AM