summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Operator.cpp
blob: dd62b04c8670af9bd783498fdea24d30162ebca1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#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();
}
}
OpenPOWER on IntegriCloud