Bill Wendling | d64cd2b | 2009-05-15 01:12:28 +0000 | [diff] [blame] | 1 | //===-- DwarfException.h - Dwarf Exception Framework -----------*- C++ -*--===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file contains support for writing dwarf exception info into asm files. |
| 11 | // |
| 12 | //===----------------------------------------------------------------------===// |
| 13 | |
Benjamin Kramer | a7c40ef | 2014-08-13 16:26:38 +0000 | [diff] [blame] | 14 | #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H |
| 15 | #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H |
Bill Wendling | d64cd2b | 2009-05-15 01:12:28 +0000 | [diff] [blame] | 16 | |
Saleem Abdulrasool | 8076cab | 2014-06-11 01:19:03 +0000 | [diff] [blame] | 17 | #include "EHStreamer.h" |
Rafael Espindola | fdc3e6f | 2011-05-10 18:39:09 +0000 | [diff] [blame] | 18 | #include "llvm/CodeGen/AsmPrinter.h" |
Bill Wendling | d64cd2b | 2009-05-15 01:12:28 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
Chris Lattner | da790ea | 2010-04-05 05:28:23 +0000 | [diff] [blame] | 21 | class MachineFunction; |
Rafael Espindola | a17151a | 2013-10-08 13:08:17 +0000 | [diff] [blame] | 22 | class ARMTargetStreamer; |
Bill Wendling | d64cd2b | 2009-05-15 01:12:28 +0000 | [diff] [blame] | 23 | |
Saleem Abdulrasool | 8076cab | 2014-06-11 01:19:03 +0000 | [diff] [blame] | 24 | class DwarfCFIException : public EHStreamer { |
Rafael Espindola | 697edc8 | 2011-04-29 14:48:51 +0000 | [diff] [blame] | 25 | /// shouldEmitPersonality - Per-function flag to indicate if .cfi_personality |
| 26 | /// should be emitted. |
| 27 | bool shouldEmitPersonality; |
| 28 | |
| 29 | /// shouldEmitLSDA - Per-function flag to indicate if .cfi_lsda |
| 30 | /// should be emitted. |
| 31 | bool shouldEmitLSDA; |
Anton Korobeynikov | b46ef57 | 2011-01-14 21:57:53 +0000 | [diff] [blame] | 32 | |
| 33 | /// shouldEmitMoves - Per-function flag to indicate if frame moves info |
| 34 | /// should be emitted. |
| 35 | bool shouldEmitMoves; |
| 36 | |
Rafael Espindola | fdc3e6f | 2011-05-10 18:39:09 +0000 | [diff] [blame] | 37 | AsmPrinter::CFIMoveType moveTypeModule; |
| 38 | |
Anton Korobeynikov | b46ef57 | 2011-01-14 21:57:53 +0000 | [diff] [blame] | 39 | public: |
| 40 | //===--------------------------------------------------------------------===// |
| 41 | // Main entry points. |
| 42 | // |
| 43 | DwarfCFIException(AsmPrinter *A); |
| 44 | virtual ~DwarfCFIException(); |
| 45 | |
Timur Iskhodzhanov | 119f307 | 2013-11-26 13:34:55 +0000 | [diff] [blame] | 46 | /// endModule - Emit all exception information that should come after the |
Anton Korobeynikov | b46ef57 | 2011-01-14 21:57:53 +0000 | [diff] [blame] | 47 | /// content. |
Craig Topper | 7b883b3 | 2014-03-08 06:31:39 +0000 | [diff] [blame] | 48 | void endModule() override; |
Anton Korobeynikov | b46ef57 | 2011-01-14 21:57:53 +0000 | [diff] [blame] | 49 | |
Timur Iskhodzhanov | 119f307 | 2013-11-26 13:34:55 +0000 | [diff] [blame] | 50 | /// beginFunction - Gather pre-function exception information. Assumes being |
Anton Korobeynikov | b46ef57 | 2011-01-14 21:57:53 +0000 | [diff] [blame] | 51 | /// emitted immediately after the function entry point. |
Craig Topper | 7b883b3 | 2014-03-08 06:31:39 +0000 | [diff] [blame] | 52 | void beginFunction(const MachineFunction *MF) override; |
Anton Korobeynikov | b46ef57 | 2011-01-14 21:57:53 +0000 | [diff] [blame] | 53 | |
Timur Iskhodzhanov | 119f307 | 2013-11-26 13:34:55 +0000 | [diff] [blame] | 54 | /// endFunction - Gather and emit post-function exception information. |
Craig Topper | 7b883b3 | 2014-03-08 06:31:39 +0000 | [diff] [blame] | 55 | void endFunction(const MachineFunction *) override; |
Anton Korobeynikov | b46ef57 | 2011-01-14 21:57:53 +0000 | [diff] [blame] | 56 | }; |
| 57 | |
Saleem Abdulrasool | 8076cab | 2014-06-11 01:19:03 +0000 | [diff] [blame] | 58 | class ARMException : public EHStreamer { |
| 59 | void emitTypeInfos(unsigned TTypeEncoding) override; |
Rafael Espindola | a17151a | 2013-10-08 13:08:17 +0000 | [diff] [blame] | 60 | ARMTargetStreamer &getTargetStreamer(); |
| 61 | |
Artyom Skrobov | f6830f4 | 2014-02-14 17:19:07 +0000 | [diff] [blame] | 62 | /// shouldEmitCFI - Per-function flag to indicate if frame CFI info |
| 63 | /// should be emitted. |
| 64 | bool shouldEmitCFI; |
| 65 | |
Anton Korobeynikov | a7ec2dc | 2011-03-05 18:43:15 +0000 | [diff] [blame] | 66 | public: |
| 67 | //===--------------------------------------------------------------------===// |
| 68 | // Main entry points. |
| 69 | // |
| 70 | ARMException(AsmPrinter *A); |
| 71 | virtual ~ARMException(); |
| 72 | |
Timur Iskhodzhanov | 119f307 | 2013-11-26 13:34:55 +0000 | [diff] [blame] | 73 | /// endModule - Emit all exception information that should come after the |
Anton Korobeynikov | a7ec2dc | 2011-03-05 18:43:15 +0000 | [diff] [blame] | 74 | /// content. |
Craig Topper | 7b883b3 | 2014-03-08 06:31:39 +0000 | [diff] [blame] | 75 | void endModule() override; |
Anton Korobeynikov | a7ec2dc | 2011-03-05 18:43:15 +0000 | [diff] [blame] | 76 | |
Timur Iskhodzhanov | 119f307 | 2013-11-26 13:34:55 +0000 | [diff] [blame] | 77 | /// beginFunction - Gather pre-function exception information. Assumes being |
Anton Korobeynikov | a7ec2dc | 2011-03-05 18:43:15 +0000 | [diff] [blame] | 78 | /// emitted immediately after the function entry point. |
Craig Topper | 7b883b3 | 2014-03-08 06:31:39 +0000 | [diff] [blame] | 79 | void beginFunction(const MachineFunction *MF) override; |
Anton Korobeynikov | a7ec2dc | 2011-03-05 18:43:15 +0000 | [diff] [blame] | 80 | |
Timur Iskhodzhanov | 119f307 | 2013-11-26 13:34:55 +0000 | [diff] [blame] | 81 | /// endFunction - Gather and emit post-function exception information. |
Craig Topper | 7b883b3 | 2014-03-08 06:31:39 +0000 | [diff] [blame] | 82 | void endFunction(const MachineFunction *) override; |
Anton Korobeynikov | a7ec2dc | 2011-03-05 18:43:15 +0000 | [diff] [blame] | 83 | }; |
Bill Wendling | d64cd2b | 2009-05-15 01:12:28 +0000 | [diff] [blame] | 84 | } // End of namespace llvm |
| 85 | |
| 86 | #endif |