xref: /minix3/external/bsd/llvm/dist/llvm/lib/CodeGen/AsmPrinter/DwarfException.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc //===-- DwarfException.h - Dwarf Exception Framework -----------*- C++ -*--===//
2f4a2713aSLionel Sambuc //
3f4a2713aSLionel Sambuc //                     The LLVM Compiler Infrastructure
4f4a2713aSLionel Sambuc //
5f4a2713aSLionel Sambuc // This file is distributed under the University of Illinois Open Source
6f4a2713aSLionel Sambuc // License. See LICENSE.TXT for details.
7f4a2713aSLionel Sambuc //
8f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
9f4a2713aSLionel Sambuc //
10f4a2713aSLionel Sambuc // This file contains support for writing dwarf exception info into asm files.
11f4a2713aSLionel Sambuc //
12f4a2713aSLionel Sambuc //===----------------------------------------------------------------------===//
13f4a2713aSLionel Sambuc 
14*0a6a1f1dSLionel Sambuc #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
15*0a6a1f1dSLionel Sambuc #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
16f4a2713aSLionel Sambuc 
17*0a6a1f1dSLionel Sambuc #include "EHStreamer.h"
18f4a2713aSLionel Sambuc #include "llvm/CodeGen/AsmPrinter.h"
19f4a2713aSLionel Sambuc 
20f4a2713aSLionel Sambuc namespace llvm {
21f4a2713aSLionel Sambuc class MachineFunction;
22f4a2713aSLionel Sambuc class ARMTargetStreamer;
23f4a2713aSLionel Sambuc 
24*0a6a1f1dSLionel Sambuc class DwarfCFIException : public EHStreamer {
25f4a2713aSLionel Sambuc   /// shouldEmitPersonality - Per-function flag to indicate if .cfi_personality
26f4a2713aSLionel Sambuc   /// should be emitted.
27f4a2713aSLionel Sambuc   bool shouldEmitPersonality;
28f4a2713aSLionel Sambuc 
29f4a2713aSLionel Sambuc   /// shouldEmitLSDA - Per-function flag to indicate if .cfi_lsda
30f4a2713aSLionel Sambuc   /// should be emitted.
31f4a2713aSLionel Sambuc   bool shouldEmitLSDA;
32f4a2713aSLionel Sambuc 
33f4a2713aSLionel Sambuc   /// shouldEmitMoves - Per-function flag to indicate if frame moves info
34f4a2713aSLionel Sambuc   /// should be emitted.
35f4a2713aSLionel Sambuc   bool shouldEmitMoves;
36f4a2713aSLionel Sambuc 
37f4a2713aSLionel Sambuc   AsmPrinter::CFIMoveType moveTypeModule;
38f4a2713aSLionel Sambuc 
39f4a2713aSLionel Sambuc public:
40f4a2713aSLionel Sambuc   //===--------------------------------------------------------------------===//
41f4a2713aSLionel Sambuc   // Main entry points.
42f4a2713aSLionel Sambuc   //
43f4a2713aSLionel Sambuc   DwarfCFIException(AsmPrinter *A);
44f4a2713aSLionel Sambuc   virtual ~DwarfCFIException();
45f4a2713aSLionel Sambuc 
46*0a6a1f1dSLionel Sambuc   /// endModule - Emit all exception information that should come after the
47f4a2713aSLionel Sambuc   /// content.
48*0a6a1f1dSLionel Sambuc   void endModule() override;
49f4a2713aSLionel Sambuc 
50*0a6a1f1dSLionel Sambuc   /// beginFunction - Gather pre-function exception information.  Assumes being
51f4a2713aSLionel Sambuc   /// emitted immediately after the function entry point.
52*0a6a1f1dSLionel Sambuc   void beginFunction(const MachineFunction *MF) override;
53f4a2713aSLionel Sambuc 
54*0a6a1f1dSLionel Sambuc   /// endFunction - Gather and emit post-function exception information.
55*0a6a1f1dSLionel Sambuc   void endFunction(const MachineFunction *) override;
56f4a2713aSLionel Sambuc };
57f4a2713aSLionel Sambuc 
58*0a6a1f1dSLionel Sambuc class ARMException : public EHStreamer {
59*0a6a1f1dSLionel Sambuc   void emitTypeInfos(unsigned TTypeEncoding) override;
60f4a2713aSLionel Sambuc   ARMTargetStreamer &getTargetStreamer();
61f4a2713aSLionel Sambuc 
62*0a6a1f1dSLionel Sambuc   /// shouldEmitCFI - Per-function flag to indicate if frame CFI info
63*0a6a1f1dSLionel Sambuc   /// should be emitted.
64*0a6a1f1dSLionel Sambuc   bool shouldEmitCFI;
65*0a6a1f1dSLionel Sambuc 
66f4a2713aSLionel Sambuc public:
67f4a2713aSLionel Sambuc   //===--------------------------------------------------------------------===//
68f4a2713aSLionel Sambuc   // Main entry points.
69f4a2713aSLionel Sambuc   //
70f4a2713aSLionel Sambuc   ARMException(AsmPrinter *A);
71f4a2713aSLionel Sambuc   virtual ~ARMException();
72f4a2713aSLionel Sambuc 
73*0a6a1f1dSLionel Sambuc   /// endModule - Emit all exception information that should come after the
74f4a2713aSLionel Sambuc   /// content.
75*0a6a1f1dSLionel Sambuc   void endModule() override;
76f4a2713aSLionel Sambuc 
77*0a6a1f1dSLionel Sambuc   /// beginFunction - Gather pre-function exception information.  Assumes being
78f4a2713aSLionel Sambuc   /// emitted immediately after the function entry point.
79*0a6a1f1dSLionel Sambuc   void beginFunction(const MachineFunction *MF) override;
80f4a2713aSLionel Sambuc 
81*0a6a1f1dSLionel Sambuc   /// endFunction - Gather and emit post-function exception information.
82*0a6a1f1dSLionel Sambuc   void endFunction(const MachineFunction *) override;
83f4a2713aSLionel Sambuc };
84f4a2713aSLionel Sambuc } // End of namespace llvm
85f4a2713aSLionel Sambuc 
86f4a2713aSLionel Sambuc #endif
87