diff options
author | jasonliu <jasonliu.development@gmail.com> | 2021-04-29 20:39:43 +0000 |
---|---|---|
committer | jasonliu <jasonliu.development@gmail.com> | 2021-04-29 22:03:30 +0000 |
commit | 7049fbf960df7ebf77f322a058a3eff9cb4a33cd (patch) | |
tree | e2d49f24c750150f8d92f03c7b6e9823cf253951 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | 6b938d2ead2cb0465436496c0171c7d750e11773 (diff) | |
download | llvm-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.cpp | 5 |
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; |