David Blaikie | 60310f2 | 2015-05-08 00:42:26 +0000 | [diff] [blame^] | 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 | } |