1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/include/llvm/CodeGen/DwarfWriter.h

119 lines
3.6 KiB
C
Raw Normal View History

//===-- llvm/CodeGen/DwarfWriter.h - Dwarf 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 debug and exception info into
// asm files. For Details on the Dwarf 3 specfication see DWARF Debugging
// Information Format V.3 reference manual http://dwarf.freestandards.org ,
//
// The role of the Dwarf Writer class is to extract information from the
// MachineModuleInfo object, organize it in Dwarf form and then emit it into asm
// the current asm file using data and high level Dwarf directives.
//
//===----------------------------------------------------------------------===//
2006-01-17 20:12:24 +01:00
#ifndef LLVM_CODEGEN_DWARFWRITER_H
#define LLVM_CODEGEN_DWARFWRITER_H
#include "llvm/Pass.h"
#include "llvm/Target/TargetMachine.h"
2005-12-21 20:46:32 +01:00
namespace llvm {
2006-02-27 13:43:29 +01:00
class AsmPrinter;
class DwarfDebug;
class DwarfException;
class MachineModuleInfo;
2006-02-27 13:43:29 +01:00
class MachineFunction;
class MachineInstr;
class Value;
2006-02-27 13:43:29 +01:00
class Module;
class MDNode;
class MCAsmInfo;
class raw_ostream;
class Instruction;
class DICompileUnit;
class DISubprogram;
class DIVariable;
2006-02-27 13:43:29 +01:00
//===----------------------------------------------------------------------===//
// DwarfWriter - Emits Dwarf debug and exception handling directives.
//
class DwarfWriter : public ImmutablePass {
private:
/// DD - Provides the DwarfWriter debug implementation.
2006-02-27 13:43:29 +01:00
///
DwarfDebug *DD;
/// DE - Provides the DwarfWriter exception implementation.
///
DwarfException *DE;
2006-02-27 13:43:29 +01:00
public:
static char ID; // Pass identification, replacement for typeid
DwarfWriter();
2006-02-27 13:43:29 +01:00
virtual ~DwarfWriter();
2006-02-27 13:43:29 +01:00
//===--------------------------------------------------------------------===//
// Main entry points.
//
/// BeginModule - Emit all Dwarf sections that should come prior to the
/// content.
void BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS,
AsmPrinter *A, const MCAsmInfo *T);
2006-02-27 13:43:29 +01:00
/// EndModule - Emit all Dwarf sections that should come after the content.
///
void EndModule();
2006-02-27 13:43:29 +01:00
/// BeginFunction - Gather pre-function debug information. Assumes being
/// emitted immediately after the function entry point.
void BeginFunction(MachineFunction *MF);
2006-02-27 13:43:29 +01:00
/// EndFunction - Gather and emit post-function debug information.
///
void EndFunction(MachineFunction *MF);
/// RecordSourceLine - Register a source line with debug info. Returns a
/// unique label ID used to generate a label and provide correspondence to
/// the source line list.
unsigned RecordSourceLine(unsigned Line, unsigned Col, DICompileUnit CU);
/// RecordRegionStart - Indicate the start of a region.
unsigned RecordRegionStart(MDNode *N);
/// RecordRegionEnd - Indicate the end of a region.
unsigned RecordRegionEnd(MDNode *N);
/// getRecordSourceLineCount - Count source lines.
unsigned getRecordSourceLineCount();
/// RecordVariable - Indicate the declaration of a local variable.
///
void RecordVariable(MDNode *N, unsigned FrameIndex);
/// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should
/// be emitted.
bool ShouldEmitDwarfDebug() const;
//// RecordInlinedFnStart - Indicate the start of a inlined function.
unsigned RecordInlinedFnStart(DISubprogram SP, DICompileUnit CU,
unsigned Line, unsigned Col);
/// RecordInlinedFnEnd - Indicate the end of inlined subroutine.
unsigned RecordInlinedFnEnd(DISubprogram SP);
2006-02-27 13:43:29 +01:00
};
2005-12-21 20:46:32 +01:00
} // end llvm namespace
#endif