Fix indeterminism in MI scheduler DAG construction.
[oota-llvm.git] / include / llvm / ADT / MapVector.h
index 6aacca5a6f0fc5c17c87ae1f9fb9fb4dd868cee4..42f8e553d43830584ba61d2f5e37bb750d126a52 100644 (file)
@@ -83,6 +83,18 @@ public:
     typename MapType::const_iterator Pos = Map.find(Key);
     return Pos == Map.end()? 0 : 1;
   }
+
+  iterator find(const KeyT &Key) {
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? Vector.end() :
+                            (Vector.begin() + Pos->second);
+  }
+
+  const_iterator find(const KeyT &Key) const {
+    typename MapType::const_iterator Pos = Map.find(Key);
+    return Pos == Map.end()? Vector.end() :
+                            (Vector.begin() + Pos->second);
+  }
 };
 
 }