aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2001-10-18 20:04:40 +0000
committerChris Lattner <sabre@nondot.org>2001-10-18 20:04:40 +0000
commitc148d4e073a4da750ba91304b68c340119dfa901 (patch)
tree989c4b1b90797fb17d22d5fba3681c30c94ebce3
parent712ac2b951ea563dec9d0fc33a469fade3fe832e (diff)
Add operator[] accessors
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@894 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/llvm/ValueHolder.h15
1 files changed, 10 insertions, 5 deletions
diff --git a/include/llvm/ValueHolder.h b/include/llvm/ValueHolder.h
index 09aa49d057..77bae5d682 100644
--- a/include/llvm/ValueHolder.h
+++ b/include/llvm/ValueHolder.h
@@ -25,7 +25,6 @@
//
template<class ValueSubclass, class ItemParentType, class SymTabType>
class ValueHolder {
- // TODO: Should I use a deque instead of a vector?
vector<ValueSubclass*> ValueList;
ItemParentType *ItemParent;
@@ -50,12 +49,18 @@ public:
inline SymTabType *getParent() { return Parent; }
void setParent(SymTabType *Parent); // Defined in ValueHolderImpl.h
- inline unsigned size() const { return ValueList.size(); }
- inline bool empty() const { return ValueList.empty(); }
+ inline unsigned size() const { return ValueList.size(); }
+ inline bool empty() const { return ValueList.empty(); }
inline const ValueSubclass *front() const { return ValueList.front(); }
inline ValueSubclass *front() { return ValueList.front(); }
- inline const ValueSubclass *back() const { return ValueList.back(); }
- inline ValueSubclass *back() { return ValueList.back(); }
+ inline const ValueSubclass *back() const { return ValueList.back(); }
+ inline ValueSubclass *back() { return ValueList.back(); }
+ inline const ValueSubclass *operator[](unsigned i) const {
+ return ValueList[i];
+ }
+ inline ValueSubclass *operator[](unsigned i) {
+ return ValueList[i];
+ }
//===--------------------------------------------------------------------===//
// sub-Definition iterator code