Add makeArrayRef() overload for ArrayRef input (no-op/identity) NFC
authorMehdi Amini <mehdi.amini@apple.com>
Thu, 10 Sep 2015 00:05:04 +0000 (00:05 +0000)
committerMehdi Amini <mehdi.amini@apple.com>
Thu, 10 Sep 2015 00:05:04 +0000 (00:05 +0000)
commit4806ac4a7e4cfb6d6f386248e48849114fca085d
tree529aad790e280df3808e6cf529bbd916c50520c6
parent9e1930be4c8f967bd1efa744ccc17430d5015f80
Add makeArrayRef() overload for ArrayRef input (no-op/identity) NFC

The purpose is to allow templated wrapper to work with either
ArrayRef or any convertible operation:

template<typename Container>
void wrapper(const Container &Arr) {
  impl(makeArrayRef(Arr));
}

with Container being a std::vector, a SmallVector, or an ArrayRef.

From: Mehdi Amini <mehdi.amini@apple.com>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@247214 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/ArrayRef.h
unittests/ADT/ArrayRefTest.cpp