aboutsummaryrefslogtreecommitdiffstats
path: root/lib/VMCore/Instructions.cpp
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2008-06-06 20:28:12 +0000
committerGabor Greif <ggreif@gmail.com>2008-06-06 20:28:12 +0000
commitb16699a191e02f6af69820dcf8a5ed92f69f3d9f (patch)
tree08290691da20e2f552fd96a605c6922dcd810700 /lib/VMCore/Instructions.cpp
parent25b3598596366ffbd88f65ecb8e0b3c273b35622 (diff)
downloadexternal_llvm-b16699a191e02f6af69820dcf8a5ed92f69f3d9f.zip
external_llvm-b16699a191e02f6af69820dcf8a5ed92f69f3d9f.tar.gz
external_llvm-b16699a191e02f6af69820dcf8a5ed92f69f3d9f.tar.bz2
make ExtractValueInst derived from UnaryInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore/Instructions.cpp')
-rw-r--r--lib/VMCore/Instructions.cpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index f66076d..4a297b3 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -999,7 +999,8 @@ static unsigned retrieveAddrSpace(const Value *Val) {
return cast<PointerType>(Val->getType())->getAddressSpace();
}
-void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx, const std::string &Name) {
+void GetElementPtrInst::init(Value *Ptr, Value* const *Idx, unsigned NumIdx,
+ const std::string &Name) {
assert(NumOperands == 1+NumIdx && "NumOperands not initialized?");
Use *OL = OperandList;
OL[0] = Ptr;
@@ -1411,7 +1412,8 @@ InsertValueInst::InsertValueInst(Value *Agg,
// ExtractValueInst Class
//===----------------------------------------------------------------------===//
-void ExtractValueInst::init(Value *Agg, const unsigned *Idx, unsigned NumIdx, const std::string &Name) {
+void ExtractValueInst::init(Value *Agg, const unsigned *Idx, unsigned NumIdx,
+ const std::string &Name) {
assert(NumOperands == 1 && "NumOperands not initialized?");
Op<0>() = Agg;
@@ -1428,8 +1430,7 @@ void ExtractValueInst::init(Value *Agg, unsigned Idx, const std::string &Name) {
}
ExtractValueInst::ExtractValueInst(const ExtractValueInst &EVI)
- : Instruction(reinterpret_cast<const Type*>(EVI.getType()), ExtractValue,
- OperandTraits<ExtractValueInst>::op_begin(this), 1),
+ : UnaryInstruction(EVI.getType(), ExtractValue, EVI.getOperand(0)),
Indices(EVI.Indices) {
}
@@ -1464,10 +1465,8 @@ ExtractValueInst::ExtractValueInst(Value *Agg,
unsigned Idx,
const std::string &Name,
BasicBlock *InsertAtEnd)
- : Instruction(checkType(getIndexedType(Agg->getType(), &Idx, 1)),
- ExtractValue,
- OperandTraits<ExtractValueInst>::op_begin(this),
- 1, InsertAtEnd) {
+ : UnaryInstruction(checkType(getIndexedType(Agg->getType(), &Idx, 1)),
+ ExtractValue, Agg, InsertAtEnd) {
init(Agg, Idx, Name);
}
@@ -1475,10 +1474,8 @@ ExtractValueInst::ExtractValueInst(Value *Agg,
unsigned Idx,
const std::string &Name,
Instruction *InsertBefore)
- : Instruction(checkType(getIndexedType(Agg->getType(), &Idx, 1)),
- ExtractValue,
- OperandTraits<ExtractValueInst>::op_begin(this),
- 1, InsertBefore) {
+ : UnaryInstruction(checkType(getIndexedType(Agg->getType(), &Idx, 1)),
+ ExtractValue, Agg, InsertBefore) {
init(Agg, Idx, Name);
}