[lld] 9a2b54a - lld: const-qualify iterations through VarStreamArray, NFC

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 12 14:30:31 PST 2021


Author: Duncan P. N. Exon Smith
Date: 2021-11-12T14:29:49-08:00
New Revision: 9a2b54af221717bf71040b530c4ac8043e1db23a

URL: https://github.com/llvm/llvm-project/commit/9a2b54af221717bf71040b530c4ac8043e1db23a
DIFF: https://github.com/llvm/llvm-project/commit/9a2b54af221717bf71040b530c4ac8043e1db23a.diff

LOG: lld: const-qualify iterations through VarStreamArray, NFC

No functionality change here; just unblocking a patch to LLVM.

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/lld/COFF/DebugTypes.cpp b/lld/COFF/DebugTypes.cpp
index 115b66c34332d..67b708c5b36a7 100644
--- a/lld/COFF/DebugTypes.cpp
+++ b/lld/COFF/DebugTypes.cpp
@@ -325,7 +325,7 @@ Error TpiSource::mergeDebugT(TypeMerger *m) {
     m->tpiCounts.resize(m->getTypeTable().size());
     m->ipiCounts.resize(m->getIDTable().size());
     uint32_t srcIdx = nbHeadIndices;
-    for (CVType &ty : types) {
+    for (const CVType &ty : types) {
       TypeIndex dstIdx = tpiMap[srcIdx++];
       // Type merging may fail, so a complex source type may become the simple
       // NotTranslated type, which cannot be used as an array index.

diff  --git a/lld/COFF/PDB.cpp b/lld/COFF/PDB.cpp
index 30d22dbd4bce5..a4cef1d0df3b2 100644
--- a/lld/COFF/PDB.cpp
+++ b/lld/COFF/PDB.cpp
@@ -975,7 +975,7 @@ void DebugSHandler::finish() {
   // size as the original. Otherwise, the file references in the line and
   // inlinee line tables will be incorrect.
   auto newChecksums = std::make_unique<DebugChecksumsSubsection>(linker.pdbStrTab);
-  for (FileChecksumEntry &fc : checksums) {
+  for (const FileChecksumEntry &fc : checksums) {
     SmallString<128> filename =
         exitOnErr(cvStrTab.getString(fc.FileNameOffset));
     pdbMakeAbsolute(filename);
@@ -1781,7 +1781,7 @@ lld::coff::getFileLineCodeView(const SectionChunk *c, uint32_t addr) {
 
   Optional<uint32_t> nameIndex;
   Optional<uint32_t> lineNumber;
-  for (LineColumnEntry &entry : lines) {
+  for (const LineColumnEntry &entry : lines) {
     for (const LineNumberEntry &ln : entry.LineNumbers) {
       LineInfo li(ln.Flags);
       if (ln.Offset > offsetInLinetable) {


        


More information about the llvm-commits mailing list