1 //===-- DwarfException.h - Dwarf Exception Framework -----------*- 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 support for writing dwarf exception info into asm files.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
15 #define LLVM_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
17 #include "EHStreamer.h"
18 #include "llvm/CodeGen/AsmPrinter.h"
21 class MachineFunction;
22 class ARMTargetStreamer;
24 class DwarfCFIException : public EHStreamer {
25 /// shouldEmitPersonality - Per-function flag to indicate if .cfi_personality
26 /// should be emitted.
27 bool shouldEmitPersonality;
29 /// shouldEmitLSDA - Per-function flag to indicate if .cfi_lsda
30 /// should be emitted.
33 /// shouldEmitMoves - Per-function flag to indicate if frame moves info
34 /// should be emitted.
37 AsmPrinter::CFIMoveType moveTypeModule;
40 //===--------------------------------------------------------------------===//
43 DwarfCFIException(AsmPrinter *A);
44 virtual ~DwarfCFIException();
46 /// endModule - Emit all exception information that should come after the
48 void endModule() override;
50 /// beginFunction - Gather pre-function exception information. Assumes being
51 /// emitted immediately after the function entry point.
52 void beginFunction(const MachineFunction *MF) override;
54 /// endFunction - Gather and emit post-function exception information.
55 void endFunction(const MachineFunction *) override;
58 class ARMException : public EHStreamer {
59 void emitTypeInfos(unsigned TTypeEncoding) override;
60 ARMTargetStreamer &getTargetStreamer();
62 /// shouldEmitCFI - Per-function flag to indicate if frame CFI info
63 /// should be emitted.
67 //===--------------------------------------------------------------------===//
70 ARMException(AsmPrinter *A);
71 virtual ~ARMException();
73 /// endModule - Emit all exception information that should come after the
75 void endModule() override;
77 /// beginFunction - Gather pre-function exception information. Assumes being
78 /// emitted immediately after the function entry point.
79 void beginFunction(const MachineFunction *MF) override;
81 /// endFunction - Gather and emit post-function exception information.
82 void endFunction(const MachineFunction *) override;
85 class Win64Exception : public EHStreamer {
86 /// shouldEmitPersonality - Per-function flag to indicate if personality
87 /// info should be emitted.
88 bool shouldEmitPersonality;
90 /// shouldEmitLSDA - Per-function flag to indicate if the LSDA
91 /// should be emitted.
94 /// shouldEmitMoves - Per-function flag to indicate if frame moves info
95 /// should be emitted.
99 //===--------------------------------------------------------------------===//
100 // Main entry points.
102 Win64Exception(AsmPrinter *A);
103 virtual ~Win64Exception();
105 /// endModule - Emit all exception information that should come after the
107 void endModule() override;
109 /// beginFunction - Gather pre-function exception information. Assumes being
110 /// emitted immediately after the function entry point.
111 void beginFunction(const MachineFunction *MF) override;
113 /// endFunction - Gather and emit post-function exception information.
114 void endFunction(const MachineFunction *) override;
117 } // End of namespace llvm