[llvm] r290036 - ADT: Add a getArrayRef() accessor to MapVector.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Fri Dec 16 20:04:19 PST 2016
Author: pcc
Date: Fri Dec 16 22:04:18 2016
New Revision: 290036
URL: http://llvm.org/viewvc/llvm-project?rev=290036&view=rev
Log:
ADT: Add a getArrayRef() accessor to MapVector.
Modified:
llvm/trunk/include/llvm/ADT/MapVector.h
Modified: llvm/trunk/include/llvm/ADT/MapVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/MapVector.h?rev=290036&r1=290035&r2=290036&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ADT/MapVector.h (original)
+++ llvm/trunk/include/llvm/ADT/MapVector.h Fri Dec 16 22:04:18 2016
@@ -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(); }
More information about the llvm-commits
mailing list