LLVM  14.0.0git
MCWin64EH.h
Go to the documentation of this file.
1 //===- MCWin64EH.h - Machine Code Win64 EH support --------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains declarations to support the Win64 Exception Handling
10 // scheme in MC.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_MC_MCWIN64EH_H
15 #define LLVM_MC_MCWIN64EH_H
16 
17 #include "llvm/MC/MCWinEH.h"
18 #include "llvm/Support/Win64EH.h"
19 
20 namespace llvm {
21 class MCStreamer;
22 class MCSymbol;
23 
24 namespace Win64EH {
25 struct Instruction {
26  static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg) {
28  }
29  static WinEH::Instruction Alloc(MCSymbol *L, unsigned Size) {
31  -1, Size);
32  }
33  static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code) {
34  return WinEH::Instruction(UOP_PushMachFrame, L, -1, Code ? 1 : 0);
35  }
37  unsigned Offset) {
38  return WinEH::Instruction(Offset > 512 * 1024 - 8 ? UOP_SaveNonVolBig
40  L, Reg, Offset);
41  }
42  static WinEH::Instruction SaveXMM(MCSymbol *L, unsigned Reg,
43  unsigned Offset) {
44  return WinEH::Instruction(Offset > 512 * 1024 - 8 ? UOP_SaveXMM128Big
46  L, Reg, Offset);
47  }
48  static WinEH::Instruction SetFPReg(MCSymbol *L, unsigned Reg, unsigned Off) {
49  return WinEH::Instruction(UOP_SetFPReg, L, Reg, Off);
50  }
51 };
52 
54 public:
55  void Emit(MCStreamer &Streamer) const override;
56  void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI,
57  bool HandlerData) const override;
58 };
59 
61 public:
62  void Emit(MCStreamer &Streamer) const override;
63  void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI,
64  bool HandlerData) const override;
65 };
66 
67 }
68 } // end namespace llvm
69 
70 #endif
llvm::Check::Size
@ Size
Definition: FileCheck.h:73
llvm::Win64EH::UOP_SaveXMM128
@ UOP_SaveXMM128
Definition: Win64EH.h:35
llvm::Win64EH::Instruction::PushMachFrame
static WinEH::Instruction PushMachFrame(MCSymbol *L, bool Code)
Definition: MCWin64EH.h:33
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
Reg
unsigned Reg
Definition: MachineSink.cpp:1566
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::Win64EH::UOP_PushNonVol
@ UOP_PushNonVol
Definition: Win64EH.h:27
Offset
uint64_t Offset
Definition: ELFObjHandler.cpp:81
llvm::MCStreamer
Streaming machine code generation interface.
Definition: MCStreamer.h:199
llvm::Win64EH::Instruction::Alloc
static WinEH::Instruction Alloc(MCSymbol *L, unsigned Size)
Definition: MCWin64EH.h:29
llvm::Win64EH::ARM64UnwindEmitter::EmitUnwindInfo
void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI, bool HandlerData) const override
Definition: MCWin64EH.cpp:1111
llvm::Win64EH::UOP_SetFPReg
@ UOP_SetFPReg
Definition: Win64EH.h:30
llvm::Win64EH::Instruction
Definition: MCWin64EH.h:25
llvm::Win64EH::Instruction::SaveNonVol
static WinEH::Instruction SaveNonVol(MCSymbol *L, unsigned Reg, unsigned Offset)
Definition: MCWin64EH.h:36
llvm::Win64EH::Instruction::SetFPReg
static WinEH::Instruction SetFPReg(MCSymbol *L, unsigned Reg, unsigned Off)
Definition: MCWin64EH.h:48
llvm::Win64EH::UOP_SaveXMM128Big
@ UOP_SaveXMM128Big
Definition: Win64EH.h:36
llvm::Win64EH::UOP_AllocSmall
@ UOP_AllocSmall
Definition: Win64EH.h:29
llvm::Win64EH::Instruction::SaveXMM
static WinEH::Instruction SaveXMM(MCSymbol *L, unsigned Reg, unsigned Offset)
Definition: MCWin64EH.h:42
Win64EH.h
llvm::WinEH::UnwindEmitter
Definition: MCWinEH.h:77
llvm::Win64EH::UOP_SaveNonVol
@ UOP_SaveNonVol
Definition: Win64EH.h:31
llvm::Win64EH::UnwindEmitter
Definition: MCWin64EH.h:53
llvm::Win64EH::Instruction::PushNonVol
static WinEH::Instruction PushNonVol(MCSymbol *L, unsigned Reg)
Definition: MCWin64EH.h:26
llvm::Win64EH::UnwindEmitter::EmitUnwindInfo
void EmitUnwindInfo(MCStreamer &Streamer, WinEH::FrameInfo *FI, bool HandlerData) const override
Definition: MCWin64EH.cpp:241
llvm::Win64EH::ARM64UnwindEmitter::Emit
void Emit(MCStreamer &Streamer) const override
This emits the unwind info sections (.pdata and .xdata in PE/COFF).
Definition: MCWin64EH.cpp:1086
llvm::Win64EH::ARM64UnwindEmitter
Definition: MCWin64EH.h:60
MCWinEH.h
llvm::Win64EH::UOP_SaveNonVolBig
@ UOP_SaveNonVolBig
Definition: Win64EH.h:32
llvm::WinEH::FrameInfo
Definition: MCWinEH.h:39
llvm::WinEH::Instruction
Definition: MCWinEH.h:21
llvm::Win64EH::UnwindEmitter::Emit
void Emit(MCStreamer &Streamer) const override
This emits the unwind info sections (.pdata and .xdata in PE/COFF).
Definition: MCWin64EH.cpp:225
llvm::Win64EH::UOP_PushMachFrame
@ UOP_PushMachFrame
Definition: Win64EH.h:37
llvm::ISD::MCSymbol
@ MCSymbol
Definition: ISDOpcodes.h:172
llvm::Win64EH::UOP_AllocLarge
@ UOP_AllocLarge
Definition: Win64EH.h:28