diff options
-rw-r--r-- | include/llvm/Instructions.h | 5 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 2 |
2 files changed, 1 insertions, 6 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index c061a4a3fa..b6d5de0f52 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -2367,11 +2367,6 @@ public: virtual GetResultInst *clone() const; - // getType - Get aggregate value element type - inline const Type *getType() const { - return Aggr->getType(); - } - inline Value *getAggregateValue() { return getOperand(0); } diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index d700902a25..c1e583375a 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -2708,7 +2708,7 @@ void SwitchInst::setSuccessorV(unsigned idx, BasicBlock *B) { GetResultInst::GetResultInst(Value *Aggregate, unsigned Index, const std::string &Name, Instruction *InsertBef) - : Instruction(Aggr->getType(), + : Instruction(cast<StructType>(Aggregate->getType())->getElementType(Index), GetResult, &Aggr, 1, InsertBef) { assert(isValidOperands(Aggregate, Index) && "Invalid GetResultInst operands!"); Aggr.init(Aggregate, this); |