[llvm] [DWARFDump] Make --verify handle all sections by default (PR #81559)

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 12 21:11:25 PST 2024


================
@@ -866,7 +866,8 @@ int main(int argc, char **argv) {
     if (Verbose)
       DumpType = DIDT_All;
     else
-      DumpType = DIDT_DebugInfo;
+      // If no options are passed, verify everything but dump only debug_info.
----------------
JDevlieghere wrote:

Nit: this comment is slightly ambiguous. I think you can sidestep it by using an `else if` so it looks symmetrical with the verbose dumping. 

```
if (Verbose)
  DumpType = DIDT_All;
else if(Verify)
  DumpType = DIDT_All;
else 
  DumpType = DIDT_DebugInfo;
```

or maybe even simpler:

```
if (Verbose || Verify)
  DumpType = DIDT_All;
else 
  DumpType = DIDT_All;
```

https://github.com/llvm/llvm-project/pull/81559


More information about the llvm-commits mailing list