aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorjasonliu <jasonliu.development@gmail.com>2021-04-29 20:39:43 +0000
committerjasonliu <jasonliu.development@gmail.com>2021-04-29 22:03:30 +0000
commit7049fbf960df7ebf77f322a058a3eff9cb4a33cd (patch)
treee2d49f24c750150f8d92f03c7b6e9823cf253951 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent6b938d2ead2cb0465436496c0171c7d750e11773 (diff)
downloadllvm-7049fbf960df7ebf77f322a058a3eff9cb4a33cd.zip
llvm-7049fbf960df7ebf77f322a058a3eff9cb4a33cd.tar.gz
llvm-7049fbf960df7ebf77f322a058a3eff9cb4a33cd.tar.bz2
[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
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 737a997..c298172 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<Function>(F.getPersonalityFn()->stripPointerCasts());
+ const GlobalValue *Per =
+ dyn_cast<GlobalValue>(F.getPersonalityFn()->stripPointerCasts());
+ assert(Per && "Personality routine is not a GlobalValue type.");
if (isNoOpWithoutInvoke(classifyEHPersonality(Per)))
return false;