[llvm-commits] [llvm] r66430 - /llvm/trunk/include/llvm/User.h
Gabor Greif
ggreif at gmail.com
Mon Mar 9 12:57:50 PDT 2009
Author: ggreif
Date: Mon Mar 9 14:57:49 2009
New Revision: 66430
URL: http://llvm.org/viewvc/llvm-project?rev=66430&view=rev
Log:
make the Op<N> methods protected, how it was intended to be
Modified:
llvm/trunk/include/llvm/User.h
Modified: llvm/trunk/include/llvm/User.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/User.h?rev=66430&r1=66429&r2=66430&view=diff
==============================================================================
--- llvm/trunk/include/llvm/User.h (original)
+++ llvm/trunk/include/llvm/User.h Mon Mar 9 14:57:49 2009
@@ -82,12 +82,14 @@
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];
More information about the llvm-commits
mailing list