[llvm] r298427 - [ADT] Add a version of llvm::join() that takes a range.
Juergen Ributzka via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 21 13:46:01 PDT 2017
Looks like this broke GreenDragon:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA_build/32391/
Could you please take a look?
Thanks
Cheers,
Juergen
On Tue, Mar 21, 2017 at 12:35 PM, Zachary Turner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:
> Author: zturner
> Date: Tue Mar 21 14:35:05 2017
> New Revision: 298427
>
> URL: http://llvm.org/viewvc/llvm-project?rev=298427&view=rev
> Log:
> [ADT] Add a version of llvm::join() that takes a range.
>
> Modified:
> llvm/trunk/include/llvm/ADT/StringExtras.h
> llvm/trunk/unittests/ADT/StringRefTest.cpp
>
> Modified: llvm/trunk/include/llvm/ADT/StringExtras.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/
> llvm/ADT/StringExtras.h?rev=298427&r1=298426&r2=298427&view=diff
> ============================================================
> ==================
> --- llvm/trunk/include/llvm/ADT/StringExtras.h (original)
> +++ llvm/trunk/include/llvm/ADT/StringExtras.h Tue Mar 21 14:35:05 2017
> @@ -234,6 +234,13 @@ inline std::string join(IteratorT Begin,
> return detail::join_impl(Begin, End, Separator, tag());
> }
>
> +/// Joins the strings in the range [R.begin(), R.end()), adding Separator
> +/// between the elements.
> +template <typename Range>
> +inline std::string join(Range &&R, StringRef Separator) {
> + return join(R.begin(), R.end(), Separator);
> +}
> +
> /// Joins the strings in the parameter pack \p Items, adding \p Separator
> /// between the elements. All arguments must be implicitly convertible to
> /// std::string, or there should be an overload of
> std::string::operator+=()
>
> Modified: llvm/trunk/unittests/ADT/StringRefTest.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/
> ADT/StringRefTest.cpp?rev=298427&r1=298426&r2=298427&view=diff
> ============================================================
> ==================
> --- llvm/trunk/unittests/ADT/StringRefTest.cpp (original)
> +++ llvm/trunk/unittests/ADT/StringRefTest.cpp Tue Mar 21 14:35:05 2017
> @@ -899,6 +899,8 @@ TEST(StringRefTest, joinStrings) {
> EXPECT_TRUE(v2_join2);
> bool v2_join3 = join(v2.begin(), v2.end(), "::") == join_result3;
> EXPECT_TRUE(v2_join3);
> + v2_join3 = join(v2, "::") == join_result3;
> + EXPECT_TRUE(v2_join3);
> }
>
>
>
>
> _______________________________________________
> 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/20170321/3fd5867a/attachment.html>
More information about the llvm-commits
mailing list