[EHStreamer] Omit @LPStart when function has no landing pads
authorRahman Lavaee <rahmanl@google.com>
Wed, 10 Aug 2022 21:43:06 +0000 (14:43 -0700)
committerRahman Lavaee <rahmanl@google.com>
Tue, 16 Aug 2022 00:09:46 +0000 (17:09 -0700)
commitdf2213f345475786731a2c3b2a121329f14e8950
tree4da1b336eb8f5f0bfaa136d9c6f41475dad9c482
parent65c022a75fa7ca87dbf8375527c76eaf7d5f16c5
[EHStreamer] Omit @LPStart when function has no landing pads

When no landing pads exist for a function, `@LPStart` is undefined and must be omitted.

EH table is generally not emitted for functions without landing pads, except when the personality function is uknown (`!isNoOpWithoutInvoke(classifyEHPersonality(Per))`). In that case, we must omit `@LPStart` even when machine function splitting is enabled.

Reviewed By: MaskRay

Differential Revision: https://reviews.llvm.org/D131626
llvm/lib/CodeGen/AsmPrinter/EHStreamer.cpp
llvm/test/CodeGen/X86/gcc_except_table_bb_sections_nolpads.ll [new file with mode: 0644]