[PATCH] D80989: [DebugInfo] Print non-verbose output at some point as verbose output

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 3 12:05:38 PDT 2020


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

Looks good - some optional feedback.



================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:744-749
   while (*OffsetPtr < EndOffset) {
-    if (OS)
+    if (OS && !HeaderPrinted) {
+      *OS << "\n";
+      Row::dumpTableHeader(*OS, Verbose ? 12 : 0);
+      HeaderPrinted = true;
+    }
----------------
Maybe put this outside the while loop so it doesn't have to be tested every time?

```
if (*OffsetPtr < EndOffset && OS)
  Row::dumpTableHeader(*OS << '\n', Verbose ? 12 : 0);
while (*OffsetPtr < EndOffset)
  ...
```

Though it does mean duplicating the loop condition (could put it in a lambda), which isn't ideal either - certainly up to you, just figured I'd float the idea.


================
Comment at: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp:920-922
+        if (OS) {
           State.Row.dump(*OS);
         }
----------------
Could drop the braces here


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80989





More information about the llvm-commits mailing list