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

Xiaoqing Wu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 20 14:01:10 PDT 2021


xiaoqing_wu updated this revision to Diff 360266.
xiaoqing_wu added a comment.

Updated the patch based on review feedback.


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

https://reviews.llvm.org/D106127

Files:
  llvm/lib/IR/AsmWriter.cpp


Index: llvm/lib/IR/AsmWriter.cpp
===================================================================
--- llvm/lib/IR/AsmWriter.cpp
+++ llvm/lib/IR/AsmWriter.cpp
@@ -3846,8 +3846,7 @@
 
 /// printBasicBlock - This member is called for each basic block in a method.
 void AssemblyWriter::printBasicBlock(const BasicBlock *BB) {
-  assert(BB && BB->getParent() && "block without parent!");
-  bool IsEntryBlock = BB->isEntryBlock();
+  bool IsEntryBlock = BB->getParent() && BB->isEntryBlock();
   if (BB->hasName()) {              // Print out the label if it exists...
     Out << "\n";
     PrintLLVMName(Out, BB->getName(), LabelPrefix);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106127.360266.patch
Type: text/x-patch
Size: 639 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210720/6e05399c/attachment-0001.bin>


More information about the llvm-commits mailing list