diff options
| author | Reid Kleckner <rnk@google.com> | 2017-05-31 22:21:20 +0000 |
|---|---|---|
| committer | Reid Kleckner <rnk@google.com> | 2017-05-31 22:21:20 +0000 |
| commit | 57ac61e005886d7010db668ef8b430e003a8d413 (patch) | |
| tree | 181b72c06d8e6eead800c8ab81281dde51105518 /llvm/lib | |
| parent | 1c3b0afbbe33e81bad6d1908aa052a096c9699b2 (diff) | |
| download | bcm5719-llvm-57ac61e005886d7010db668ef8b430e003a8d413.tar.gz bcm5719-llvm-57ac61e005886d7010db668ef8b430e003a8d413.zip | |
Check hasPersonalityFn before calling getPersonalityFn
llvm-svn: 304365
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 4391e80c6cc..e61e22abe82 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -954,11 +954,12 @@ static bool needFuncLabelsForEHOrDebugInfo(const MachineFunction &MF, if (!MF.getLandingPads().empty() || MF.hasEHFunclets() || MMI->hasDebugInfo()) return true; - // We might emit an LSDA anyway if we have an EH personality. - const Constant *PerFn = MF.getFunction()->getPersonalityFn(); - if (!PerFn) + // We might emit an EH table that uses function begin and end labels even if + // we don't have any landingpads. + if (!MF.getFunction()->hasPersonalityFn()) return false; - return !isNoOpWithoutInvoke(classifyEHPersonality(PerFn)); + return !isNoOpWithoutInvoke( + classifyEHPersonality(MF.getFunction()->getPersonalityFn())); } /// EmitFunctionBody - This method emits the body and trailer for a |

