LLVM 22.0.0git
llvm::orc::CtorDtorIterator Class Reference

This iterator provides a convenient way to iterate over the elements of an llvm.global_ctors/llvm.global_dtors instance. More...

#include "llvm/ExecutionEngine/Orc/ExecutionUtils.h"

Classes

struct  Element
 Accessor for an element of the global_ctors/global_dtors array. More...

Public Member Functions

LLVM_ABI CtorDtorIterator (const GlobalVariable *GV, bool End)
 Construct an iterator instance.
LLVM_ABI bool operator== (const CtorDtorIterator &Other) const
 Test iterators for equality.
LLVM_ABI bool operator!= (const CtorDtorIterator &Other) const
 Test iterators for inequality.
LLVM_ABI CtorDtorIteratoroperator++ ()
 Pre-increment iterator.
LLVM_ABI CtorDtorIterator operator++ (int)
 Post-increment iterator.
LLVM_ABI Element operator* () const
 Dereference iterator.

Detailed Description

This iterator provides a convenient way to iterate over the elements of an llvm.global_ctors/llvm.global_dtors instance.

The easiest way to get hold of instances of this class is to use the getConstructors/getDestructors functions.

Definition at line 52 of file ExecutionUtils.h.

Constructor & Destructor Documentation

◆ CtorDtorIterator()

llvm::orc::CtorDtorIterator::CtorDtorIterator ( const GlobalVariable * GV,
bool End )

Construct an iterator instance.

If End is true then this iterator acts as the end of the range, otherwise it is the beginning.

Definition at line 29 of file ExecutionUtils.cpp.

References llvm::dyn_cast_or_null().

Referenced by operator!=(), operator++(), operator++(), and operator==().

Member Function Documentation

◆ operator!=()

bool llvm::orc::CtorDtorIterator::operator!= ( const CtorDtorIterator & Other) const

Test iterators for inequality.

Definition at line 40 of file ExecutionUtils.cpp.

References CtorDtorIterator(), and llvm::Other.

◆ operator*()

CtorDtorIterator::Element llvm::orc::CtorDtorIterator::operator* ( ) const

Dereference iterator.

The resulting value provides a read-only view of this element of the global_ctors/global_dtors list.

Definition at line 55 of file ExecutionUtils.cpp.

References assert(), llvm::cast(), llvm::Data, llvm::dyn_cast(), llvm::dyn_cast_or_null(), F, llvm::User::getNumOperands(), llvm::User::getOperand(), and llvm::isa().

◆ operator++() [1/2]

CtorDtorIterator & llvm::orc::CtorDtorIterator::operator++ ( )

Pre-increment iterator.

Definition at line 44 of file ExecutionUtils.cpp.

References CtorDtorIterator().

◆ operator++() [2/2]

CtorDtorIterator llvm::orc::CtorDtorIterator::operator++ ( int )

Post-increment iterator.

Definition at line 49 of file ExecutionUtils.cpp.

References CtorDtorIterator().

◆ operator==()

bool llvm::orc::CtorDtorIterator::operator== ( const CtorDtorIterator & Other) const

Test iterators for equality.

Definition at line 35 of file ExecutionUtils.cpp.

References assert(), CtorDtorIterator(), and llvm::Other.


The documentation for this class was generated from the following files: