MC: rename Win64EHFrameInfo to WinEH::FrameInfo
[oota-llvm.git] / include / llvm / MC / MCWinEH.h
1 //===- MCWinEH.h - Windows Unwinding Support --------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef LLVM_MC_MCWINEH_H
11 #define LLVM_MC_MCWINEH_H
12
13 #include <vector>
14
15 namespace llvm {
16 class MCSymbol;
17
18 namespace WinEH {
19 struct Instruction {
20   const MCSymbol *Label;
21   const unsigned Offset;
22   const unsigned Register;
23   const unsigned Operation;
24
25   Instruction(unsigned Op, MCSymbol *L, unsigned Reg, unsigned Off)
26     : Label(L), Offset(Off), Register(Reg), Operation(Op) {}
27 };
28
29 struct FrameInfo {
30   const MCSymbol *Begin;
31   const MCSymbol *End;
32   const MCSymbol *ExceptionHandler;
33   const MCSymbol *Function;
34   const MCSymbol *PrologEnd;
35   const MCSymbol *Symbol;
36
37   bool HandlesUnwind;
38   bool HandlesExceptions;
39
40   int LastFrameInst;
41   const FrameInfo *ChainedParent;
42   std::vector<Instruction> Instructions;
43
44   FrameInfo()
45     : Begin(nullptr), End(nullptr), ExceptionHandler(nullptr),
46       Function(nullptr), PrologEnd(nullptr), Symbol(nullptr),
47       HandlesUnwind(false), HandlesExceptions(false), LastFrameInst(-1),
48       ChainedParent(nullptr), Instructions() {}
49   FrameInfo(const MCSymbol *Function, const MCSymbol *BeginFuncEHLabel)
50     : Begin(BeginFuncEHLabel), End(nullptr), ExceptionHandler(nullptr),
51       Function(Function), PrologEnd(nullptr), Symbol(nullptr),
52       HandlesUnwind(false), HandlesExceptions(false), LastFrameInst(-1),
53       ChainedParent(nullptr), Instructions() {}
54   FrameInfo(const MCSymbol *Function, const MCSymbol *BeginFuncEHLabel,
55             const FrameInfo *ChainedParent)
56     : Begin(BeginFuncEHLabel), End(nullptr), ExceptionHandler(nullptr),
57       Function(Function), PrologEnd(nullptr), Symbol(nullptr),
58       HandlesUnwind(false), HandlesExceptions(false), LastFrameInst(-1),
59       ChainedParent(ChainedParent), Instructions() {}
60 };
61 }
62 }
63
64 #endif