[PATCH] D25522: Remove warnings from google-benchmarks in libcxx

Aditya Kumar via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 12 09:53:41 PDT 2016


hiraditya created this revision.
hiraditya added reviewers: EricWF, mclow.lists.
hiraditya added subscribers: sebpop, cfe-commits.

https://reviews.llvm.org/D25522

Files:
  libcxx/benchmarks/ContainerBenchmarks.hpp
  libcxx/benchmarks/GenerateInput.hpp


Index: libcxx/benchmarks/GenerateInput.hpp
===================================================================
--- libcxx/benchmarks/GenerateInput.hpp
+++ libcxx/benchmarks/GenerateInput.hpp
@@ -112,7 +112,7 @@
 
 inline std::vector<std::string> getRandomStringInputs(size_t N) {
     std::vector<std::string> inputs;
-    for (int i=0; i < N; ++i) {
+    for (size_t i=0; i < N; ++i) {
         inputs.push_back(getRandomString(1024));
     }
     return inputs;
Index: libcxx/benchmarks/ContainerBenchmarks.hpp
===================================================================
--- libcxx/benchmarks/ContainerBenchmarks.hpp
+++ libcxx/benchmarks/ContainerBenchmarks.hpp
@@ -11,10 +11,11 @@
 template <class Container, class GenInputs>
 void BM_ConstructIterIter(benchmark::State& st, Container, GenInputs gen) {
     auto in = gen(st.range(0));
+    const auto begin = in.begin();
     const auto end = in.end();
     benchmark::DoNotOptimize(&in);
     while (st.KeepRunning()) {
-        Container c(in.begin(), in.end());
+        Container c(begin, end);
         benchmark::DoNotOptimize(c.data());
     }
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25522.74397.patch
Type: text/x-patch
Size: 1117 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161012/916af9ec/attachment.bin>


More information about the cfe-commits mailing list