summaryrefslogtreecommitdiff
path: root/include/llvm/MC/MCWinEH.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/MC/MCWinEH.h')
-rw-r--r--include/llvm/MC/MCWinEH.h51
1 files changed, 17 insertions, 34 deletions
diff --git a/include/llvm/MC/MCWinEH.h b/include/llvm/MC/MCWinEH.h
index 723d7a397c496..4ca52a6654eb7 100644
--- a/include/llvm/MC/MCWinEH.h
+++ b/include/llvm/MC/MCWinEH.h
@@ -13,11 +13,9 @@
#include <vector>
namespace llvm {
-class MCContext;
class MCSection;
class MCStreamer;
class MCSymbol;
-class StringRef;
namespace WinEH {
struct Instruction {
@@ -31,50 +29,35 @@ struct Instruction {
};
struct FrameInfo {
- const MCSymbol *Begin;
- const MCSymbol *End;
- const MCSymbol *ExceptionHandler;
- const MCSymbol *Function;
- const MCSymbol *PrologEnd;
- const MCSymbol *Symbol;
+ const MCSymbol *Begin = nullptr;
+ const MCSymbol *End = nullptr;
+ const MCSymbol *ExceptionHandler = nullptr;
+ const MCSymbol *Function = nullptr;
+ const MCSymbol *PrologEnd = nullptr;
+ const MCSymbol *Symbol = nullptr;
+ const MCSection *TextSection = nullptr;
- bool HandlesUnwind;
- bool HandlesExceptions;
+ bool HandlesUnwind = false;
+ bool HandlesExceptions = false;
- int LastFrameInst;
- const FrameInfo *ChainedParent;
+ int LastFrameInst = -1;
+ const FrameInfo *ChainedParent = nullptr;
std::vector<Instruction> Instructions;
- FrameInfo()
- : Begin(nullptr), End(nullptr), ExceptionHandler(nullptr),
- Function(nullptr), PrologEnd(nullptr), Symbol(nullptr),
- HandlesUnwind(false), HandlesExceptions(false), LastFrameInst(-1),
- ChainedParent(nullptr), Instructions() {}
+ FrameInfo() = default;
FrameInfo(const MCSymbol *Function, const MCSymbol *BeginFuncEHLabel)
- : Begin(BeginFuncEHLabel), End(nullptr), ExceptionHandler(nullptr),
- Function(Function), PrologEnd(nullptr), Symbol(nullptr),
- HandlesUnwind(false), HandlesExceptions(false), LastFrameInst(-1),
- ChainedParent(nullptr), Instructions() {}
+ : Begin(BeginFuncEHLabel), Function(Function) {}
FrameInfo(const MCSymbol *Function, const MCSymbol *BeginFuncEHLabel,
const FrameInfo *ChainedParent)
- : Begin(BeginFuncEHLabel), End(nullptr), ExceptionHandler(nullptr),
- Function(Function), PrologEnd(nullptr), Symbol(nullptr),
- HandlesUnwind(false), HandlesExceptions(false), LastFrameInst(-1),
- ChainedParent(ChainedParent), Instructions() {}
+ : Begin(BeginFuncEHLabel), Function(Function),
+ ChainedParent(ChainedParent) {}
};
class UnwindEmitter {
public:
- static MCSection *getPDataSection(const MCSymbol *Function,
- MCContext &Context);
- static MCSection *getXDataSection(const MCSymbol *Function,
- MCContext &Context);
+ virtual ~UnwindEmitter();
- virtual ~UnwindEmitter() { }
-
- //
- // This emits the unwind info sections (.pdata and .xdata in PE/COFF).
- //
+ /// This emits the unwind info sections (.pdata and .xdata in PE/COFF).
virtual void Emit(MCStreamer &Streamer) const = 0;
virtual void EmitUnwindInfo(MCStreamer &Streamer, FrameInfo *FI) const = 0;
};