[PATCH] D107536: [BitcodeAnalyzer] allow a motivated user to dump BLOCKINFO

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 9 17:16:41 PDT 2021


mehdi_amini added inline comments.


================
Comment at: llvm/lib/Bitcode/Reader/BitcodeAnalyzer.cpp:762
+    // block, so only do it if the user explicitly requests it.
+    DumpRecords = O && O->DumpBlockinfo;
   }
----------------
mehdi_amini wrote:
> woodruffw wrote:
> > mehdi_amini wrote:
> > > 
> > `O` is `Optional<BCDumpOptions>` here, so I think we need the `O && ...` check here.
> > 
> > When I remove it, running `llvm-bcanalyzer` with no options (i.e. just `llvm-bcanalyzer foo.bc`) causes an abort in the `Optional`.
> I don't quite get why, because the block is guarded by:
> 
> `    if (O && !O->DumpBlockinfo)` ; how can we get here and `O &&`  have any effect?
Ah my bad: there is a `    if (O && !O->DumpBlockinfo)` but it only guard a single line, not the entire block.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107536



More information about the llvm-commits mailing list