lld: const-qualify iterations through VarStreamArray, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 12 Nov 2021 22:22:00 +0000 (14:22 -0800)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Fri, 12 Nov 2021 22:29:49 +0000 (14:29 -0800)
No functionality change here; just unblocking a patch to LLVM.

lld/COFF/DebugTypes.cpp
lld/COFF/PDB.cpp

index 115b66c34332daa96aea25815bf85d6631ec2fec..67b708c5b36a7b3c6e07eb3d4c1ee718f2168d3d 100644 (file)
@@ -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.
index 30d22dbd4bce5141978d526910906ce7688e7153..a4cef1d0df3b244d47238aadb22f7bb39851600a 100644 (file)
@@ -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) {