LLVM 19.0.0git
Classes | Public Member Functions | List of all members
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

 CtorDtorIterator (const GlobalVariable *GV, bool End)
 Construct an iterator instance.
 
bool operator== (const CtorDtorIterator &Other) const
 Test iterators for equality.
 
bool operator!= (const CtorDtorIterator &Other) const
 Test iterators for inequality.
 
CtorDtorIteratoroperator++ ()
 Pre-increment iterator.
 
CtorDtorIterator operator++ (int)
 Post-increment iterator.
 
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 51 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 26 of file ExecutionUtils.cpp.

Member Function Documentation

◆ operator!=()

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

Test iterators for inequality.

Definition at line 37 of file ExecutionUtils.cpp.

References 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 52 of file ExecutionUtils.cpp.

References assert(), llvm::Data, F, llvm::User::getNumOperands(), and llvm::User::getOperand().

◆ operator++() [1/2]

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

Pre-increment iterator.

Definition at line 41 of file ExecutionUtils.cpp.

◆ operator++() [2/2]

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

Post-increment iterator.

Definition at line 46 of file ExecutionUtils.cpp.

◆ operator==()

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

Test iterators for equality.

Definition at line 32 of file ExecutionUtils.cpp.

References assert(), and llvm::Other.


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