2009-05-15 09:12:28 +08:00
|
|
|
//===-- DwarfException.h - Dwarf Exception Framework -----------*- C++ -*--===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file contains support for writing dwarf exception info into asm files.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
|
|
|
|
#define LLVM_LIB_CODEGEN_ASMPRINTER_DWARFEXCEPTION_H
|
2009-05-15 09:12:28 +08:00
|
|
|
|
2014-06-11 09:19:03 +08:00
|
|
|
#include "EHStreamer.h"
|
2011-05-11 02:39:09 +08:00
|
|
|
#include "llvm/CodeGen/AsmPrinter.h"
|
2009-05-15 09:12:28 +08:00
|
|
|
|
|
|
|
namespace llvm {
|
2010-04-05 13:28:23 +08:00
|
|
|
class MachineFunction;
|
2013-10-08 21:08:17 +08:00
|
|
|
class ARMTargetStreamer;
|
2011-01-15 05:57:45 +08:00
|
|
|
|
2015-03-10 02:29:12 +08:00
|
|
|
class DwarfCFIExceptionBase : public EHStreamer {
|
|
|
|
protected:
|
|
|
|
DwarfCFIExceptionBase(AsmPrinter *A);
|
|
|
|
|
|
|
|
/// Per-function flag to indicate if frame CFI info should be emitted.
|
|
|
|
bool shouldEmitCFI;
|
|
|
|
|
|
|
|
void markFunctionEnd() override;
|
|
|
|
};
|
|
|
|
|
|
|
|
class DwarfCFIException : public DwarfCFIExceptionBase {
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Per-function flag to indicate if .cfi_personality should be emitted.
|
2011-04-29 22:48:51 +08:00
|
|
|
bool shouldEmitPersonality;
|
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Per-function flag to indicate if .cfi_lsda should be emitted.
|
2011-04-29 22:48:51 +08:00
|
|
|
bool shouldEmitLSDA;
|
2011-01-15 05:57:53 +08:00
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Per-function flag to indicate if frame moves info should be emitted.
|
2011-01-15 05:57:53 +08:00
|
|
|
bool shouldEmitMoves;
|
|
|
|
|
2011-05-11 02:39:09 +08:00
|
|
|
AsmPrinter::CFIMoveType moveTypeModule;
|
|
|
|
|
2011-01-15 05:57:53 +08:00
|
|
|
public:
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Main entry points.
|
|
|
|
//
|
|
|
|
DwarfCFIException(AsmPrinter *A);
|
|
|
|
virtual ~DwarfCFIException();
|
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Emit all exception information that should come after the content.
|
2014-03-08 14:31:39 +08:00
|
|
|
void endModule() override;
|
2009-05-15 09:12:28 +08:00
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Gather pre-function exception information. Assumes being emitted
|
|
|
|
/// immediately after the function entry point.
|
2014-03-08 14:31:39 +08:00
|
|
|
void beginFunction(const MachineFunction *MF) override;
|
2009-05-15 09:12:28 +08:00
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Gather and emit post-function exception information.
|
2014-03-08 14:31:39 +08:00
|
|
|
void endFunction(const MachineFunction *) override;
|
2009-05-15 09:12:28 +08:00
|
|
|
};
|
|
|
|
|
2015-03-10 02:29:12 +08:00
|
|
|
class ARMException : public DwarfCFIExceptionBase {
|
2014-06-11 09:19:03 +08:00
|
|
|
void emitTypeInfos(unsigned TTypeEncoding) override;
|
2013-10-08 21:08:17 +08:00
|
|
|
ARMTargetStreamer &getTargetStreamer();
|
|
|
|
|
2011-03-06 02:43:15 +08:00
|
|
|
public:
|
|
|
|
//===--------------------------------------------------------------------===//
|
|
|
|
// Main entry points.
|
|
|
|
//
|
|
|
|
ARMException(AsmPrinter *A);
|
|
|
|
virtual ~ARMException();
|
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Emit all exception information that should come after the content.
|
2014-03-08 14:31:39 +08:00
|
|
|
void endModule() override;
|
2011-03-06 02:43:15 +08:00
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Gather pre-function exception information. Assumes being emitted
|
|
|
|
/// immediately after the function entry point.
|
2014-03-08 14:31:39 +08:00
|
|
|
void beginFunction(const MachineFunction *MF) override;
|
2011-03-06 02:43:15 +08:00
|
|
|
|
2015-03-10 02:11:42 +08:00
|
|
|
/// Gather and emit post-function exception information.
|
2014-03-08 14:31:39 +08:00
|
|
|
void endFunction(const MachineFunction *) override;
|
2011-03-06 02:43:15 +08:00
|
|
|
};
|
2009-05-15 09:12:28 +08:00
|
|
|
} // End of namespace llvm
|
|
|
|
|
|
|
|
#endif
|