mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
WinEH: Create an unwind help alloca for __CxxFrameHandler3 xdata tables
We don't have any logic to emit those tables yet, so the sdag lowering of this intrinsic is just a stub. We can see the intrinsic in the prepared IR, though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233209 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -601,6 +601,19 @@ bool WinEHPrepare::prepareExceptionHandlers(
|
||||
Builder.SetInsertPoint(&F.getEntryBlock().back());
|
||||
Builder.CreateCall(FrameEscapeFn, AllocasToEscape);
|
||||
|
||||
// Insert an alloca for the EH state in the entry block. On x86, we will also
|
||||
// insert stores to update the EH state, but on other ISAs, the runtime does
|
||||
// it for us.
|
||||
// FIXME: This record is different on x86.
|
||||
Type *UnwindHelpTy = Type::getInt64Ty(Context);
|
||||
AllocaInst *UnwindHelp =
|
||||
new AllocaInst(UnwindHelpTy, "unwindhelp", &F.getEntryBlock().front());
|
||||
Builder.CreateStore(llvm::ConstantInt::get(UnwindHelpTy, -2), UnwindHelp);
|
||||
Function *UnwindHelpFn =
|
||||
Intrinsic::getDeclaration(M, Intrinsic::eh_unwindhelp);
|
||||
Builder.CreateCall(UnwindHelpFn,
|
||||
Builder.CreateBitCast(UnwindHelp, Int8PtrType));
|
||||
|
||||
// Clean up the handler action maps we created for this function
|
||||
DeleteContainerSeconds(CatchHandlerMap);
|
||||
CatchHandlerMap.clear();
|
||||
|
Reference in New Issue
Block a user