HomePhabricator

Explicitly check for entry basic block, rather than relying on…

Authored by rahmanl on Oct 26 2020, 4:15 PM.

Description

Explicitly check for entry basic block, rather than relying on MachineBasicBlock::pred_empty.

Sometimes in unoptimized code, we have dangling unreachable basic blocks with no predecessors. Basic block sections should be emitted for those as well. Without this patch, the included test fails with a fatal error in AsmPrinter::emitBasicBlockEnd.

Reviewed By: tmsriram

Differential Revision: https://reviews.llvm.org/D89423

Details