1 //===-- llvm/CodeGen/DwarfWriter.h - Dwarf Framework ------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file contains support for writing Dwarf debug and exception info into
11 // asm files. For Details on the Dwarf 3 specfication see DWARF Debugging
12 // Information Format V.3 reference manual http://dwarf.freestandards.org ,
14 // The role of the Dwarf Writer class is to extract information from the
15 // MachineModuleInfo object, organize it in Dwarf form and then emit it into asm
16 // the current asm file using data and high level Dwarf directives.
18 //===----------------------------------------------------------------------===//
20 #ifndef LLVM_CODEGEN_DWARFWRITER_H
21 #define LLVM_CODEGEN_DWARFWRITER_H
23 #include "llvm/Pass.h"
30 class MachineModuleInfo;
31 class MachineFunction;
37 //===----------------------------------------------------------------------===//
38 // DwarfWriter - Emits Dwarf debug and exception handling directives.
41 class DwarfWriter : public ImmutablePass {
43 /// DD - Provides the DwarfWriter debug implementation.
47 /// DE - Provides the DwarfWriter exception implementation.
52 static char ID; // Pass identification, replacement for typeid
55 virtual ~DwarfWriter();
57 //===--------------------------------------------------------------------===//
61 /// BeginModule - Emit all Dwarf sections that should come prior to the
63 void BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS,
64 AsmPrinter *A, const TargetAsmInfo *T);
66 /// EndModule - Emit all Dwarf sections that should come after the content.
70 /// BeginFunction - Gather pre-function debug information. Assumes being
71 /// emitted immediately after the function entry point.
72 void BeginFunction(MachineFunction *MF);
74 /// EndFunction - Gather and emit post-function debug information.
76 void EndFunction(MachineFunction *MF);
79 /// label. Returns a unique label ID used to generate a label and provide
80 /// correspondence to the source line list.
81 unsigned RecordSourceLine(unsigned Line, unsigned Col, unsigned Src);
83 /// RecordSource - Register a source file with debug info. Returns an source
85 unsigned RecordSource(const std::string &Dir, const std::string &File);
87 /// RecordRegionStart - Indicate the start of a region.
88 unsigned RecordRegionStart(GlobalVariable *V);
90 /// RecordRegionEnd - Indicate the end of a region.
91 unsigned RecordRegionEnd(GlobalVariable *V);
93 /// getRecordSourceLineCount - Count source lines.
94 unsigned getRecordSourceLineCount();
99 } // end llvm namespace