[PATCH] D87656: [llvm-dwarfdump] --show-sources option to show all sources
    Daniel Thornburgh via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Jun 29 09:40:42 PDT 2022
    
    
  
mysterymath added inline comments.
================
Comment at: llvm/tools/llvm-dwarfdump/llvm-dwarfdump.cpp:482-483
+  llvm::Optional<uint64_t> LastIndex = LT.getLastValidFileIndex();
+  for (uint64_t I = LT.hasFileAtIndex(0) ? 0 : 1,
+                E = LastIndex ? *LastIndex + 1 : 0;
+       I != E; ++I) {
----------------
jhenderson wrote:
> jhenderson wrote:
> > I'm not sure I see testing that exercises both sides of each of the two ternaries in this loop.
> Did this get addressed (it might have done, but I don't have time to dig into the test coverage)?
The second ternary is covered by the `%t.no-filenames.o` test, but it looks like I missed the first one when I was picking this patch back up.
The alternative case of the first ternary can only be triggered in DWARFv5, but it looks like yaml2obj doesn't fully support it for line tables yet. I've added a test through using a compiled object file for this case, with a TODO to use yaml2obj.
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87656/new/
https://reviews.llvm.org/D87656
    
    
More information about the llvm-commits
mailing list