Have the selection dag grab TargetLowering off of the subtarget
[oota-llvm.git] / include / llvm / CodeGen / GCMetadata.h
index 2b6c35b82f998d9860c1d6f330357498b85f6135..ddcc823ecd9e89beb5b982796dcd64bf4a9b6ff5 100644 (file)
 #ifndef LLVM_CODEGEN_GCMETADATA_H
 #define LLVM_CODEGEN_GCMETADATA_H
 
-#include "llvm/Pass.h"
 #include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/StringMap.h"
-#include "llvm/Support/DebugLoc.h"
+#include "llvm/IR/DebugLoc.h"
+#include "llvm/Pass.h"
+
+#include <memory>
 
 namespace llvm {
   class AsmPrinter;
@@ -71,7 +73,8 @@ namespace llvm {
   struct GCRoot {
     int Num;            ///< Usually a frame index.
     int StackOffset;    ///< Offset from the stack pointer.
-    const Constant *Metadata;//< Metadata straight from the call to llvm.gcroot.
+    const Constant *Metadata; ///< Metadata straight from the call
+                              ///< to llvm.gcroot.
 
     GCRoot(int N, const Constant *MD) : Num(N), StackOffset(-1), Metadata(MD) {}
   };
@@ -121,6 +124,11 @@ namespace llvm {
       Roots.push_back(GCRoot(Num, Metadata));
     }
 
+    /// removeStackRoot - Removes a root.
+    roots_iterator removeStackRoot(roots_iterator position) {
+      return Roots.erase(position);
+    }
+
     /// addSafePoint - Notes the existence of a safe point. Num is the ID of the
     /// label just prior to the safe point (if the code generator is using
     /// MachineModuleInfo).
@@ -157,7 +165,7 @@ namespace llvm {
   ///
   class GCModuleInfo : public ImmutablePass {
     typedef StringMap<GCStrategy*> strategy_map_type;
-    typedef std::vector<GCStrategy*> list_type;
+    typedef std::vector<std::unique_ptr<GCStrategy>> list_type;
     typedef DenseMap<const Function*,GCFunctionInfo*> finfo_map_type;
 
     strategy_map_type StrategyMap;
@@ -172,9 +180,9 @@ namespace llvm {
     static char ID;
 
     GCModuleInfo();
-    ~GCModuleInfo();
 
-    /// clear - Resets the pass. The metadata deleter pass calls this.
+    /// clear - Resets the pass. Any pass, which uses GCModuleInfo, should
+    /// call it in doFinalization().
     ///
     void clear();