blob: dd62b04c8670af9bd783498fdea24d30162ebca1 [file] [log] [blame]
David Blaikie60310f22015-05-08 00:42:26 +00001#include "llvm/IR/Operator.h"
2#include "llvm/IR/Instructions.h"
3#include "llvm/IR/Type.h"
4
5#include "ConstantsContext.h"
6
7namespace llvm {
8Type *GEPOperator::getSourceElementType() const {
9 if (auto *I = dyn_cast<GetElementPtrInst>(this))
10 return I->getSourceElementType();
11 return cast<GetElementPtrConstantExpr>(this)->getSourceElementType();
12}
13}