Skip to content

Commit

Permalink
bench: Fix clang-17 compiler warnings (#597)
Browse files Browse the repository at this point in the history
  • Loading branch information
chfast authored Mar 26, 2023
1 parent 0cfd850 commit dd1b623
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions test/bench/bench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ void register_benchmarks(std::span<const BenchmarkCase> benchmark_cases)
for (auto& [vm_name, vm] : registered_vms)
{
const auto name = std::string{vm_name} + "/total/" + case_name;
RegisterBenchmark(name.c_str(), [&vm = vm, &b, &input](State& state) {
bench_evmc_execute(state, vm, b.code, input.input, input.expected_output);
RegisterBenchmark(name.c_str(), [&vm_ = vm, &b, &input](State& state) {
bench_evmc_execute(state, vm_, b.code, input.input, input.expected_output);
})->Unit(kMicrosecond);
}
}
Expand Down
8 changes: 4 additions & 4 deletions test/bench/synthetic_benchmarks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,18 +257,18 @@ void register_synthetic_benchmarks()
for (auto& [vm_name, vm] : registered_vms)
{
RegisterBenchmark((std::string{vm_name} + "/total/synth/loop_v1").c_str(),
[&vm = vm](State& state) { bench_evmc_execute(state, vm, generate_loop_v1({})); });
[&vm_ = vm](State& state) { bench_evmc_execute(state, vm_, generate_loop_v1({})); });
RegisterBenchmark((std::string{vm_name} + "/total/synth/loop_v2").c_str(),
[&vm = vm](State& state) { bench_evmc_execute(state, vm, generate_loop_v2({})); });
[&vm_ = vm](State& state) { bench_evmc_execute(state, vm_, generate_loop_v2({})); });
}

for (const auto params : params_list)
{
for (auto& [vm_name, vm] : registered_vms)
{
RegisterBenchmark((std::string{vm_name} + "/total/synth/" + to_string(params)).c_str(),
[&vm = vm, params](
State& state) { bench_evmc_execute(state, vm, generate_code(params)); })
[&vm_ = vm, params](
State& state) { bench_evmc_execute(state, vm_, generate_code(params)); })
->Unit(kMicrosecond);
}
}
Expand Down

0 comments on commit dd1b623

Please sign in to comment.