make MachineFunction keep track of its ID and make
[oota-llvm.git] / include / llvm / CodeGen / MachineModuleInfo.h
index f2b027bbbeeb483a7384ed91be17fc12d4b0230e..d36502985a59f4475d98f5ed7dbe35962a23297a 100644 (file)
@@ -43,8 +43,7 @@
 #include "llvm/GlobalValue.h"
 #include "llvm/Pass.h"
 #include "llvm/Metadata.h"
-
-#define ATTACH_DEBUG_INFO_TO_AN_INSN 1
+#include "llvm/Support/ValueHandle.h"
 
 namespace llvm {
 
@@ -137,9 +136,6 @@ class MachineModuleInfo : public ImmutablePass {
   /// llvm.compiler.used.
   SmallPtrSet<const Function *, 32> UsedFunctions;
 
-  /// UsedDbgLabels - labels are used by debug info entries.
-  SmallSet<unsigned, 8> UsedDbgLabels;
-
   bool CallsEHReturn;
   bool CallsUnwindInit;
  
@@ -150,7 +146,8 @@ class MachineModuleInfo : public ImmutablePass {
 public:
   static char ID; // Pass identification, replacement for typeid
 
-  typedef SmallVector< std::pair<TrackingVH<MDNode>, unsigned>, 4 > 
+  typedef std::pair<unsigned, TrackingVH<MDNode> > UnsignedAndMDNodePair;
+  typedef SmallVector< std::pair<TrackingVH<MDNode>, UnsignedAndMDNodePair>, 4>
     VariableDbgInfoMapTy;
   VariableDbgInfoMapTy VariableDbgInfo;
 
@@ -175,9 +172,6 @@ public:
   Ty &getObjFileInfo() {
     if (ObjFileMMI == 0)
       ObjFileMMI = new Ty(*this);
-    
-    assert((void*)dynamic_cast<Ty*>(ObjFileMMI) == (void*)ObjFileMMI &&
-           "Invalid concrete type or multiple inheritence for getInfo");
     return *static_cast<Ty*>(ObjFileMMI);
   }
   
@@ -233,19 +227,6 @@ public:
     return LabelID ? LabelIDList[LabelID - 1] : 0;
   }
 
-  /// isDbgLabelUsed - Return true if label with LabelID is used by
-  /// DwarfWriter.
-  bool isDbgLabelUsed(unsigned LabelID) {
-    return UsedDbgLabels.count(LabelID);
-  }
-  
-  /// RecordUsedDbgLabel - Mark label with LabelID as used. This is used
-  /// by DwarfWriter to inform DebugLabelFolder that certain labels are
-  /// not to be deleted.
-  void RecordUsedDbgLabel(unsigned LabelID) {
-    UsedDbgLabels.insert(LabelID);
-  }
-
   /// getFrameMoves - Returns a reference to a list of moves done in the current
   /// function's prologue.  Used to construct frame maps for debug and exception
   /// handling comsumers.
@@ -336,8 +317,8 @@ public:
 
   /// setVariableDbgInfo - Collect information used to emit debugging information
   /// of a variable.
-  void setVariableDbgInfo(MDNode *N, unsigned S) {
-    VariableDbgInfo.push_back(std::make_pair(N, S));
+  void setVariableDbgInfo(MDNode *N, unsigned Slot, MDNode *Scope) {
+    VariableDbgInfo.push_back(std::make_pair(N, std::make_pair(Slot, Scope)));
   }
 
   VariableDbgInfoMapTy &getVariableDbgInfo() {  return VariableDbgInfo;  }