1 //===- MCWin64EH.h - Machine Code Win64 EH support --------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains declarations to support the Win64 Exception Handling
13 //===----------------------------------------------------------------------===//
15 #ifndef LLVM_MC_MCWIN64EH_H
16 #define LLVM_MC_MCWIN64EH_H
18 #include "llvm/MC/MCWinEH.h"
19 #include "llvm/Support/Win64EH.h"
28 static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg) {
29 return WinEH::Instruction(Win64EH::UOP_PushNonVol, L, Reg, -1);
31 static WinEH::Instruction Alloc(MCSymbol *L, unsigned Size) {
32 return WinEH::Instruction(Size > 128 ? UOP_AllocLarge : UOP_AllocSmall, L,
35 static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code) {
36 return WinEH::Instruction(UOP_PushMachFrame, L, -1, Code ? 1 : 0);
38 static WinEH::Instruction SaveNonVol(MCSymbol *L, unsigned Reg,
40 return WinEH::Instruction(Offset > 512 * 1024 - 8 ? UOP_SaveNonVolBig
44 static WinEH::Instruction SaveXMM(MCSymbol *L, unsigned Reg,
46 return WinEH::Instruction(Offset > 512 * 1024 - 8 ? UOP_SaveXMM128Big
50 static WinEH::Instruction SetFPReg(MCSymbol *L, unsigned Reg, unsigned Off) {
51 return WinEH::Instruction(UOP_SetFPReg, L, Reg, Off);
55 class UnwindEmitter : public WinEH::UnwindEmitter {
57 void Emit(MCStreamer &Streamer) const override;
58 void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI) const override;
61 } // end namespace llvm