[PATCH] D51958: [PDB] Emit old fpo data to the PDB

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 11 17:14:27 PDT 2018


rnk added inline comments.


================
Comment at: lld/COFF/PDB.cpp:899-906
+    if (DebugChunk->getSectionName() == ".debug$S")
+      RelocatedDebugContents = relocateDebugChunk(Alloc, DebugChunk, true);
+    else if (DebugChunk->getSectionName() == ".debug$F")
+      RelocatedDebugContents = relocateDebugChunk(Alloc, DebugChunk, false);
+    else
       continue;
 
----------------
You can check if the section is empty before you relocate it by checking `DebugChunk->getSize() == 0`. Then you can sink the calls to relocateDebugChunk into the .debug$S handling and only check the section name once.


================
Comment at: lld/COFF/PDB.cpp:957
       }
+    } else {
+      // Handle .debug$F.
----------------
I would handle .debug$F first and continue early to reduce indentation. It's the less complicated special case.


https://reviews.llvm.org/D51958





More information about the llvm-commits mailing list