d5d6925278d682bebc47e53d7b464b71dec3b6a1
[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 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 ,
13 //
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.
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 DwarfDebug;
29 class DwarfException;
30 class MachineModuleInfo;
31 class MachineFunction;
32 class Module;
33 class TargetAsmInfo;
34
35 //===----------------------------------------------------------------------===//
36 // DwarfWriter - Emits Dwarf debug and exception handling directives.
37 //
38
39 class DwarfWriter {
40 private:
41   /// DD - Provides the DwarfWriter debug implementation.
42   ///
43   DwarfDebug *DD;
44
45   /// DE - Provides the DwarfWriter exception implementation.
46   ///
47   DwarfException *DE;
48   
49 public:
50   
51   DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
52   virtual ~DwarfWriter();
53   
54   /// SetModuleInfo - Set machine module info when it's known that pass manager
55   /// has created it.  Set by the target AsmPrinter.
56   void SetModuleInfo(MachineModuleInfo *MMI);
57
58   //===--------------------------------------------------------------------===//
59   // Main entry points.
60   //
61   
62   /// BeginModule - Emit all Dwarf sections that should come prior to the
63   /// content.
64   void BeginModule(Module *M);
65   
66   /// EndModule - Emit all Dwarf sections that should come after the content.
67   ///
68   void EndModule();
69   
70   /// BeginFunction - Gather pre-function debug information.  Assumes being 
71   /// emitted immediately after the function entry point.
72   void BeginFunction(MachineFunction *MF);
73   
74   /// EndFunction - Gather and emit post-function debug information.
75   ///
76   void EndFunction();
77 };
78
79
80 } // end llvm namespace
81
82 #endif