aboutsummaryrefslogtreecommitdiffstats
path: root/lib
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
commitd6a221858610a67d475e347ece92087551112ebc (patch)
treefd936214130baaac32038facee26a4d1e8436e14 /lib
parent6ddba2b933645d308428201e942abe1274fa5085 (diff)
downloadexternal_llvm-d6a221858610a67d475e347ece92087551112ebc.zip
external_llvm-d6a221858610a67d475e347ece92087551112ebc.tar.gz
external_llvm-d6a221858610a67d475e347ece92087551112ebc.tar.bz2
Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Instructions.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index d34aa59..cea496d 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/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);
}