From 7049fbf960df7ebf77f322a058a3eff9cb4a33cd Mon Sep 17 00:00:00 2001 From: jasonliu Date: Thu, 29 Apr 2021 20:39:43 +0000 Subject: [XCOFF] Handle the case when personality routine is an alias Summary: Personality routine could be an alias to another personality routine. Fix the situation when we compile the file that contains the personality routine and the file also have functions that need to refer to the personality routine. Reviewed By: hubert.reinterpretcast Differential Revision: https://reviews.llvm.org/D101401 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 737a997e7176..c298172fe600 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2144,8 +2144,9 @@ bool TargetLoweringObjectFileXCOFF::ShouldEmitEHBlock( if (!F.hasPersonalityFn() || !F.needsUnwindTableEntry()) return false; - const Function *Per = - dyn_cast(F.getPersonalityFn()->stripPointerCasts()); + const GlobalValue *Per = + dyn_cast(F.getPersonalityFn()->stripPointerCasts()); + assert(Per && "Personality routine is not a GlobalValue type."); if (isNoOpWithoutInvoke(classifyEHPersonality(Per))) return false; -- cgit v1.2.3