LLVM  10.0.0svn
DwarfException.h
Go to the documentation of this file.
1 //===-- DwarfException.h - Dwarf Exception Framework -----------*- C++ -*--===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file contains support for writing dwarf exception info into asm files.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
14 #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
15 
16 #include "EHStreamer.h"
18 #include "llvm/MC/MCDwarf.h"
19 
20 namespace llvm {
21 class MachineFunction;
22 class ARMTargetStreamer;
23 
25 protected:
27 
28  /// Per-function flag to indicate if frame CFI info should be emitted.
30  /// Per-module flag to indicate if .cfi_section has beeen emitted.
32 
33  void markFunctionEnd() override;
34  void endFragment() override;
35 };
36 
38  /// Per-function flag to indicate if .cfi_personality should be emitted.
39  bool shouldEmitPersonality;
40 
41  /// Per-function flag to indicate if .cfi_personality must be emitted.
42  bool forceEmitPersonality;
43 
44  /// Per-function flag to indicate if .cfi_lsda should be emitted.
45  bool shouldEmitLSDA;
46 
47  /// Per-function flag to indicate if frame moves info should be emitted.
48  bool shouldEmitMoves;
49 
50 public:
51  //===--------------------------------------------------------------------===//
52  // Main entry points.
53  //
55  ~DwarfCFIException() override;
56 
57  /// Emit all exception information that should come after the content.
58  void endModule() override;
59 
60  /// Gather pre-function exception information. Assumes being emitted
61  /// immediately after the function entry point.
62  void beginFunction(const MachineFunction *MF) override;
63 
64  /// Gather and emit post-function exception information.
65  void endFunction(const MachineFunction *) override;
66 
67  void beginFragment(const MachineBasicBlock *MBB,
68  ExceptionSymbolProvider ESP) override;
69 };
70 
72  void emitTypeInfos(unsigned TTypeEncoding, MCSymbol *TTBaseLabel) override;
73  ARMTargetStreamer &getTargetStreamer();
74 
75 public:
76  //===--------------------------------------------------------------------===//
77  // Main entry points.
78  //
80  ~ARMException() override;
81 
82  /// Emit all exception information that should come after the content.
83  void endModule() override {}
84 
85  /// Gather pre-function exception information. Assumes being emitted
86  /// immediately after the function entry point.
87  void beginFunction(const MachineFunction *MF) override;
88 
89  /// Gather and emit post-function exception information.
90  void endFunction(const MachineFunction *) override;
91 };
92 } // End of namespace llvm
93 
94 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:23
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
bool shouldEmitCFI
Per-function flag to indicate if frame CFI info should be emitted.
Emits exception handling directives.
Definition: EHStreamer.h:30
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:78
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library...
Definition: Compiler.h:115
bool hasEmittedCFISections
Per-module flag to indicate if .cfi_section has beeen emitted.
MCSymbol * ExceptionSymbolProvider(AsmPrinter *Asm)
void endModule() override
Emit all exception information that should come after the content.