From 474869f2b284b8c6361e5c2af41aa76b752ca356 Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Wed, 20 Feb 2008 19:26:55 +0000 Subject: [PATCH] getresult type is the type of indexed aggregate element git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47392 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Instructions.h | 5 ----- lib/VMCore/Instructions.cpp | 2 +- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index c061a4a3fa6..b6d5de0f525 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 d700902a256..c1e583375a2 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(Aggregate->getType())->getElementType(Index), GetResult, &Aggr, 1, InsertBef) { assert(isValidOperands(Aggregate, Index) && "Invalid GetResultInst operands!"); Aggr.init(Aggregate, this);