Apply another batch of fixes from clang-tidy's performance-unnecessary-value-param.
Contains some manual fixes. No functionality change intended.
llvm-svn: 273047
diff --git a/llvm/tools/llvm-profdata/llvm-profdata.cpp b/llvm/tools/llvm-profdata/llvm-profdata.cpp
index 4d590b1..8e4b4c3 100644
--- a/llvm/tools/llvm-profdata/llvm-profdata.cpp
+++ b/llvm/tools/llvm-profdata/llvm-profdata.cpp
@@ -321,18 +321,19 @@
return 0;
}
-static int showInstrProfile(std::string Filename, bool ShowCounts,
+static int showInstrProfile(const std::string &Filename, bool ShowCounts,
bool ShowIndirectCallTargets,
bool ShowDetailedSummary,
std::vector<uint32_t> DetailedSummaryCutoffs,
- bool ShowAllFunctions, std::string ShowFunction,
- bool TextFormat, raw_fd_ostream &OS) {
+ bool ShowAllFunctions,
+ const std::string &ShowFunction, bool TextFormat,
+ raw_fd_ostream &OS) {
auto ReaderOrErr = InstrProfReader::create(Filename);
- std::vector<uint32_t> Cutoffs(DetailedSummaryCutoffs);
- if (ShowDetailedSummary && DetailedSummaryCutoffs.empty()) {
+ std::vector<uint32_t> Cutoffs = std::move(DetailedSummaryCutoffs);
+ if (ShowDetailedSummary && Cutoffs.empty()) {
Cutoffs = {800000, 900000, 950000, 990000, 999000, 999900, 999990};
}
- InstrProfSummaryBuilder Builder(Cutoffs);
+ InstrProfSummaryBuilder Builder(std::move(Cutoffs));
if (Error E = ReaderOrErr.takeError())
exitWithError(std::move(E), Filename);
@@ -438,8 +439,9 @@
return 0;
}
-static int showSampleProfile(std::string Filename, bool ShowCounts,
- bool ShowAllFunctions, std::string ShowFunction,
+static int showSampleProfile(const std::string &Filename, bool ShowCounts,
+ bool ShowAllFunctions,
+ const std::string &ShowFunction,
raw_fd_ostream &OS) {
using namespace sampleprof;
LLVMContext Context;