Trivial adaptor that maps from a module to its functions.

Synopsis

Declared in <llvm/IR/PassManager.h>

class ModuleToFunctionPassAdaptor
    : public RequiredPassInfoMixin<ModuleToFunctionPassAdaptor>

Description

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.

Base Classes

Name

Description

RequiredPassInfoMixin<ModuleToFunctionPassAdaptor>

A CRTP mix‐in for passes that should not be skipped.

Type Aliases

Name

Description

PassConceptT

Type‐erased function pass concept used by this adaptor.

Member Functions

Name

Description

ModuleToFunctionPassAdaptor [constructor]

Construct an adaptor that runs Pass over each function.

printPipeline

Print this adaptor and its nested function pass as a pipeline.

run

Runs the function pass across every function in the module.

Static Member Functions

Name

Description

isRequired

Return true; required passes cannot be skipped.

Non-Member Functions

Name

Description

createModuleToFunctionPassAdaptor

A function to deduce a function pass type and wrap it in the templated adaptor.

Created with MrDocs