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
This commit is contained in:
Devang Patel 2008-02-20 19:26:55 +00:00
parent 4c3f844cb8
commit 474869f2b2
2 changed files with 1 additions and 6 deletions

View File

@ -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);
}

View File

@ -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);