diff options
| author | Chris Lattner <sabre@nondot.org> | 2001-10-18 20:04:40 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2001-10-18 20:04:40 +0000 |
| commit | c063e738790f8aa5ec030abcb2b590eaafac4a7a (patch) | |
| tree | 1bf0885f72bd66250a8a2340e59be5372065fc95 /llvm | |
| parent | 71f16ecf1354e9872f3d300f121f9aea94735591 (diff) | |
| download | bcm5719-llvm-c063e738790f8aa5ec030abcb2b590eaafac4a7a.tar.gz bcm5719-llvm-c063e738790f8aa5ec030abcb2b590eaafac4a7a.zip | |
Add operator[] accessors
llvm-svn: 894
Diffstat (limited to 'llvm')
| -rw-r--r-- | llvm/include/llvm/ValueHolder.h | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/llvm/include/llvm/ValueHolder.h b/llvm/include/llvm/ValueHolder.h index 09aa49d0577..77bae5d6829 100644 --- a/llvm/include/llvm/ValueHolder.h +++ b/llvm/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 |

