aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/User.h
diff options
context:
space:
mode:
authorGabor Greif <ggreif@gmail.com>2009-03-09 19:57:49 +0000
committerGabor Greif <ggreif@gmail.com>2009-03-09 19:57:49 +0000
commit1dfe6a00308ec766223cc17a64a76e48bdacf4db (patch)
treed9d5cd65ac2eca31d37d9de7f3e304eee514810b /include/llvm/User.h
parent6501153fc036741a90c616083014b0f8499678fb (diff)
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
Diffstat (limited to 'include/llvm/User.h')
-rw-r--r--include/llvm/User.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/llvm/User.h b/include/llvm/User.h
index bb1a862c86..f2df23e341 100644
--- a/include/llvm/User.h
+++ b/include/llvm/User.h
@@ -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];