summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-05-13 07:09:08 +0000
committerGabor Greif <ggreif@gmail.com>2008-05-13 07:09:08 +0000
commit0d42adf65b48a5b97d6d17a6b557b172f892526d (patch)
tree96eced832e6eee7fb04abad4e056da928a8836b7 /llvm/lib/VMCore/Instructions.cpp
parent0479aa5c0b38c0ba1f77ecc164167ae7f9a92925 (diff)
downloadbcm5719-llvm-0d42adf65b48a5b97d6d17a6b557b172f892526d.tar.gz
bcm5719-llvm-0d42adf65b48a5b97d6d17a6b557b172f892526d.zip
Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
llvm-svn: 51023
Diffstat (limited to 'llvm/lib/VMCore/Instructions.cpp')
-rw-r--r--llvm/lib/VMCore/Instructions.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index d34aa593198..cea496d1ca7 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -2734,14 +2734,12 @@ void SwitchInst::setSuccessorV(unsigned idx, BasicBlock *B) {
GetResultInst::GetResultInst(Value *Aggregate, unsigned Index,
const std::string &Name,
Instruction *InsertBef)
- : Instruction(cast<StructType>(Aggregate->getType())->getElementType(Index),
- GetResult,
- OperandTraits<GetResultInst>::op_begin(this),
- OperandTraits<GetResultInst>::operands(this),
- InsertBef) {
- assert(isValidOperands(Aggregate, Index) && "Invalid GetResultInst operands!");
- Op<0>().init(Aggregate, this);
- Idx = Index;
+ : UnaryInstruction(cast<StructType>(Aggregate->getType())
+ ->getElementType(Index),
+ GetResult, Aggregate, InsertBef),
+ Idx(Index) {
+ assert(isValidOperands(Aggregate, Index)
+ && "Invalid GetResultInst operands!");
setName(Name);
}
OpenPOWER on IntegriCloud