1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00

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 9f3c2e3d61
commit de35f122f2
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);