summaryrefslogtreecommitdiffstats
path: root/llvm/tools
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools')
-rw-r--r--llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp2
-rw-r--r--llvm/tools/sancov/sancov.cc14
-rw-r--r--llvm/tools/yaml2obj/yaml2macho.cpp4
3 files changed, 10 insertions, 10 deletions
diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
index 415de6c591f..fb6c7f4ffe8 100644
--- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -158,7 +158,7 @@ int main(int argc, char **argv) {
// Expand any .dSYM bundles to the individual object files contained therein.
std::vector<std::string> Objects;
- for (auto F : InputFilenames) {
+ for (const auto &F : InputFilenames) {
auto Objs = expandBundle(F);
Objects.insert(Objects.end(), Objs.begin(), Objs.end());
}
diff --git a/llvm/tools/sancov/sancov.cc b/llvm/tools/sancov/sancov.cc
index 891304d4f13..efeb46a1faa 100644
--- a/llvm/tools/sancov/sancov.cc
+++ b/llvm/tools/sancov/sancov.cc
@@ -894,7 +894,7 @@ public:
OS << "<table>\n";
OS << "<tr><th>File</th><th>Coverage %</th>";
OS << "<th>Hit (Total) Fns</th></tr>\n";
- for (auto FileName : Files) {
+ for (const auto &FileName : Files) {
std::pair<size_t, size_t> FC = FileCoverage[FileName];
if (FC.first == 0) {
NotCoveredFilesCount++;
@@ -915,7 +915,7 @@ public:
if (NotCoveredFilesCount) {
OS << "<details><summary>Not Touched Files</summary>\n";
OS << "<table>\n";
- for (auto FileName : Files) {
+ for (const auto &FileName : Files) {
std::pair<size_t, size_t> FC = FileCoverage[FileName];
if (FC.first == 0)
OS << "<tr><td>" << stripPathPrefix(FileName) << "</td>\n";
@@ -927,7 +927,7 @@ public:
}
// Source
- for (auto FileName : Files) {
+ for (const auto &FileName : Files) {
std::pair<size_t, size_t> FC = FileCoverage[FileName];
if (FC.first == 0)
continue;
@@ -969,7 +969,7 @@ public:
FileLoc Loc = FileLoc{FileName, Line};
auto It = AllFnsByLoc.find(Loc);
if (It != AllFnsByLoc.end()) {
- for (std::string Fn : It->second) {
+ for (const std::string &Fn : It->second) {
OS << "<a name=\"" << anchorName(FileName + "::" + Fn)
<< "\"></a>";
};
@@ -1069,7 +1069,7 @@ public:
std::vector<std::unique_ptr<CoverageDataWithObjectFile>> MergedCoverage;
for (const auto &Pair : CoverageByObjFile) {
if (findSanitizerCovFunctions(Pair.first).empty()) {
- for (auto FileName : Pair.second) {
+ for (const auto &FileName : Pair.second) {
CovFiles.erase(FileName);
}
@@ -1159,7 +1159,7 @@ public:
// About
OS << "<details><summary>About</summary>\n";
OS << "Coverage files:<ul>";
- for (auto InputFile : CoverageFiles) {
+ for (const auto &InputFile : CoverageFiles) {
llvm::sys::fs::file_status Status;
llvm::sys::fs::status(InputFile, Status);
OS << "<li>" << stripPathPrefix(InputFile) << " ("
@@ -1209,7 +1209,7 @@ int main(int argc, char **argv) {
return 0;
} else if (Action == PrintCovPointsAction) {
// -print-coverage-points doesn't need coverage files.
- for (std::string ObjFile : ClInputFiles) {
+ for (const std::string &ObjFile : ClInputFiles) {
printCovPoints(ObjFile, outs());
}
return 0;
diff --git a/llvm/tools/yaml2obj/yaml2macho.cpp b/llvm/tools/yaml2obj/yaml2macho.cpp
index 57f36d6a90d..9faa767e9a6 100644
--- a/llvm/tools/yaml2obj/yaml2macho.cpp
+++ b/llvm/tools/yaml2obj/yaml2macho.cpp
@@ -116,7 +116,7 @@ template <>
size_t writeLoadCommandData<MachO::segment_command>(MachOYAML::LoadCommand &LC,
raw_ostream &OS) {
size_t BytesWritten = 0;
- for (auto Sec : LC.Sections) {
+ for (const auto &Sec : LC.Sections) {
auto TempSec = constructSection<MachO::section>(Sec);
OS.write(reinterpret_cast<const char *>(&(TempSec)),
sizeof(MachO::section));
@@ -130,7 +130,7 @@ size_t
writeLoadCommandData<MachO::segment_command_64>(MachOYAML::LoadCommand &LC,
raw_ostream &OS) {
size_t BytesWritten = 0;
- for (auto Sec : LC.Sections) {
+ for (const auto &Sec : LC.Sections) {
auto TempSec = constructSection<MachO::section_64>(Sec);
TempSec.reserved3 = Sec.reserved3;
OS.write(reinterpret_cast<const char *>(&(TempSec)),
OpenPOWER on IntegriCloud