llvm-6502/lib/IR/Operator.cpp
David Blaikie 66583e4917 [opaque pointer type] Explicit pointee type for GEPOperator/GEPConstantExpr.
Also a couple of other changes to avoid use of
PointerType::getElementType here & there too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@236799 91177308-0d34-0410-b5e6-96231b3b80d8
2015-05-08 00:42:26 +00:00

14 lines
354 B
C++

#include "llvm/IR/Operator.h"
#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
#include "ConstantsContext.h"
namespace llvm {
Type *GEPOperator::getSourceElementType() const {
if (auto *I = dyn_cast<GetElementPtrInst>(this))
return I->getSourceElementType();
return cast<GetElementPtrConstantExpr>(this)->getSourceElementType();
}
}