mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
When generating code for Win64 EH, emit StartProc and EndProc directives.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132250 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -54,9 +54,35 @@ void Win64Exception::EndModule() {
|
||||
/// BeginFunction - Gather pre-function exception information. Assumes it's
|
||||
/// being emitted immediately after the function entry point.
|
||||
void Win64Exception::BeginFunction(const MachineFunction *MF) {
|
||||
shouldEmitMoves = shouldEmitPersonality = shouldEmitLSDA = false;
|
||||
|
||||
// If any landing pads survive, we need an EH table.
|
||||
bool hasLandingPads = !MMI->getLandingPads().empty();
|
||||
|
||||
shouldEmitMoves = Asm->needsSEHMoves();
|
||||
|
||||
const TargetLoweringObjectFile &TLOF = Asm->getObjFileLowering();
|
||||
unsigned PerEncoding = TLOF.getPersonalityEncoding();
|
||||
const Function *Per = MMI->getPersonalities()[MMI->getPersonalityIndex()];
|
||||
|
||||
shouldEmitPersonality = hasLandingPads &&
|
||||
PerEncoding != dwarf::DW_EH_PE_omit && Per;
|
||||
|
||||
unsigned LSDAEncoding = TLOF.getLSDAEncoding();
|
||||
shouldEmitLSDA = shouldEmitPersonality &&
|
||||
LSDAEncoding != dwarf::DW_EH_PE_omit;
|
||||
|
||||
if (!shouldEmitPersonality && !shouldEmitMoves)
|
||||
return;
|
||||
|
||||
Asm->OutStreamer.EmitWin64EHStartProc(Asm->CurrentFnSym);
|
||||
}
|
||||
|
||||
/// EndFunction - Gather and emit post-function exception information.
|
||||
///
|
||||
void Win64Exception::EndFunction() {
|
||||
if (!shouldEmitPersonality && !shouldEmitMoves)
|
||||
return;
|
||||
|
||||
Asm->OutStreamer.EmitWin64EHEndProc();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user