[llvm-commits] [llvm] r47392 - in /llvm/trunk: include/llvm/Instructions.h lib/VMCore/Instructions.cpp
Devang Patel
dpatel at apple.com
Wed Feb 20 11:26:55 PST 2008
Author: dpatel
Date: Wed Feb 20 13:26:55 2008
New Revision: 47392
URL: http://llvm.org/viewvc/llvm-project?rev=47392&view=rev
Log:
getresult type is the type of indexed aggregate element
Modified:
llvm/trunk/include/llvm/Instructions.h
llvm/trunk/lib/VMCore/Instructions.cpp
Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=47392&r1=47391&r2=47392&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Wed Feb 20 13:26:55 2008
@@ -2367,11 +2367,6 @@
virtual GetResultInst *clone() const;
- // getType - Get aggregate value element type
- inline const Type *getType() const {
- return Aggr->getType();
- }
-
inline Value *getAggregateValue() {
return getOperand(0);
}
Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=47392&r1=47391&r2=47392&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Wed Feb 20 13:26:55 2008
@@ -2708,7 +2708,7 @@
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);
More information about the llvm-commits
mailing list