[llvm] r290036 - ADT: Add a getArrayRef() accessor to MapVector.
David Blaikie via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 19 20:22:24 PST 2016
Unit test?
On Fri, Dec 16, 2016 at 8:14 PM Peter Collingbourne via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> 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(); }
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161220/91f6b3e5/attachment.html>
More information about the llvm-commits
mailing list