mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
[SEH] Reimplement x64 SEH using WinEHPrepare
This now emits simple, unoptimized xdata tables for __C_specific_handler based on the handlers listed in @llvm.eh.actions calls produced by WinEHPrepare. This adds support for running __finally blocks when exceptions are thrown, and removes the old landingpad fan-in codepath. I ran some manual execution tests on small basic test cases with and without optimization, as well as on Chrome base_unittests, which uses a small amount of SEH. I'm sure there are bugs, and we may need to revert. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235154 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -461,12 +461,23 @@ void MachineModuleInfo::addCleanup(MachineBasicBlock *LandingPad) {
|
||||
LP.TypeIds.push_back(0);
|
||||
}
|
||||
|
||||
MCSymbol *
|
||||
MachineModuleInfo::addClauseForLandingPad(MachineBasicBlock *LandingPad) {
|
||||
MCSymbol *ClauseLabel = Context.CreateTempSymbol();
|
||||
void MachineModuleInfo::addSEHCatchHandler(MachineBasicBlock *LandingPad,
|
||||
const Function *Filter,
|
||||
const BlockAddress *RecoverBA) {
|
||||
LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
|
||||
LP.ClauseLabels.push_back(ClauseLabel);
|
||||
return ClauseLabel;
|
||||
SEHHandler Handler;
|
||||
Handler.FilterOrFinally = Filter;
|
||||
Handler.RecoverBA = RecoverBA;
|
||||
LP.SEHHandlers.push_back(Handler);
|
||||
}
|
||||
|
||||
void MachineModuleInfo::addSEHCleanupHandler(MachineBasicBlock *LandingPad,
|
||||
const Function *Cleanup) {
|
||||
LandingPadInfo &LP = getOrCreateLandingPadInfo(LandingPad);
|
||||
SEHHandler Handler;
|
||||
Handler.FilterOrFinally = Cleanup;
|
||||
Handler.RecoverBA = nullptr;
|
||||
LP.SEHHandlers.push_back(Handler);
|
||||
}
|
||||
|
||||
/// TidyLandingPads - Remap landing pad labels and remove any deleted landing
|
||||
|
Reference in New Issue
Block a user