summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-07-23 03:29:59 +0000
committerChris Lattner <sabre@nondot.org>2010-07-23 03:29:59 +0000
commitc0a14c16221f0a1a05dc9ca718fd058f69d3c6e4 (patch)
treee5b5ec740d1751c256bf09ef275f38ed72233ceb
parent6ba9d4483fc27d003f6d4b2beb237b45c179656d (diff)
downloadbcm5719-llvm-c0a14c16221f0a1a05dc9ca718fd058f69d3c6e4.tar.gz
bcm5719-llvm-c0a14c16221f0a1a05dc9ca718fd058f69d3c6e4.zip
give StringMap a new ctor which allows you to initialize it
with an existing allocator. The interesting use case of this is that it allows "StringMap<whatever, BumpPtrAllocator&>" for when you want to allocate out of a preexisting bump pointer allocator owned by someone else. llvm-svn: 109213
-rw-r--r--llvm/include/llvm/ADT/StringMap.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/include/llvm/ADT/StringMap.h b/llvm/include/llvm/ADT/StringMap.h
index 482193859b6..59ff6aa4f6a 100644
--- a/llvm/include/llvm/ADT/StringMap.h
+++ b/llvm/include/llvm/ADT/StringMap.h
@@ -254,6 +254,10 @@ public:
StringMap() : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {}
explicit StringMap(unsigned InitialSize)
: StringMapImpl(InitialSize, static_cast<unsigned>(sizeof(MapEntryTy))) {}
+
+ explicit StringMap(AllocatorTy A)
+ : StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))), Allocator(A) {}
+
explicit StringMap(const StringMap &RHS)
: StringMapImpl(static_cast<unsigned>(sizeof(MapEntryTy))) {
assert(RHS.empty() &&
OpenPOWER on IntegriCloud