]> granicus.if.org Git - llvm/commit
Construct ArrayRef<const T*> from vector<T>
authorPete Cooper <peter_cooper@apple.com>
Wed, 13 May 2015 22:43:09 +0000 (22:43 +0000)
committerPete Cooper <peter_cooper@apple.com>
Wed, 13 May 2015 22:43:09 +0000 (22:43 +0000)
commit393c054cd2c6c6f2f81f5f0da119ffa9f3531086
treeee0020ebb899af580d865086f9c648d696eb59e9
parent933e6287fe81294704a1248e297a199eb7717d4c
Construct ArrayRef<const T*> from vector<T>

ArrayRef already has a SFINAE constructor which can construct ArrayRef<const T*> from ArrayRef<T*>.

This adds methods to do the same directly from SmallVector and std::vector.  This avoids an intermediate step through the use of makeArrayRef.

Also update the users of this in LICM and SROA to remove the now unnecessary makeArrayRef call.

Reviewed by David Blaikie.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@237309 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/ArrayRef.h
lib/Transforms/Scalar/LICM.cpp
lib/Transforms/Scalar/SROA.cpp