diff options
author | Dmitry Ilvokhin <d@ilvokhin.com> | 2023-09-13 17:05:30 -0400 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2023-09-13 17:05:56 -0400 |
commit | 3df9c2984b4e15c9777c3d8046927014f8a04b34 (patch) | |
tree | a6b3a075fec846f720444a36e8c6cd39b6e29a97 /libcxx/benchmarks | |
parent | d5cc372332fcf573d9182991705c58aa884e159f (diff) | |
download | llvm-3df9c2984b4e15c9777c3d8046927014f8a04b34.zip llvm-3df9c2984b4e15c9777c3d8046927014f8a04b34.tar.gz llvm-3df9c2984b4e15c9777c3d8046927014f8a04b34.tar.bz2 |
[libc++] Fix minor warnings in libcxx benchmarks
This fixes some unused variable and "comparison of integers of different
signs" warnings in the benchmarks.
Differential Revision: https://reviews.llvm.org/D156613
Diffstat (limited to 'libcxx/benchmarks')
-rw-r--r-- | libcxx/benchmarks/allocation.bench.cpp | 4 | ||||
-rw-r--r-- | libcxx/benchmarks/monotonic_buffer.bench.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/benchmarks/allocation.bench.cpp b/libcxx/benchmarks/allocation.bench.cpp index 16be2b1..1d0c71f 100644 --- a/libcxx/benchmarks/allocation.bench.cpp +++ b/libcxx/benchmarks/allocation.bench.cpp @@ -76,8 +76,8 @@ static void BM_DeallocateOnly(benchmark::State& st) { p = AllocWrapper::Allocate(alloc_size); } - void** Data = Pointers.data(); - void** const End = Pointers.data() + Pointers.size(); + void** Data = Pointers.data(); + [[maybe_unused]] void** const End = Pointers.data() + Pointers.size(); while (st.KeepRunning()) { AllocWrapper::Deallocate(*Data, alloc_size); Data += 1; diff --git a/libcxx/benchmarks/monotonic_buffer.bench.cpp b/libcxx/benchmarks/monotonic_buffer.bench.cpp index cfedbe5..39bb853 100644 --- a/libcxx/benchmarks/monotonic_buffer.bench.cpp +++ b/libcxx/benchmarks/monotonic_buffer.bench.cpp @@ -16,7 +16,7 @@ static void bm_list(benchmark::State& state) { std::pmr::monotonic_buffer_resource resource(buffer, sizeof(buffer)); for (auto _ : state) { std::pmr::list<int> l(&resource); - for (size_t i = 0; i != state.range(); ++i) { + for (int64_t i = 0; i != state.range(); ++i) { l.push_back(1); benchmark::DoNotOptimize(l); } |