virtual GetResultInst *clone() const;
- // getType - Get aggregate value element type
- inline const Type *getType() const {
- return Aggr->getType();
- }
-
inline Value *getAggregateValue() {
return getOperand(0);
}
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);