Walks the defining accesses of MemoryDefs. Stops after we hit something that has no defining use (e.g. a MemoryPhi or liveOnEntry). Note that, when comparing against a null def_chain_iterator, this will compare equal only after walking said Phi/liveOnEntry.

Synopsis

Declared in <llvm/Analysis/MemorySSA.h>

template<
    class T,
    bool UseOptimizedChain = false>
struct def_chain_iterator
    : iterator_facade_base<def_chain_iterator<T, UseOptimizedChain>, std::forward_iterator_tag, MemoryAccess*>

Description

The UseOptimizedChain flag specifies whether to walk the clobbering access chain, or all the accesses.

Normally, MemoryDef are all just def/use linked together, so a def_chain on a MemoryDef will walk all MemoryDefs above it in the program until it hits a phi node. The optimized chain walks the clobbering access of a store. So if you are just trying to find, given a store, what the next thing that would clobber the same memory is, you want the optimized chain.

Base Classes

Name

Description

iterator_facade_base<def_chain_iterator<T, UseOptimizedChain>, std::forward_iterator_tag, MemoryAccess*>

CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of the interface.

Type Aliases

Name

Description

difference_type

Signed type used to express the distance between iterators.

iterator_category

Iterator category tag for this facade.

pointer

Pointer type returned by the iterator.

reference

Reference type returned by the iterator.

value_type

Value type produced by the iterator.

Enums

Name

Description

Unnamed enum

Capability flags for the iterator category.

Member Functions

Name

Description

def_chain_iterator [constructor]

Constructors

operator*

operator+

Advance the iterator by n and return the result.

operator++

Post‐increment the iterator and return the previous value.

operator‐

Retreat the iterator by n and return the result.

operator‐‐

Decrement operators

operator‐>

Return a proxy pointer to the current element.

operator[]

Return a proxy to the element at offset n.

operator==

Equality operator

operator<=

Return true if this iterator is less than or equal to RHS.

operator>

Return true if this iterator is greater than RHS.

operator>=

Return true if this iterator is greater than or equal to RHS.

Protected Types

Name

Description

PointerProxy

Proxy that yields a pointer from a copied reference.

ReferenceProxy

Proxy that yields a reference from a copied iterator.

Created with MrDocs