From 3e47f87e644991517f2746fd1cc4273f3fe5be70 Mon Sep 17 00:00:00 2001 From: Djordje Todorovic Date: Tue, 10 Mar 2020 12:06:08 +0100 Subject: [PATCH] [NFC][llvm-dwarfdump] Always use 'const Twine &' According to the Twine.h comment, the Twines should only be used as const references in arguments. Differential Revision: https://reviews.llvm.org/D75727 --- llvm/tools/llvm-dwarfdump/Statistics.cpp | 2 +- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/tools/llvm-dwarfdump/Statistics.cpp b/llvm/tools/llvm-dwarfdump/Statistics.cpp index ea9539a..6ba6a70 100644 --- a/llvm/tools/llvm-dwarfdump/Statistics.cpp +++ b/llvm/tools/llvm-dwarfdump/Statistics.cpp @@ -502,7 +502,7 @@ static void printLocationStats(raw_ostream &OS, /// useful, only the delta between compiling the same program with different /// compilers is. bool collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx, - Twine Filename, raw_ostream &OS) { + const Twine &Filename, raw_ostream &OS) { StringRef FormatName = Obj.getFileFormatName(); GlobalStats GlobalStats; LocationStats LocStats; diff --git a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp index 374bdd4..28ede2e 100644 --- a/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp +++ b/llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp @@ -278,8 +278,8 @@ static bool filterArch(ObjectFile &Obj) { return false; } -using HandlerFn = std::function; +using HandlerFn = std::function; /// Print only DIEs that have a certain name. static bool filterByName(const StringSet<> &Names, DWARFDie Die, @@ -411,10 +411,10 @@ static bool lookup(ObjectFile &Obj, DWARFContext &DICtx, uint64_t Address, } bool collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx, - Twine Filename, raw_ostream &OS); + const Twine &Filename, raw_ostream &OS); -static bool dumpObjectFile(ObjectFile &Obj, DWARFContext &DICtx, Twine Filename, - raw_ostream &OS) { +static bool dumpObjectFile(ObjectFile &Obj, DWARFContext &DICtx, + const Twine &Filename, raw_ostream &OS) { logAllUnhandledErrors(DICtx.loadRegisterInfo(Obj), errs(), Filename.str() + ": "); // The UUID dump already contains all the same information. @@ -448,7 +448,7 @@ static bool dumpObjectFile(ObjectFile &Obj, DWARFContext &DICtx, Twine Filename, } static bool verifyObjectFile(ObjectFile &Obj, DWARFContext &DICtx, - Twine Filename, raw_ostream &OS) { + const Twine &Filename, raw_ostream &OS) { // Verify the DWARF and exit with non-zero exit status if verification // fails. raw_ostream &stream = Quiet ? nulls() : OS; -- 2.7.4