1 //===- MCWin64EH.h - Machine Code Win64 EH support --------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // This file contains declarations to support the Win64 Exception Handling
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_MC_MCWIN64EH_H
15 #define LLVM_MC_MCWIN64EH_H
17 #include "llvm/MC/MCWinEH.h"
18 #include "llvm/Support/Win64EH.h"
26 static WinEH::Instruction
PushNonVol(MCSymbol
*L
, unsigned Reg
) {
27 return WinEH::Instruction(Win64EH::UOP_PushNonVol
, L
, Reg
, -1);
29 static WinEH::Instruction
Alloc(MCSymbol
*L
, unsigned Size
) {
30 return WinEH::Instruction(Size
> 128 ? UOP_AllocLarge
: UOP_AllocSmall
, L
,
33 static WinEH::Instruction
PushMachFrame(MCSymbol
*L
, bool Code
) {
34 return WinEH::Instruction(UOP_PushMachFrame
, L
, -1, Code
? 1 : 0);
36 static WinEH::Instruction
SaveNonVol(MCSymbol
*L
, unsigned Reg
,
38 return WinEH::Instruction(Offset
> 512 * 1024 - 8 ? UOP_SaveNonVolBig
42 static WinEH::Instruction
SaveXMM(MCSymbol
*L
, unsigned Reg
,
44 return WinEH::Instruction(Offset
> 512 * 1024 - 8 ? UOP_SaveXMM128Big
48 static WinEH::Instruction
SetFPReg(MCSymbol
*L
, unsigned Reg
, unsigned Off
) {
49 return WinEH::Instruction(UOP_SetFPReg
, L
, Reg
, Off
);
53 class UnwindEmitter
: public WinEH::UnwindEmitter
{
55 void Emit(MCStreamer
&Streamer
) const override
;
56 void EmitUnwindInfo(MCStreamer
&Streamer
, WinEH::FrameInfo
*FI
) const override
;
59 class ARM64UnwindEmitter
: public WinEH::UnwindEmitter
{
61 void Emit(MCStreamer
&Streamer
) const override
;
62 void EmitUnwindInfo(MCStreamer
&Streamer
,
63 WinEH::FrameInfo
*FI
) const override
;
67 } // end namespace llvm