diff options
author | Chris Lattner <sabre@nondot.org> | 2010-07-23 03:29:59 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-07-23 03:29:59 +0000 |
commit | 1cc1dfcb1ef766ac33e1b33aa892b6981538535b (patch) | |
tree | 3933098632fc68578cdec63a1ddd54f524d045d0 | |
parent | dee3451d42fbb220c7a78a9440c317c3919d5d2f (diff) | |
download | external_llvm-1cc1dfcb1ef766ac33e1b33aa892b6981538535b.tar.gz external_llvm-1cc1dfcb1ef766ac33e1b33aa892b6981538535b.tar.bz2 external_llvm-1cc1dfcb1ef766ac33e1b33aa892b6981538535b.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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109213 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/ADT/StringMap.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/llvm/ADT/StringMap.h b/include/llvm/ADT/StringMap.h index 482193859b..59ff6aa4f6 100644 --- a/include/llvm/ADT/StringMap.h +++ b/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() && |