LLVM  16.0.0git
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.
29  bool shouldEmitCFI = false;
30  /// Per-module flag to indicate if .cfi_section has beeen emitted.
31  bool hasEmittedCFISections = false;
32 
33  void markFunctionEnd() override;
34 };
35 
37  /// Per-function flag to indicate if .cfi_personality should be emitted.
38  bool shouldEmitPersonality = false;
39 
40  /// Per-function flag to indicate if .cfi_personality must be emitted.
41  bool forceEmitPersonality = false;
42 
43  /// Per-function flag to indicate if .cfi_lsda should be emitted.
44  bool shouldEmitLSDA = false;
45 
46 public:
47  //===--------------------------------------------------------------------===//
48  // Main entry points.
49  //
51  ~DwarfCFIException() override;
52 
53  /// Emit all exception information that should come after the content.
54  void endModule() override;
55 
56  /// Gather pre-function exception information. Assumes being emitted
57  /// immediately after the function entry point.
58  void beginFunction(const MachineFunction *MF) override;
59 
60  /// Gather and emit post-function exception information.
61  void endFunction(const MachineFunction *) override;
62 
63  void beginBasicBlockSection(const MachineBasicBlock &MBB) override;
64  void endBasicBlockSection(const MachineBasicBlock &MBB) override;
65 };
66 
68  void emitTypeInfos(unsigned TTypeEncoding, MCSymbol *TTBaseLabel) override;
69  ARMTargetStreamer &getTargetStreamer();
70 
71 public:
72  //===--------------------------------------------------------------------===//
73  // Main entry points.
74  //
76  ~ARMException() override;
77 
78  /// Emit all exception information that should come after the content.
79  void endModule() override {}
80 
81  /// Gather pre-function exception information. Assumes being emitted
82  /// immediately after the function entry point.
83  void beginFunction(const MachineFunction *MF) override;
84 
85  /// Gather and emit post-function exception information.
86  void endFunction(const MachineFunction *) override;
87 
88  void markFunctionEnd() override;
89 };
90 
92  /// This is AIX's compat unwind section, which unwinder would use
93  /// to find the location of LSDA area and personality rountine.
94  void emitExceptionInfoTable(const MCSymbol *LSDA, const MCSymbol *PerSym);
95 
96 public:
98 
99  void markFunctionEnd() override;
100 
101  void endModule() override {}
102  void beginFunction(const MachineFunction *MF) override {}
103  void endFunction(const MachineFunction *MF) override;
104 };
105 } // End of namespace llvm
106 
107 #endif
AsmPrinter.h
MCDwarf.h
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
llvm::MCSymbol
MCSymbol - Instances of this class represent a symbol name in the MC file, and MCSymbols are created ...
Definition: MCSymbol.h:41
llvm::EHStreamer
Emits exception handling directives.
Definition: EHStreamer.h:30
llvm::ARMTargetStreamer
Definition: MCStreamer.h:135
llvm::AIXException::endModule
void endModule() override
Emit all sections that should come after the content.
Definition: DwarfException.h:101
llvm::ARMException
Definition: DwarfException.h:67
EHStreamer.h
llvm::AIXException::beginFunction
void beginFunction(const MachineFunction *MF) override
Gather pre-function debug information.
Definition: DwarfException.h:102
llvm::MachineBasicBlock
Definition: MachineBasicBlock.h:94
llvm::DwarfCFIExceptionBase
Definition: DwarfException.h:24
llvm::DwarfCFIException
Definition: DwarfException.h:36
llvm::ARMException::endModule
void endModule() override
Emit all exception information that should come after the content.
Definition: DwarfException.h:79
llvm::AIXException
Definition: DwarfException.h:91
llvm::MachineFunction
Definition: MachineFunction.h:257
LLVM_LIBRARY_VISIBILITY
#define LLVM_LIBRARY_VISIBILITY
LLVM_LIBRARY_VISIBILITY - If a class marked with this attribute is linked into a shared library,...
Definition: Compiler.h:126
MBB
MachineBasicBlock & MBB
Definition: AArch64SLSHardening.cpp:74
llvm::AsmPrinter
This class is intended to be used as a driving class for all asm writers.
Definition: AsmPrinter.h:84