Missing check for empty body function causes several analyses to fail, including DomTree, LoopInfo, BPI, and BFI.
When function has empty body -- zero instruction and no entry block, the call Function::getEntryBlock returns the sentinel node in BasicBlocks list.
The issue was encountered as an assertion failure when a dead function with empty body was passed into ORE for remarks emit, and triggered various analyses stated above. Although empty body function is considered invalid when passing in as an IR input, it could exist internally when function is stripped away as a dead function during LTO.