mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 01:18:52 +08:00
remove warnings from google-benchmarks in libcxx
Differential Revision: https://reviews.llvm.org/D25522 Patch written by Aditya Kumar. git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@284179 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -11,10 +11,11 @@ namespace ContainerBenchmarks {
|
|||||||
template <class Container, class GenInputs>
|
template <class Container, class GenInputs>
|
||||||
void BM_ConstructIterIter(benchmark::State& st, Container, GenInputs gen) {
|
void BM_ConstructIterIter(benchmark::State& st, Container, GenInputs gen) {
|
||||||
auto in = gen(st.range(0));
|
auto in = gen(st.range(0));
|
||||||
|
const auto begin = in.begin();
|
||||||
const auto end = in.end();
|
const auto end = in.end();
|
||||||
benchmark::DoNotOptimize(&in);
|
benchmark::DoNotOptimize(&in);
|
||||||
while (st.KeepRunning()) {
|
while (st.KeepRunning()) {
|
||||||
Container c(in.begin(), in.end());
|
Container c(begin, end);
|
||||||
benchmark::DoNotOptimize(c.data());
|
benchmark::DoNotOptimize(c.data());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -112,7 +112,7 @@ inline std::vector<std::string> getDuplicateStringInputs(size_t N) {
|
|||||||
|
|
||||||
inline std::vector<std::string> getRandomStringInputs(size_t N) {
|
inline std::vector<std::string> getRandomStringInputs(size_t N) {
|
||||||
std::vector<std::string> inputs;
|
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));
|
inputs.push_back(getRandomString(1024));
|
||||||
}
|
}
|
||||||
return inputs;
|
return inputs;
|
||||||
|
Reference in New Issue
Block a user