Propagate debug info when building SelectionDAG.
[oota-llvm.git] / include / llvm / CodeGen / MachineFunction.h
index 835c8a37c56e2d67fee4addf8d225ebb6ca55d00..0d5a71d142d7aafd3f7e400962b6a8bde2360871 100644 (file)
@@ -19,6 +19,7 @@
 #define LLVM_CODEGEN_MACHINEFUNCTION_H
 
 #include "llvm/ADT/ilist.h"
+#include "llvm/CodeGen/DebugLoc.h"
 #include "llvm/CodeGen/MachineBasicBlock.h"
 #include "llvm/Support/Annotation.h"
 #include "llvm/Support/Allocator.h"
 namespace llvm {
 
 class Function;
-class TargetMachine;
 class MachineRegisterInfo;
 class MachineFrameInfo;
 class MachineConstantPool;
 class MachineJumpTableInfo;
+class TargetMachine;
 
 template <>
 struct ilist_traits<MachineBasicBlock>
@@ -94,6 +95,9 @@ class MachineFunction : private Annotation {
   typedef ilist<MachineBasicBlock> BasicBlockListType;
   BasicBlockListType BasicBlocks;
 
+  // Tracks debug locations.
+  DebugLocTracker DebugLocInfo;
+
 public:
   MachineFunction(const Function *Fn, const TargetMachine &TM);
   ~MachineFunction();
@@ -302,6 +306,15 @@ public:
   /// DeleteMachineBasicBlock - Delete the given MachineBasicBlock.
   ///
   void DeleteMachineBasicBlock(MachineBasicBlock *MBB);
+
+  //===--------------------------------------------------------------------===//
+  // Debug location.
+  //
+
+  /// getOrCreateDebugLocID - Look up the DebugLocTuple index with the given
+  /// source file, line, and column. If none currently exists, create add a new
+  /// new DebugLocTuple and insert it into the DebugIdMap.
+  unsigned getOrCreateDebugLocID(unsigned Src, unsigned Line, unsigned Col);
 };
 
 //===--------------------------------------------------------------------===//