make the Op<N> methods protected, how it was intended to be

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66430 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Gabor Greif
2009-03-09 19:57:49 +00:00
parent 6501153fc0
commit 1dfe6a0030

View File

@@ -82,12 +82,14 @@ public:
void operator delete(void*, unsigned) { void operator delete(void*, unsigned) {
assert(0 && "Constructor throws?"); assert(0 && "Constructor throws?");
} }
protected:
template <unsigned Idx> Use &Op() { template <unsigned Idx> Use &Op() {
return OperandTraits<User>::op_begin(this)[Idx]; return OperandTraits<User>::op_begin(this)[Idx];
} }
template <unsigned Idx> const Use &Op() const { template <unsigned Idx> const Use &Op() const {
return OperandTraits<User>::op_begin(const_cast<User*>(this))[Idx]; return OperandTraits<User>::op_begin(const_cast<User*>(this))[Idx];
} }
public:
Value *getOperand(unsigned i) const { Value *getOperand(unsigned i) const {
assert(i < NumOperands && "getOperand() out of range!"); assert(i < NumOperands && "getOperand() out of range!");
return OperandList[i]; return OperandList[i];