Add DebugLoc to the getNode() methods.
[oota-llvm.git] / include / llvm / CodeGen / DwarfWriter.h
index a0cfec766a4f44896c30f035bbd80ee0af729179..58a2fa742373a5456620921456357ef203492d1d 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef LLVM_CODEGEN_DWARFWRITER_H
 #define LLVM_CODEGEN_DWARFWRITER_H
 
-#include <iosfwd>
+#include "llvm/Pass.h"
 
 namespace llvm {
 
@@ -29,14 +29,17 @@ class DwarfDebug;
 class DwarfException;
 class MachineModuleInfo;
 class MachineFunction;
+class Value;
 class Module;
+class GlobalVariable;
 class TargetAsmInfo;
+class raw_ostream;
 
 //===----------------------------------------------------------------------===//
 // DwarfWriter - Emits Dwarf debug and exception handling directives.
 //
 
-class DwarfWriter {
+class DwarfWriter : public ImmutablePass {
 private:
   /// DD - Provides the DwarfWriter debug implementation.
   ///
@@ -47,21 +50,19 @@ private:
   DwarfException *DE;
   
 public:
-  
-  DwarfWriter(std::ostream &OS, AsmPrinter *A, const TargetAsmInfo *T);
+  static char ID; // Pass identification, replacement for typeid
+
+  DwarfWriter();
   virtual ~DwarfWriter();
   
-  /// SetModuleInfo - Set machine module info when it's known that pass manager
-  /// has created it.  Set by the target AsmPrinter.
-  void SetModuleInfo(MachineModuleInfo *MMI);
-
   //===--------------------------------------------------------------------===//
   // Main entry points.
   //
   
   /// BeginModule - Emit all Dwarf sections that should come prior to the
   /// content.
-  void BeginModule(Module *M);
+  void BeginModule(Module *M, MachineModuleInfo *MMI, raw_ostream &OS,
+                   AsmPrinter *A, const TargetAsmInfo *T);
   
   /// EndModule - Emit all Dwarf sections that should come after the content.
   ///
@@ -73,7 +74,33 @@ public:
   
   /// EndFunction - Gather and emit post-function debug information.
   ///
-  void EndFunction();
+  void EndFunction(MachineFunction *MF);
+
+  /// ValidDebugInfo - Return true if V represents valid debug info value.
+  bool ValidDebugInfo(Value *V);
+
+  /// RecordSourceLine - Register a source line with debug info. Returns a
+  /// unique label ID used to generate a label and provide correspondence to
+  /// the source line list.
+  unsigned RecordSourceLine(unsigned Line, unsigned Col, unsigned Src);
+
+  /// RecordSource - Register a source file with debug info. Returns an source
+  /// ID.
+  unsigned RecordSource(const std::string &Dir, const std::string &File);
+
+  /// RecordRegionStart - Indicate the start of a region.
+  unsigned RecordRegionStart(GlobalVariable *V);
+
+  /// RecordRegionEnd - Indicate the end of a region.
+  unsigned RecordRegionEnd(GlobalVariable *V);
+
+  /// getRecordSourceLineCount - Count source lines.
+  unsigned getRecordSourceLineCount();
+
+  /// RecordVariable - Indicate the declaration of  a local variable.
+  ///
+  void RecordVariable(GlobalVariable *GV, unsigned FrameIndex);
+
 };