[opaque pointer type] Explicit pointee type for GEPOperator/GEPConstantExpr.
[oota-llvm.git] / lib / IR / Operator.cpp
1 #include "llvm/IR/Operator.h"
2 #include "llvm/IR/Instructions.h"
3 #include "llvm/IR/Type.h"
4
5 #include "ConstantsContext.h"
6
7 namespace llvm {
8 Type *GEPOperator::getSourceElementType() const {
9   if (auto *I = dyn_cast<GetElementPtrInst>(this))
10     return I->getSourceElementType();
11   return cast<GetElementPtrConstantExpr>(this)->getSourceElementType();
12 }
13 }