getresult type is the type of indexed aggregate element

llvm-svn: 47392
This commit is contained in:
Devang Patel 2008-02-20 19:26:55 +00:00
parent 949173da7f
commit dcad9da0bc
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);