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

William Woodruff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 9 13:55:15 PDT 2021


woodruffw 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:
> 
`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`.


================
Comment at: llvm/test/tools/llvm-bcanalyzer/dump-blockinfo.test:1
+# RUN: llvm-stress | llvm-as - | llvm-bcanalyzer --dump --dump-blockinfo | FileCheck %s
+
----------------
mehdi_amini wrote:
> tejohnson wrote:
> > woodruffw wrote:
> > > N.B.: Please let me know if using `llvm-stress` like this isn't advisable; I can check in a test input instead if that's preferred.
> > Can you make this a small .ll test instead (see examples in other test directories) and just run it through opt to get a bitcode and then run llvm-bcanalyzer on that?
> > 
> > And then is it possible to check some of the expected contents of the blockinfo section?
> What Theresa suggests makes sense to me.
Done!


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