From 60310f2720b7f7b3b39ff3464479d498be17cb48 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Fri, 8 May 2015 00:42:26 +0000 Subject: [opaque pointer type] Explicit pointee type for GEPOperator/GEPConstantExpr. Also a couple of other changes to avoid use of PointerType::getElementType here & there too. llvm-svn: 236799 --- llvm/lib/IR/Operator.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 llvm/lib/IR/Operator.cpp (limited to 'llvm/lib/IR/Operator.cpp') diff --git a/llvm/lib/IR/Operator.cpp b/llvm/lib/IR/Operator.cpp new file mode 100644 index 00000000000..dd62b04c867 --- /dev/null +++ b/llvm/lib/IR/Operator.cpp @@ -0,0 +1,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(this)) + return I->getSourceElementType(); + return cast(this)->getSourceElementType(); +} +} -- cgit v1.2.3