X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=include%2Fllvm%2FOperandTraits.h;h=3d8dc329b39fe0be346fa250b58f87e8e395d93f;hb=b95fc31aa2e5a0a0b9ee1909d1cb949577c5aa16;hp=dbdb1a15494e8bb54dca812a3db186c84ba5c03b;hpb=67c619ba3eae68dcdb3f9340d82b33173aa0c256;p=oota-llvm.git diff --git a/include/llvm/OperandTraits.h b/include/llvm/OperandTraits.h index dbdb1a15494..3d8dc329b39 100644 --- a/include/llvm/OperandTraits.h +++ b/include/llvm/OperandTraits.h @@ -38,16 +38,6 @@ struct FixedNumOperandTraits { static unsigned operands(const User*) { return ARITY; } - struct prefix { - Use Ops[ARITY]; - prefix(); // DO NOT IMPLEMENT - }; - template - struct Layout { - struct overlay : public prefix, public U { - overlay(); // DO NOT IMPLEMENT - }; - }; }; //===----------------------------------------------------------------------===// @@ -146,45 +136,8 @@ CLASS::const_op_iterator CLASS::op_end() const { \ VALUECLASS *CLASS::getOperand(unsigned i_nocapture) const { \ assert(i_nocapture < OperandTraits::operands(this) \ && "getOperand() out of range!"); \ - return static_cast( \ - OperandTraits::op_begin(const_cast(this))[i_nocapture]); \ -} \ -void CLASS::setOperand(unsigned i_nocapture, VALUECLASS *Val_nocapture) { \ - assert(i_nocapture < OperandTraits::operands(this) \ - && "setOperand() out of range!"); \ - OperandTraits::op_begin(this)[i_nocapture] = Val_nocapture; \ -} \ -unsigned CLASS::getNumOperands() const { \ - return OperandTraits::operands(this); \ -} \ -template Use &CLASS::Op() { \ - return this->OpFrom(this); \ -} \ -template const Use &CLASS::Op() const { \ - return this->OpFrom(this); \ -} - - -/// Macro for generating out-of-class operand accessor -/// definitions with casted result -#define DEFINE_TRANSPARENT_CASTED_OPERAND_ACCESSORS(CLASS, VALUECLASS) \ -CLASS::op_iterator CLASS::op_begin() { \ - return OperandTraits::op_begin(this); \ -} \ -CLASS::const_op_iterator CLASS::op_begin() const { \ - return OperandTraits::op_begin(const_cast(this)); \ -} \ -CLASS::op_iterator CLASS::op_end() { \ - return OperandTraits::op_end(this); \ -} \ -CLASS::const_op_iterator CLASS::op_end() const { \ - return OperandTraits::op_end(const_cast(this)); \ -} \ -VALUECLASS *CLASS::getOperand(unsigned i_nocapture) const { \ - assert(i_nocapture < OperandTraits::operands(this) \ - && "getOperand() out of range!"); \ - return cast( \ - OperandTraits::op_begin(const_cast(this))[i_nocapture]); \ + return cast_or_null( \ + OperandTraits::op_begin(const_cast(this))[i_nocapture].get()); \ } \ void CLASS::setOperand(unsigned i_nocapture, VALUECLASS *Val_nocapture) { \ assert(i_nocapture < OperandTraits::operands(this) \