[llvm-commits] [llvm] r49560 - in /llvm/branches/ggreif/use-diet: include/llvm/Instructions.h lib/VMCore/Instructions.cpp
Gabor Greif
ggreif at gmail.com
Fri Apr 11 14:20:25 PDT 2008
Author: ggreif
Date: Fri Apr 11 16:20:25 2008
New Revision: 49560
URL: http://llvm.org/viewvc/llvm-project?rev=49560&view=rev
Log:
convert StoreInst too
Modified:
llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp
Modified: llvm/branches/ggreif/use-diet/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/include/llvm/Instructions.h?rev=49560&r1=49559&r2=49560&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/include/llvm/Instructions.h (original)
+++ llvm/branches/ggreif/use-diet/include/llvm/Instructions.h Fri Apr 11 16:20:25 2008
@@ -328,7 +328,8 @@
}
/// Transparently provide more efficient getOperand methods.
- Value *getOperand(unsigned i) const {
+ DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
+ /* Value *getOperand(unsigned i) const {
assert(i < 2 && "getOperand() out of range!");
return OperandList[i];
}
@@ -336,7 +337,7 @@
assert(i < 2 && "setOperand() out of range!");
OperandList[i] = Val;
}
- unsigned getNumOperands() const { return 2; }
+ unsigned getNumOperands() const { return 2; }*/
/// getAlignment - Return the alignment of the access that is being performed
///
@@ -362,6 +363,11 @@
}
};
+template <>
+struct OperandTraits<StoreInst> : FixedNumOperandTraits<2> {
+};
+
+DEFINE_TRANSPARENT_OPERAND_ACCESSORS(StoreInst, Value)
//===----------------------------------------------------------------------===//
// GetElementPtrInst Class
Modified: llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp?rev=49560&r1=49559&r2=49560&view=diff
==============================================================================
--- llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp (original)
+++ llvm/branches/ggreif/use-diet/lib/VMCore/Instructions.cpp Fri Apr 11 16:20:25 2008
@@ -884,7 +884,10 @@
StoreInst::StoreInst(Value *val, Value *addr, Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, /*Ops*/NULL, 2, InsertBefore) {
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertBefore) {
Op<0>().init(val, this);
Op<1>().init(addr, this);
setVolatile(false);
@@ -893,7 +896,10 @@
}
StoreInst::StoreInst(Value *val, Value *addr, BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, /*Ops*/NULL, 2, InsertAtEnd) {
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertAtEnd) {
Op<0>().init(val, this);
Op<1>().init(addr, this);
setVolatile(false);
@@ -903,7 +909,10 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, /*Ops*/NULL, 2, InsertBefore) {
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertBefore) {
Op<0>().init(val, this);
Op<1>().init(addr, this);
setVolatile(isVolatile);
@@ -913,7 +922,10 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
unsigned Align, Instruction *InsertBefore)
- : Instruction(Type::VoidTy, Store, /*Ops*/NULL, 2, InsertBefore) {
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertBefore) {
Op<0>().init(val, this);
Op<1>().init(addr, this);
setVolatile(isVolatile);
@@ -923,7 +935,10 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
unsigned Align, BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, /*Ops*/NULL, 2, InsertAtEnd) {
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertAtEnd) {
Op<0>().init(val, this);
Op<1>().init(addr, this);
setVolatile(isVolatile);
@@ -933,7 +948,10 @@
StoreInst::StoreInst(Value *val, Value *addr, bool isVolatile,
BasicBlock *InsertAtEnd)
- : Instruction(Type::VoidTy, Store, /*Ops*/NULL, 2, InsertAtEnd) {
+ : Instruction(Type::VoidTy, Store,
+ OperandTraits<StoreInst>::op_begin(this),
+ OperandTraits<StoreInst>::operands(this),
+ InsertAtEnd) {
Op<0>().init(val, this);
Op<1>().init(addr, this);
setVolatile(isVolatile);
More information about the llvm-commits
mailing list