mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-17 03:30:28 +00:00
[opaque pointer type] Access the pointee of the result type from the GEP rather than pulling it out of the pointer result type
The implementation of this GEP::getResultElementType will be refactored to either rely on a member variable, or recompute the value from the indicies (any preferences?). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1b44f585f9
commit
4ba5d91a08
@ -876,7 +876,9 @@ public:
|
|||||||
->getElementType();
|
->getElementType();
|
||||||
}
|
}
|
||||||
|
|
||||||
Type *getResultElementType() const { return getType()->getElementType(); }
|
Type *getResultElementType() const {
|
||||||
|
return cast<PointerType>(getType()->getScalarType())->getElementType();
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Returns the address space of this instruction's pointer type.
|
/// \brief Returns the address space of this instruction's pointer type.
|
||||||
unsigned getAddressSpace() const {
|
unsigned getAddressSpace() const {
|
||||||
|
@ -2462,8 +2462,7 @@ void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
|||||||
Assert(ElTy, "Invalid indices for GEP pointer type!", &GEP);
|
Assert(ElTy, "Invalid indices for GEP pointer type!", &GEP);
|
||||||
|
|
||||||
Assert(GEP.getType()->getScalarType()->isPointerTy() &&
|
Assert(GEP.getType()->getScalarType()->isPointerTy() &&
|
||||||
cast<PointerType>(GEP.getType()->getScalarType())
|
GEP.getResultElementType() == ElTy,
|
||||||
->getElementType() == ElTy,
|
|
||||||
"GEP is not of right type for indices!", &GEP, ElTy);
|
"GEP is not of right type for indices!", &GEP, ElTy);
|
||||||
|
|
||||||
if (GEP.getPointerOperandType()->isVectorTy()) {
|
if (GEP.getPointerOperandType()->isVectorTy()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user