Apply B. Scott Michel's patch for PR1054, thanks!
[oota-llvm.git] / include / llvm / CodeGen / DwarfWriter.h
1 //===-- llvm/CodeGen/DwarfWriter.h - Dwarf Framework ------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file was developed by James M. Laskey and is distributed under the
6 // University of Illinois Open Source License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file contains support for writing Dwarf debug info into asm files.  For
11 // Details on the Dwarf 3 specfication see DWARF Debugging Information Format
12 // V.3 reference manual http://dwarf.freestandards.org ,
13 //
14 // The role of the Dwarf Writer class is to extract debug information from the
15 // MachineDebugInfo object, organize it in Dwarf form and then emit it into asm
16 // the current asm file using data and high level Dwarf directives.
17 // 
18 //===----------------------------------------------------------------------===//
19
20 #ifndef LLVM_CODEGEN_DWARFWRITER_H
21 #define LLVM_CODEGEN_DWARFWRITER_H
22
23 #include <iosfwd>
24
25 namespace llvm {
26
27 class AsmPrinter;
28 class Dwarf;
29 class MachineDebugInfo;
30 class MachineFunction;
31 class Module;
32 class TargetAsmInfo;
33
34 //===----------------------------------------------------------------------===//
35 // DwarfWriter - Emits Dwarf debug and exception handling directives.
36 //
37
38 class DwarfWriter {
39 private:
40   /// DM - Provides the DwarfWriter implementation.
41   ///
42   Dwarf *DW;
43   
44 public:
45   
46   DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
47   virtual ~DwarfWriter();
48   
49   /// SetDebugInfo - Set DebugInfo when it's known that pass manager has
50   /// created it.  Set by the target AsmPrinter.
51   void SetDebugInfo(MachineDebugInfo *DI);
52
53   //===--------------------------------------------------------------------===//
54   // Main entry points.
55   //
56   
57   /// BeginModule - Emit all Dwarf sections that should come prior to the
58   /// content.
59   void BeginModule(Module *M);
60   
61   /// EndModule - Emit all Dwarf sections that should come after the content.
62   ///
63   void EndModule();
64   
65   /// BeginFunction - Gather pre-function debug information.  Assumes being 
66   /// emitted immediately after the function entry point.
67   void BeginFunction(MachineFunction *MF);
68   
69   /// EndFunction - Gather and emit post-function debug information.
70   ///
71   void EndFunction();
72 };
73
74
75 } // end llvm namespace
76
77 #endif