[libcxx] r284179 - remove warnings from google-benchmarks in libcxx

Sebastian Pop via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 13 17:07:58 PDT 2016


Author: spop
Date: Thu Oct 13 19:07:57 2016
New Revision: 284179

URL: http://llvm.org/viewvc/llvm-project?rev=284179&view=rev
Log:
remove warnings from google-benchmarks in libcxx

Differential Revision: https://reviews.llvm.org/D25522

Patch written by Aditya Kumar.

Modified:
    libcxx/trunk/benchmarks/ContainerBenchmarks.hpp
    libcxx/trunk/benchmarks/GenerateInput.hpp

Modified: libcxx/trunk/benchmarks/ContainerBenchmarks.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/benchmarks/ContainerBenchmarks.hpp?rev=284179&r1=284178&r2=284179&view=diff
==============================================================================
--- libcxx/trunk/benchmarks/ContainerBenchmarks.hpp (original)
+++ libcxx/trunk/benchmarks/ContainerBenchmarks.hpp Thu Oct 13 19:07:57 2016
@@ -11,10 +11,11 @@ namespace ContainerBenchmarks {
 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());
     }
 }

Modified: libcxx/trunk/benchmarks/GenerateInput.hpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/benchmarks/GenerateInput.hpp?rev=284179&r1=284178&r2=284179&view=diff
==============================================================================
--- libcxx/trunk/benchmarks/GenerateInput.hpp (original)
+++ libcxx/trunk/benchmarks/GenerateInput.hpp Thu Oct 13 19:07:57 2016
@@ -112,7 +112,7 @@ inline std::vector<std::string> getDupli
 
 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;




More information about the cfe-commits mailing list