From 3402d6bba1cf95af36c699b4d53aaaa3255fd425 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Tue, 12 May 2020 18:26:47 -0500 Subject: [PATCH] clang10 proting Change-Id: I071833f9d1f46df105f7ef1749c5d17d989bbb05 [ROCm/rocprofiler commit: 04aea8c3dfc47182691dbc312720cd2e2a9dd7da] --- projects/rocprofiler/src/core/context.h | 2 +- projects/rocprofiler/src/core/metrics.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocprofiler/src/core/context.h b/projects/rocprofiler/src/core/context.h index 88320ef32f..7131d3383b 100644 --- a/projects/rocprofiler/src/core/context.h +++ b/projects/rocprofiler/src/core/context.h @@ -257,7 +257,7 @@ class Context { void GetMetricsData() const { const MetricArgs args(info_map_); - for (const auto v : metrics_map_) { + for (const auto& v : metrics_map_) { const std::string& name = v.first; const Metric* metric = v.second; const xml::Expr* expr = metric->GetExpr(); diff --git a/projects/rocprofiler/src/core/metrics.h b/projects/rocprofiler/src/core/metrics.h index 57ec7c3199..a221168a55 100644 --- a/projects/rocprofiler/src/core/metrics.h +++ b/projects/rocprofiler/src/core/metrics.h @@ -277,7 +277,7 @@ class MetricsDict { std::cout << name << "=" << expr_obj->String() << "\n" << std::endl; #endif counters_vec_t counters_vec; - for (const std::string var : expr_obj->GetVars()) { + for (const std::string& var : expr_obj->GetVars()) { auto it = cache_.find(var); if (it == cache_.end()) { EXC_RAISING(HSA_STATUS_ERROR, "Bad metric '" << name << "', var '" << var << "' is not found");