23 I((InitList && End) ? InitList->getNumOperands() : 0) {
27 assert(InitList == Other.InitList &&
"Incomparable iterators.");
32 return !(*
this == Other);
48 assert(CS &&
"Unrecognized type in llvm.global_ctors/llvm.global_dtors");
55 if (
Function *
F = dyn_cast_or_null<Function>(FuncC)) {
58 }
else if (
ConstantExpr *CE = dyn_cast_or_null<ConstantExpr>(FuncC)) {
60 FuncC = dyn_cast_or_null<ConstantExpr>(CE->getOperand(0));
87 auto& CXXDestructorDataPairs = DSOHandleOverride;
88 for (
auto &
P : CXXDestructorDataPairs)
90 CXXDestructorDataPairs.clear();
93 int LocalCXXRuntimeOverrides::CXAAtExitOverride(DestructorPtr Destructor,
94 void *Arg,
void *DSOHandle) {
95 auto& CXXDestructorDataPairs =
96 *
reinterpret_cast<CXXDestructorDataPairList*
>(DSOHandle);
97 CXXDestructorDataPairs.push_back(std::make_pair(Destructor, Arg));
Accessor for an element of the global_ctors/global_dtors array.
A Module instance is used to store all the information related to an LLVM module. ...
void runDestructors()
Run any destructors recorded by the overriden __cxa_atexit function (CXAAtExitOverride).
CtorDtorIterator & operator++()
Pre-increment iterator.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
A constant value that is initialized with an expression using other constant values.
iterator_range< CtorDtorIterator > getDestructors(const Module &M)
Create an iterator range over the entries of the llvm.global_ctors array.
CtorDtorIterator(const GlobalVariable *GV, bool End)
Construct an iterator instance.
This is an important base class in LLVM.
This file contains the declarations for the subclasses of Constant, which represent the different fla...
static const unsigned End
Value * getOperand(unsigned i) const
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast_or_null(const Y &Val)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
This is the shared class of boolean and integer constants.
This iterator provides a convenient way to iterate over the elements of an llvm.global_ctors/llvm.global_dtors instance.
Module.h This file contains the declarations for the Module class.
GlobalVariable * getNamedGlobal(StringRef Name)
Return the global variable in the module with the specified name, of arbitrary type.
bool operator!=(const CtorDtorIterator &Other) const
Test iterators for inequality.
bool operator==(const CtorDtorIterator &Other) const
Test iterators for equality.
A range adaptor for a pair of iterators.
ConstantArray - Constant Array Declarations.
Element operator*() const
Dereference iterator.
iterator_range< CtorDtorIterator > getConstructors(const Module &M)
Create an iterator range over the entries of the llvm.global_ctors array.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
LLVM Value Representation.