Pull out r108755. After offline discussion with Chris, we're going to go a different...
[oota-llvm.git] / include / llvm / PassSupport.h
index 09abe93e916dd07b46c6501a479396ca595038de..b0183513386db975eab4d307a507590cea5b1588 100644 (file)
@@ -36,10 +36,6 @@ class TargetMachine;
 class PassInfo {
 public:
   typedef Pass* (*NormalCtor_t)();
-  struct InterfaceInfo {
-    const PassInfo *interface;
-    const InterfaceInfo *next;
-  };
 
 private:
   const char      *const PassName;     // Nice name for Pass
@@ -48,7 +44,7 @@ private:
   const bool IsCFGOnlyPass;            // Pass only looks at the CFG.
   const bool IsAnalysis;               // True if an analysis pass.
   const bool IsAnalysisGroup;          // True if an analysis group.
-  const InterfaceInfo *ItfImpl;// Interfaces implemented by this pass
+  std::vector<const PassInfo*> ItfImpl;// Interfaces implemented by this pass
 
   NormalCtor_t NormalCtor;
 
@@ -120,16 +116,13 @@ public:
   /// template.
   ///
   void addInterfaceImplemented(const PassInfo *ItfPI) {
-    InterfaceInfo *NewInfo = new InterfaceInfo();
-    NewInfo->interface = ItfPI;
-    NewInfo->next = ItfImpl;
-    ItfImpl = NewInfo;
+    ItfImpl.push_back(ItfPI);
   }
 
   /// getInterfacesImplemented - Return a list of all of the analysis group
   /// interfaces implemented by this pass.
   ///
-  const InterfaceInfo *getInterfacesImplemented() const {
+  const std::vector<const PassInfo*> &getInterfacesImplemented() const {
     return ItfImpl;
   }