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_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
15 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
17 #include "EHStreamer.h"
18 #include "llvm/CodeGen/AsmPrinter.h"
21 class MachineFunction;
22 class ARMTargetStreamer;
24 class DwarfCFIExceptionBase : public EHStreamer {
26 DwarfCFIExceptionBase(AsmPrinter *A);
28 /// Per-function flag to indicate if frame CFI info should be emitted.
31 void markFunctionEnd() override;
34 class DwarfCFIException : public DwarfCFIExceptionBase {
35 /// Per-function flag to indicate if .cfi_personality should be emitted.
36 bool shouldEmitPersonality;
38 /// Per-function flag to indicate if .cfi_lsda should be emitted.
41 /// Per-function flag to indicate if frame moves info should be emitted.
44 AsmPrinter::CFIMoveType moveTypeModule;
47 //===--------------------------------------------------------------------===//
50 DwarfCFIException(AsmPrinter *A);
51 ~DwarfCFIException() override;
53 /// Emit all exception information that should come after the content.
54 void endModule() override;
56 /// Gather pre-function exception information. Assumes being emitted
57 /// immediately after the function entry point.
58 void beginFunction(const MachineFunction *MF) override;
60 /// Gather and emit post-function exception information.
61 void endFunction(const MachineFunction *) override;
64 class ARMException : public DwarfCFIExceptionBase {
65 void emitTypeInfos(unsigned TTypeEncoding) override;
66 ARMTargetStreamer &getTargetStreamer();
69 //===--------------------------------------------------------------------===//
72 ARMException(AsmPrinter *A);
73 ~ARMException() override;
75 /// Emit all exception information that should come after the content.
76 void endModule() override;
78 /// Gather pre-function exception information. Assumes being emitted
79 /// immediately after the function entry point.
80 void beginFunction(const MachineFunction *MF) override;
82 /// Gather and emit post-function exception information.
83 void endFunction(const MachineFunction *) override;
85 } // End of namespace llvm