[PATCH] D69751: [AsmWritter] Fixed "null check after dereferencing" warning

Mac via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 12 06:06:58 PDT 2021


tydeu added a comment.
Herald added a subscriber: dexonsmith.

@jyknight @xbolva00

Couldn't printing orphaned basic blocks be supported by simply having `IsEntryBlock` be `true` if the block is orphaned? That is, by simply changing the top two lines of the function to:

  assert(BB && "block is null!");
  bool IsEntryBlock = !BB->getParent() || BB->isEntryBlock();

For some background: I encountered an unexpected crash while trying to dump and orphan basic block for debugging purposes. When I investigated it, I discovered this old thread about the issue. Since printing orphaned basic blocks is still broken in 2021, I thought I would resurrect this topic (as being able to print them would be useful to me).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69751



More information about the llvm-commits mailing list