aboutsummaryrefslogtreecommitdiff
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.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/llvm/ADT/MapVector.h b/include/llvm/ADT/MapVector.h
index 26a555ee1d3..3d78f4b203c 100644
--- a/include/llvm/ADT/MapVector.h
+++ b/include/llvm/ADT/MapVector.h
@@ -56,6 +56,13 @@ public:
size_type size() const { return Vector.size(); }
+ /// Grow the MapVector so that it can contain at least \p NumEntries items
+ /// before resizing again.
+ void reserve(size_type NumEntries) {
+ Map.reserve(NumEntries);
+ Vector.reserve(NumEntries);
+ }
+
iterator begin() { return Vector.begin(); }
const_iterator begin() const { return Vector.begin(); }
iterator end() { return Vector.end(); }