We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88f6bf8 commit 34451afCopy full SHA for 34451af
llvm/lib/Transforms/Utils/BasicBlockUtils.cpp
@@ -1778,7 +1778,10 @@ bool llvm::hasOnlySimpleTerminator(const Function &F) {
1778
1779
Printable llvm::printBasicBlock(const BasicBlock *BB) {
1780
return Printable([BB](raw_ostream &OS) {
1781
- if (BB)
1782
- return BB->printAsOperand(OS);
+ if (!BB) {
+ OS << "<nullptr>";
1783
+ return;
1784
+ }
1785
+ BB->printAsOperand(OS);
1786
});
1787
}
llvm/unittests/Transforms/Utils/BasicBlockUtilsTest.cpp
@@ -743,5 +743,5 @@ define void @foo() {
743
SCheck.clear();
744
745
OS << printBasicBlock(nullptr);
746
- EXPECT_EQ(OS.str(), "");
+ EXPECT_EQ(OS.str(), "<nullptr>");
747
0 commit comments