class AnalysisUsage

Declaration

class AnalysisUsage { /* full declaration omitted */ };

Description

Represent the analysis usage information of a pass. This tracks analyses that the pass REQUIRES (must be available when the pass runs), REQUIRES TRANSITIVE (must be available throughout the lifetime of the pass), and analyses that the pass PRESERVES (the pass does not invalidate the results of these analyses). This information is provided by a pass to the Pass infrastructure through the getAnalysisUsage virtual function.

Declared at: llvm/include/llvm/PassAnalysisSupport.h:47

Member Variables

private SmallVector<llvm::AnalysisID, 8> Required
Sets of analyses required and preserved by a pass
private SmallVector<llvm::AnalysisID, 2> RequiredTransitive
private SmallVector<llvm::AnalysisID, 2> Preserved
private SmallVector<llvm::AnalysisID, 0> Used
private bool PreservesAll = false

Method Overview

Methods

AnalysisUsage()

Declared at: llvm/include/llvm/PassAnalysisSupport.h:68

template <class PassClass>
llvm::AnalysisUsage& addPreserved()

Description

Add the specified Pass class to the set of analyses preserved by this pass.

Declared at: llvm/include/llvm/PassAnalysisSupport.h:98

Templates

PassClass

llvm::AnalysisUsage& addPreserved(
    llvm::StringRef Arg)

Description

Add the Pass with the specified argument string to the set of analyses preserved by this pass. If no such Pass exists, do nothing. This can be useful when a pass is trivially preserved, but may not be linked in. Be careful about spelling!

Declared at: llvm/include/llvm/PassAnalysisSupport.h:127

Parameters

llvm::StringRef Arg

llvm::AnalysisUsage& addPreservedID(
    const void* ID)

Description

@ { Add the specified ID to the set of analyses preserved by this pass.

Declared at: llvm/include/llvm/PassAnalysisSupport.h:88

Parameters

const void* ID

llvm::AnalysisUsage& addPreservedID(char& ID)

Declared at: llvm/include/llvm/PassAnalysisSupport.h:92

Parameters

char& ID

template <class PassClass>
llvm::AnalysisUsage& addRequired()

Declared at: llvm/include/llvm/PassAnalysisSupport.h:75

Templates

PassClass

llvm::AnalysisUsage& addRequiredID(const void* ID)

Description

@ { Add the specified ID to the required set of the usage info for a pass.

Declared at: llvm/include/llvm/PassAnalysisSupport.h:72

Parameters

const void* ID

llvm::AnalysisUsage& addRequiredID(char& ID)

Declared at: llvm/include/llvm/PassAnalysisSupport.h:73

Parameters

char& ID

template <class PassClass>
llvm::AnalysisUsage& addRequiredTransitive()

Declared at: llvm/include/llvm/PassAnalysisSupport.h:81

Templates

PassClass

llvm::AnalysisUsage& addRequiredTransitiveID(
    char& ID)

Declared at: llvm/include/llvm/PassAnalysisSupport.h:79

Parameters

char& ID

template <class PassClass>
llvm::AnalysisUsage& addUsedIfAvailable()

Description

Add the specified Pass class to the set of analyses used by this pass.

Declared at: llvm/include/llvm/PassAnalysisSupport.h:117

Templates

PassClass

llvm::AnalysisUsage& addUsedIfAvailableID(
    char& ID)

Declared at: llvm/include/llvm/PassAnalysisSupport.h:111

Parameters

char& ID

llvm::AnalysisUsage& addUsedIfAvailableID(
    const void* ID)

Description

@ { Add the specified ID to the set of analyses used by this pass if they are available..

Declared at: llvm/include/llvm/PassAnalysisSupport.h:107

Parameters

const void* ID

const llvm::AnalysisUsage::VectorType&
getPreservedSet() const

Declared at: llvm/include/llvm/PassAnalysisSupport.h:148

bool getPreservesAll() const

Description

Determine whether a pass said it does not transform its input at all

Declared at: llvm/include/llvm/PassAnalysisSupport.h:133

const llvm::AnalysisUsage::VectorType&
getRequiredSet() const

Declared at: llvm/include/llvm/PassAnalysisSupport.h:144

const llvm::AnalysisUsage::VectorType&
getRequiredTransitiveSet() const

Declared at: llvm/include/llvm/PassAnalysisSupport.h:145

const llvm::AnalysisUsage::VectorType&
getUsedSet() const

Declared at: llvm/include/llvm/PassAnalysisSupport.h:149

void pushUnique(
    llvm::AnalysisUsage::VectorType& Set,
    llvm::AnalysisID ID)

Declared at: llvm/include/llvm/PassAnalysisSupport.h:62

Parameters

llvm::AnalysisUsage::VectorType& Set
llvm::AnalysisID ID

void setPreservesAll()

Description

Set by analyses that do not transform their input at all

Declared at: llvm/include/llvm/PassAnalysisSupport.h:130

void setPreservesCFG()

Description

This function should be called by the pass, iff they do not: 1. Add or remove basic blocks from the function 2. Modify terminator instructions in any way. This function annotates the AnalysisUsage info object to say that analyses that only depend on the CFG are preserved by this pass.

Declared at: llvm/include/llvm/PassAnalysisSupport.h:142