[PATCH] D69751: [AsmWritter] Fixed "null check after dereferencing" warning
Dávid Bolvanský via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 7 10:38:11 PST 2019
This revision was not accepted when it landed; it landed in state "Needs Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rG6e655e58bc74: [AsmWritter] Fixed "null check after dereferencing" warning (authored by xbolva00).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D69751/new/
https://reviews.llvm.org/D69751
Files:
llvm/lib/IR/AsmWriter.cpp
Index: llvm/lib/IR/AsmWriter.cpp
===================================================================
--- llvm/lib/IR/AsmWriter.cpp
+++ llvm/lib/IR/AsmWriter.cpp
@@ -3564,6 +3564,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 == &BB->getParent()->getEntryBlock();
if (BB->hasName()) { // Print out the label if it exists...
Out << "\n";
@@ -3578,10 +3579,7 @@
Out << "<badref>:";
}
- if (!BB->getParent()) {
- Out.PadToColumn(50);
- Out << "; Error: Block without parent!";
- } else if (!IsEntryBlock) {
+ if (!IsEntryBlock) {
// Output predecessors for the block.
Out.PadToColumn(50);
Out << ";";
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D69751.228277.patch
Type: text/x-patch
Size: 842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191107/346b9595/attachment.bin>
More information about the llvm-commits
mailing list