18#ifndef KLEE_GETELEMENTPTRTYPEITERATOR_H
19#define KLEE_GETELEMENTPTRTYPEITERATOR_H
21#include "llvm/IR/User.h"
22#include "llvm/IR/DerivedTypes.h"
23#include "llvm/IR/Instructions.h"
24#include "llvm/IR/Constants.h"
29template <
typename ItTy = llvm::User::const_op_iterator>
31 :
public std::iterator<std::forward_iterator_tag, llvm::Type *, ptrdiff_t> {
32 typedef std::iterator<std::forward_iterator_tag, llvm::Type *, ptrdiff_t>
39 llvm::Value *
asValue(llvm::Value *V)
const {
return V; }
41 return llvm::ConstantInt::get(
CurTy->getContext(), llvm::APInt(32, U));
68#if LLVM_VERSION_CODE >= LLVM_VERSION(11, 0)
71 llvm::CompositeType *CT = cast<llvm::CompositeType>(
CurTy);
83#if LLVM_VERSION_CODE >= LLVM_VERSION(11, 0)
84 if (isa<llvm::StructType>(
CurTy) || isa<llvm::ArrayType>(
CurTy) ||
85 isa<llvm::VectorType>(
CurTy)) {
88 if (llvm::CompositeType *CT = dyn_cast<llvm::CompositeType>(
CurTy)) {
91 }
else if (
auto ptr = dyn_cast<llvm::PointerType>(
CurTy)) {
92 CurTy = ptr->getElementType();
143 CE->getIndices().begin());
149 template <
typename ItTy>
155 template <
typename ItTy>
llvm::Value * asValue(unsigned U) const
llvm::Type * operator->() const
llvm::Value * asValue(llvm::Value *V) const
bool operator==(const generic_gep_type_iterator &x) const
generic_gep_type_iterator & operator++()
llvm::Value * getOperand() const
bool operator!=(const generic_gep_type_iterator &x) const
generic_gep_type_iterator operator++(int)
static generic_gep_type_iterator begin(llvm::Type *Ty, ItTy It)
llvm::Type * operator*() const
generic_gep_type_iterator()
llvm::Type * getIndexedType() const
static generic_gep_type_iterator end(ItTy It)
std::iterator< std::forward_iterator_tag, llvm::Type *, ptrdiff_t > super
gep_type_iterator gep_type_begin(const llvm::User *GEP)
generic_gep_type_iterator< llvm::SmallVector< unsigned, 4 >::const_iterator > vce_type_iterator
vce_type_iterator vce_type_end(const llvm::ConstantExpr *CE)
iv_type_iterator iv_type_end(const llvm::InsertValueInst *IV)
generic_gep_type_iterator< llvm::ExtractValueInst::idx_iterator > ev_type_iterator
ev_type_iterator ev_type_begin(const llvm::ExtractValueInst *EV)
ev_type_iterator ev_type_end(const llvm::ExtractValueInst *EV)
generic_gep_type_iterator gep_type_iterator
vce_type_iterator vce_type_begin(const llvm::ConstantExpr *CE)
generic_gep_type_iterator< llvm::InsertValueInst::idx_iterator > iv_type_iterator
gep_type_iterator gep_type_end(const llvm::User *GEP)
iv_type_iterator iv_type_begin(const llvm::InsertValueInst *IV)