summaryrefslogtreecommitdiff
path: root/include/llvm/ADT/MapVector.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/ADT/MapVector.h')
-rw-r--r--include/llvm/ADT/MapVector.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/ADT/MapVector.h b/include/llvm/ADT/MapVector.h
index 6aacca5a6f..42f8e553d4 100644
--- a/include/llvm/ADT/MapVector.h
+++ b/include/llvm/ADT/MapVector.h
@@ -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);
+ }
};
}