[lld] 36c2940 - [lld-link] Remove unneeded Twine when using COFFSyncStream

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 19:49:59 PST 2024


Author: Fangrui Song
Date: 2024-12-05T19:49:53-08:00
New Revision: 36c294013cbb4ef46dfd652df1ea0bff5d20462d

URL: https://github.com/llvm/llvm-project/commit/36c294013cbb4ef46dfd652df1ea0bff5d20462d
DIFF: https://github.com/llvm/llvm-project/commit/36c294013cbb4ef46dfd652df1ea0bff5d20462d.diff

LOG: [lld-link] Remove unneeded Twine when using COFFSyncStream

Added: 
    

Modified: 
    lld/COFF/DebugTypes.cpp
    lld/COFF/Writer.cpp

Removed: 
    


################################################################################
diff  --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index 7cdea0b4516303..4d13d5d119addd 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -1149,8 +1149,8 @@ void TypeMerger::mergeTypesWithGHash() {
          "midpoint is not midpoint");
   uint32_t numTypes = std::distance(entries.begin(), mid);
   uint32_t numItems = std::distance(mid, entries.end());
-  Log(ctx) << "Tpi record count: " << Twine(numTypes);
-  Log(ctx) << "Ipi record count: " << Twine(numItems);
+  Log(ctx) << "Tpi record count: " << numTypes;
+  Log(ctx) << "Ipi record count: " << numItems;
 
   // Make a list of the "unique" type records to merge for each tpi source. Type
   // merging will skip indices not on this list. Store the destination PDB type

diff  --git a/lld/COFF/Writer.cpp b/lld/COFF/Writer.cpp
index 3a7b502907e9ad..129cce83b6b85f 100644
--- a/lld/COFF/Writer.cpp
+++ b/lld/COFF/Writer.cpp
@@ -676,9 +676,8 @@ void Writer::finalizeAddresses() {
     }
     if (rangesOk) {
       if (pass > 0)
-        Log(ctx) << "Added " << Twine(numChunks - origNumChunks)
-                 << " thunks with " << "margin " << Twine(margin) << " in "
-                 << Twine(pass) << " passes";
+        Log(ctx) << "Added " << (numChunks - origNumChunks) << " thunks with "
+                 << "margin " << margin << " in " << pass << " passes";
       return;
     }
 
@@ -2245,8 +2244,7 @@ void Writer::createRuntimePseudoRelocs() {
   }
 
   if (!rels.empty()) {
-    Log(ctx) << "Writing " << Twine(rels.size())
-             << " runtime pseudo relocations";
+    Log(ctx) << "Writing " << rels.size() << " runtime pseudo relocations";
     const char *symbolName = "_pei386_runtime_relocator";
     Symbol *relocator = ctx.symtab.findUnderscore(symbolName);
     if (!relocator)
@@ -2523,7 +2521,7 @@ void Writer::sortCRTSectionChunks(std::vector<Chunk *> &chunks) {
     for (auto &c : chunks) {
       auto sc = dyn_cast<SectionChunk>(c);
       Log(ctx) << "  " << sc->file->mb.getBufferIdentifier().str()
-               << ", SectionID: " << Twine(sc->getSectionNumber());
+               << ", SectionID: " << sc->getSectionNumber();
     }
   }
 }


        


More information about the llvm-commits mailing list