[PATCH] D75727: [NFC][llvm-dwarfdump] Always use 'const Twine &'

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 6 04:24:21 PST 2020


djtodoro updated this revision to Diff 248693.
djtodoro added a comment.

-Rebasing


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75727/new/

https://reviews.llvm.org/D75727

Files:
  llvm/tools/llvm-dwarfdump/SectionSizes.cpp
  llvm/tools/llvm-dwarfdump/Statistics.cpp
  llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp


Index: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
===================================================================
--- llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
+++ llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp
@@ -282,8 +282,8 @@
   return false;
 }
 
-using HandlerFn = std::function<bool(ObjectFile &, DWARFContext &DICtx, Twine,
-                                     raw_ostream &)>;
+using HandlerFn = std::function<bool(ObjectFile &, DWARFContext &DICtx,
+                                     const Twine &, raw_ostream &)>;
 
 /// Print only DIEs that have a certain name.
 static bool filterByName(const StringSet<> &Names, DWARFDie Die,
@@ -415,13 +415,13 @@
 }
 
 bool collectStatsForObjectFile(ObjectFile &Obj, DWARFContext &DICtx,
-                               Twine Filename, raw_ostream &OS);
+                               const Twine &Filename, raw_ostream &OS);
 
 bool collectObjectSectionSizes(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.
@@ -455,7 +455,7 @@
 }
 
 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;
Index: llvm/tools/llvm-dwarfdump/Statistics.cpp
===================================================================
--- llvm/tools/llvm-dwarfdump/Statistics.cpp
+++ llvm/tools/llvm-dwarfdump/Statistics.cpp
@@ -502,7 +502,7 @@
 /// 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;
Index: llvm/tools/llvm-dwarfdump/SectionSizes.cpp
===================================================================
--- llvm/tools/llvm-dwarfdump/SectionSizes.cpp
+++ llvm/tools/llvm-dwarfdump/SectionSizes.cpp
@@ -94,7 +94,7 @@
 }
 
 bool collectObjectSectionSizes(ObjectFile &Obj, DWARFContext & /*DICtx*/,
-                               Twine Filename, raw_ostream &OS) {
+                               const Twine &Filename, raw_ostream &OS) {
   SectionSizes Sizes;
 
   // Get the section sizes.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75727.248693.patch
Type: text/x-patch
Size: 3055 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200306/e9c041b1/attachment.bin>


More information about the llvm-commits mailing list