DwarfException.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. #ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
  14. #define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
  15. #include "EHStreamer.h"
  16. #include "llvm/CodeGen/AsmPrinter.h"
  17. namespace llvm {
  18. class MachineFunction;
  19. class ARMTargetStreamer;
  20. class LLVM_LIBRARY_VISIBILITY DwarfCFIExceptionBase : public EHStreamer {
  21. protected:
  22. DwarfCFIExceptionBase(AsmPrinter *A);
  23. /// Per-function flag to indicate if frame CFI info should be emitted.
  24. bool shouldEmitCFI;
  25. void markFunctionEnd() override;
  26. };
  27. class LLVM_LIBRARY_VISIBILITY DwarfCFIException : public DwarfCFIExceptionBase {
  28. /// Per-function flag to indicate if .cfi_personality should be emitted.
  29. bool shouldEmitPersonality;
  30. /// Per-function flag to indicate if .cfi_lsda should be emitted.
  31. bool shouldEmitLSDA;
  32. /// Per-function flag to indicate if frame moves info should be emitted.
  33. bool shouldEmitMoves;
  34. AsmPrinter::CFIMoveType moveTypeModule;
  35. public:
  36. //===--------------------------------------------------------------------===//
  37. // Main entry points.
  38. //
  39. DwarfCFIException(AsmPrinter *A);
  40. ~DwarfCFIException() override;
  41. /// Emit all exception information that should come after the content.
  42. void endModule() override;
  43. /// Gather pre-function exception information. Assumes being emitted
  44. /// immediately after the function entry point.
  45. void beginFunction(const MachineFunction *MF) override;
  46. /// Gather and emit post-function exception information.
  47. void endFunction(const MachineFunction *) override;
  48. };
  49. class LLVM_LIBRARY_VISIBILITY ARMException : public DwarfCFIExceptionBase {
  50. void emitTypeInfos(unsigned TTypeEncoding) override;
  51. ARMTargetStreamer &getTargetStreamer();
  52. public:
  53. //===--------------------------------------------------------------------===//
  54. // Main entry points.
  55. //
  56. ARMException(AsmPrinter *A);
  57. ~ARMException() override;
  58. /// Emit all exception information that should come after the content.
  59. void endModule() override;
  60. /// Gather pre-function exception information. Assumes being emitted
  61. /// immediately after the function entry point.
  62. void beginFunction(const MachineFunction *MF) override;
  63. /// Gather and emit post-function exception information.
  64. void endFunction(const MachineFunction *) override;
  65. };
  66. } // End of namespace llvm
  67. #endif