diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-17 04:04:18 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2016-12-17 04:04:18 +0000 |
| commit | 63d2e2d8a8c83738885b63bfeedcad59a940460a (patch) | |
| tree | ff90eecdf3a8cf49affe78ba2789dac508531963 | |
| parent | 01c82f50f7f2dc2f93e354374b5a6e14c71839a0 (diff) | |
| download | bcm5719-llvm-63d2e2d8a8c83738885b63bfeedcad59a940460a.tar.gz bcm5719-llvm-63d2e2d8a8c83738885b63bfeedcad59a940460a.zip | |
ADT: Add a getArrayRef() accessor to MapVector.
llvm-svn: 290036
| -rw-r--r-- | llvm/include/llvm/ADT/MapVector.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/MapVector.h b/llvm/include/llvm/ADT/MapVector.h index f4a29efe94a..535855f2771 100644 --- a/llvm/include/llvm/ADT/MapVector.h +++ b/llvm/include/llvm/ADT/MapVector.h @@ -30,6 +30,7 @@ template<typename KeyT, typename ValueT, typename MapType = llvm::DenseMap<KeyT, unsigned>, typename VectorType = std::vector<std::pair<KeyT, ValueT> > > class MapVector { + typedef typename VectorType::value_type value_type; typedef typename VectorType::size_type size_type; MapType Map; @@ -41,6 +42,8 @@ public: typedef typename VectorType::reverse_iterator reverse_iterator; typedef typename VectorType::const_reverse_iterator const_reverse_iterator; + ArrayRef<value_type> getArrayRef() const { return Vector; } + size_type size() const { return Vector.size(); } iterator begin() { return Vector.begin(); } |

