forked from OSchip/llvm-project
getresult type is the type of indexed aggregate element
llvm-svn: 47392
This commit is contained in:
parent
949173da7f
commit
dcad9da0bc
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue