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"
24 #include "llvm/Target/TargetMachine.h"
31 class MachineModuleInfo;
32 class MachineFunction;
45 //===----------------------------------------------------------------------===//
46 // DwarfWriter - Emits Dwarf debug and exception handling directives.
49 class DwarfWriter : public ImmutablePass {
51 /// DD - Provides the DwarfWriter debug implementation.
55 /// DE - Provides the DwarfWriter exception implementation.
60 static char ID; // Pass identification, replacement for typeid
63 virtual ~DwarfWriter();
65 //===--------------------------------------------------------------------===//
69 /// BeginModule - Emit all Dwarf sections that should come prior to the
71 void BeginModule(Module *M, AsmPrinter *A);
73 /// EndModule - Emit all Dwarf sections that should come after the content.
77 /// BeginFunction - Gather pre-function debug information. Assumes being
78 /// emitted immediately after the function entry point.
79 void BeginFunction(const MachineFunction *MF);
81 /// EndFunction - Gather and emit post-function debug information.
83 void EndFunction(const MachineFunction *MF);
85 /// ShouldEmitDwarfDebug - Returns true if Dwarf debugging declarations should
87 bool ShouldEmitDwarfDebug() const;
89 void BeginScope(const MachineInstr *MI);
90 void EndScope(const MachineInstr *MI);
93 } // end llvm namespace