diff options
author | diggerlin <digger.llvm@gmail.com> | 2020-12-16 09:34:59 -0500 |
---|---|---|
committer | diggerlin <digger.llvm@gmail.com> | 2020-12-16 09:34:59 -0500 |
commit | a1e1dcabe4fb1f24401f3153409583fe133ffd46 (patch) | |
tree | 7e58e6181698ba000a3c98dfa94627dd194b8a01 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | be9184bc557ae4000cd785fe369347817e5cbad4 (diff) | |
download | llvm-a1e1dcabe4fb1f24401f3153409583fe133ffd46.zip llvm-a1e1dcabe4fb1f24401f3153409583fe133ffd46.tar.gz llvm-a1e1dcabe4fb1f24401f3153409583fe133ffd46.tar.bz2 |
[XCOFF][AIX] Emit EH information in traceback table
SUMMARY:
In order for the runtime on AIX to find the compact unwind section(EHInfo table),
we would need to set the following on the traceback table:
The 6th byte's longtbtable field to true to signal there is an Extended TB Table Flag.
The Extended TB Table Flag to be 0x08 to signal there is an exception handling info presents.
Emit the offset between ehinfo TC entry and TOC base after all other optional portions of traceback table.
The patch is authored by Jason Liu.
Reviewers: David Tenty, Digger Lin
Differential Revision: https://reviews.llvm.org/D92766
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index b4d88fcb..6567aaa 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -2054,6 +2054,29 @@ MCSection *TargetLoweringObjectFileWasm::getStaticDtorSection( //===----------------------------------------------------------------------===// // XCOFF //===----------------------------------------------------------------------===// +bool TargetLoweringObjectFileXCOFF::ShouldEmitEHBlock( + const MachineFunction *MF) { + if (!MF->getLandingPads().empty()) + return true; + + const Function &F = MF->getFunction(); + if (!F.hasPersonalityFn() || !F.needsUnwindTableEntry()) + return false; + + const Function *Per = + dyn_cast<Function>(F.getPersonalityFn()->stripPointerCasts()); + if (isNoOpWithoutInvoke(classifyEHPersonality(Per))) + return false; + + return true; +} + +MCSymbol * +TargetLoweringObjectFileXCOFF::getEHInfoTableSymbol(const MachineFunction *MF) { + return MF->getMMI().getContext().getOrCreateSymbol( + "__ehinfo." + Twine(MF->getFunctionNumber())); +} + MCSymbol * TargetLoweringObjectFileXCOFF::getTargetSymbol(const GlobalValue *GV, const TargetMachine &TM) const { |