mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
[opaque pointer type] Change GetElementPtrInst::getIndexedType to take the pointee type
This pushes the use of PointerType::getElementType up into several callers - I'll essentially just have to keep pushing that up the stack until I can eliminate every call to it... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -882,9 +882,9 @@ public:
|
||||
/// Null is returned if the indices are invalid for the specified
|
||||
/// pointer type.
|
||||
///
|
||||
static Type *getIndexedType(Type *Ptr, ArrayRef<Value *> IdxList);
|
||||
static Type *getIndexedType(Type *Ptr, ArrayRef<Constant *> IdxList);
|
||||
static Type *getIndexedType(Type *Ptr, ArrayRef<uint64_t> IdxList);
|
||||
static Type *getIndexedType(Type *Ty, ArrayRef<Value *> IdxList);
|
||||
static Type *getIndexedType(Type *Ty, ArrayRef<Constant *> IdxList);
|
||||
static Type *getIndexedType(Type *Ty, ArrayRef<uint64_t> IdxList);
|
||||
|
||||
inline op_iterator idx_begin() { return op_begin()+1; }
|
||||
inline const_op_iterator idx_begin() const { return op_begin()+1; }
|
||||
@@ -915,9 +915,12 @@ public:
|
||||
/// GetGEPReturnType - Returns the pointer type returned by the GEP
|
||||
/// instruction, which may be a vector of pointers.
|
||||
static Type *getGEPReturnType(Value *Ptr, ArrayRef<Value *> IdxList) {
|
||||
Type *PtrTy = PointerType::get(checkGEPType(
|
||||
getIndexedType(Ptr->getType(), IdxList)),
|
||||
Ptr->getType()->getPointerAddressSpace());
|
||||
Type *PtrTy =
|
||||
PointerType::get(checkGEPType(getIndexedType(
|
||||
cast<PointerType>(Ptr->getType()->getScalarType())
|
||||
->getElementType(),
|
||||
IdxList)),
|
||||
Ptr->getType()->getPointerAddressSpace());
|
||||
// Vector GEP
|
||||
if (Ptr->getType()->isVectorTy()) {
|
||||
unsigned NumElem = cast<VectorType>(Ptr->getType())->getNumElements();
|
||||
|
Reference in New Issue
Block a user