10 if (
auto *
I = dyn_cast<GetElementPtrInst>(
this))
11 return I->getSourceElementType();
16 if (
auto *
I = dyn_cast<GetElementPtrInst>(
this))
17 return I->getResultElementType();
25 "The offset must have exactly as many bits as our pointer.");
36 if (
StructType *STy = GTI.getStructTypeOrNull()) {
Type * getSourceElementType() const
A parsed version of the target data layout string in and methods for querying it. ...
gep_type_iterator gep_type_end(const User *GEP)
Used to lazily calculate structure layout information for a target machine, based on the DataLayout s...
const StructLayout * getStructLayout(StructType *Ty) const
Returns a StructLayout object, indicating the alignment of the struct, its size, and the offsets of i...
const APInt & getValue() const
Return the constant as an APInt value reference.
Class to represent struct types.
uint64_t getZExtValue() const
Return the constant as a 64-bit unsigned integer value after it has been zero extended as appropriate...
bool accumulateConstantOffset(const DataLayout &DL, APInt &Offset) const
Accumulate the constant address offset of this GEP if possible.
uint64_t getElementOffset(unsigned Idx) const
Type * getResultElementType() const
The instances of the Type class are immutable: once they are created, they are never changed...
unsigned getBitWidth() const
Return the number of bits in the APInt.
This is the shared class of boolean and integer constants.
uint64_t getTypeAllocSize(Type *Ty) const
Returns the offset in bytes between successive objects of the specified type, including alignment pad...
bool isZero() const
This is just a convenience method to make client code smaller for a common code.
Class for arbitrary precision integers.
unsigned getPointerSizeInBits(unsigned AS=0) const
Layout pointer size, in bits FIXME: The defaults need to be removed once all of the backends/clients ...
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
unsigned getPointerAddressSpace() const
Method to return the address space of the pointer operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
APInt sextOrTrunc(unsigned width) const
Sign extend or truncate to width.
gep_type_iterator gep_type_begin(const User *GEP)