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