OSDN Git Service

make the Op<N> methods protected, how it was intended to be
authorGabor Greif <ggreif@gmail.com>
Mon, 9 Mar 2009 19:57:49 +0000 (19:57 +0000)
committerGabor Greif <ggreif@gmail.com>
Mon, 9 Mar 2009 19:57:49 +0000 (19:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66430 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/User.h

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