class AnalysisManager

Declaration

template <typename IRUnitT, typename... ExtraArgTs>
class AnalysisManager { /* full declaration omitted */ };

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

Templates

IRUnitT
ExtraArgTs

Method Overview

Methods

AnalysisManager<IRUnitT, ExtraArgTs...>(
    bool DebugLogging = false)

Description

Construct an empty analysis manager. If \p DebugLogging is true, we'll log our progress to llvm::dbgs().

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

Parameters

bool DebugLogging = false

AnalysisManager<IRUnitT, ExtraArgTs...>(
    AnalysisManager<IRUnitT, ExtraArgTs...>&&)

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

Parameters

AnalysisManager<IRUnitT, ExtraArgTs...>&&

void clear(IRUnitT& IR, llvm::StringRef Name)

Description

Clear any cached analysis results for a single unit of IR. This doesn't invalidate, but instead simply deletes, the relevant results. It is useful when the IR is being removed and we want to clear out all the memory pinned for it.

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

Parameters

IRUnitT& IR
llvm::StringRef Name

void clear()

Description

Clear all analysis results cached by this AnalysisManager. Like \c clear(IRUnitT&), this doesn't invalidate the results; it simply deletes them. This lets you clean up the AnalysisManager when the set of IR units itself has potentially changed, and thus we can't even look up a a result and invalidate/clear it directly.

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

bool empty() const

Description

Returns true if the analysis manager has an empty results cache.

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

template <typename PassT>
typename PassT::Result* getCachedResult(
    IRUnitT& IR) const

Description

Get the cached result of an analysis pass for a given IR unit. This method never runs the analysis.

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

Templates

PassT

Parameters

IRUnitT& IR

Returns

null if there is no cached result.

template <typename PassT>
typename PassT::Result& getResult(
    IRUnitT& IR,
    ExtraArgTs... ExtraArgs)

Description

Get the result of an analysis pass for a given IR unit. Runs the analysis if a cached result is not available.

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

Templates

PassT

Parameters

IRUnitT& IR
ExtraArgTs... ExtraArgs

void invalidate(IRUnitT& IR,
                const llvm::PreservedAnalyses& PA)

Description

Invalidate cached analyses for an IR unit. Walk through all of the analyses pertaining to this unit of IR and invalidate them, unless they are preserved by the PreservedAnalyses set.

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

Parameters

IRUnitT& IR
const llvm::PreservedAnalyses& PA

template <typename PassT>
void invalidate(IRUnitT& IR)

Description

Invalidate a specific analysis pass for an IR module. Note that the analysis result can disregard invalidation, if it determines it is in fact still valid.

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

Templates

PassT

Parameters

IRUnitT& IR

template <typename PassBuilderT>
bool registerPass(PassBuilderT&& PassBuilder)

Description

Register an analysis pass with the manager. The parameter is a callable whose result is an analysis pass. This allows passing in a lambda to construct the analysis. The analysis type to register is the type returned by calling the \c PassBuilder argument. If that type has already been registered, then the argument will not be called and this function will return false. Otherwise, we register the analysis returned by calling \c PassBuilder(), and this function returns true. (Note: Although the return value of this function indicates whether or not an analysis was previously registered, there intentionally isn't a way to query this directly. Instead, you should just register all the analyses you might want and let this class run them lazily. This idiom lets us minimize the number of times we have to look up analyses in our hashtable.)

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

Templates

PassBuilderT

Parameters

PassBuilderT&& PassBuilder