[PATCH] D106127: [NFC][AssemblyWriter]Allow AssemblyWriter::printBasicBlock() to print blocks that don't have parents.

James Y Knight via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 13:20:32 PDT 2021


jyknight added inline comments.


================
Comment at: llvm/lib/IR/AsmWriter.cpp:3849
 void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
-  assert(BB && BB->getParent() && "block without parent!");
   bool IsEntryBlock = BB->isEntryBlock();
   if (BB->hasName()) {              // Print out the label if it exists...
----------------
I'd suggest to make this be:
`bool IsEntryBlock = BB->getParent() && BB->isEntryBlock();`
instead of modifying isEntryBlock.


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

https://reviews.llvm.org/D106127



More information about the llvm-commits mailing list