diff options
author | Devang Patel <dpatel@apple.com> | 2008-02-20 19:26:55 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2008-02-20 19:26:55 +0000 |
commit | 474869f2b284b8c6361e5c2af41aa76b752ca356 (patch) | |
tree | 54f1cea5cf3671b2c4d47a86f356703f520f2b30 | |
parent | 4c3f844cb882a6a63959c36780ed3d8a848658a7 (diff) |
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
-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); |