[llvm] add9599 - [Support] Explicitly instantiate BumpPtrAllocatorImpl

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 18 09:21:59 PST 2020


Author: Reid Kleckner
Date: 2020-01-18T09:21:53-08:00
New Revision: add95990508ee0aec90d07bcce1bba47b4f46622

URL: https://github.com/llvm/llvm-project/commit/add95990508ee0aec90d07bcce1bba47b4f46622
DIFF: https://github.com/llvm/llvm-project/commit/add95990508ee0aec90d07bcce1bba47b4f46622.diff

LOG: [Support] Explicitly instantiate BumpPtrAllocatorImpl

Most clients only ever use the default BumpPtrAllocator.

Added: 
    

Modified: 
    llvm/include/llvm/Support/Allocator.h
    llvm/lib/Support/Allocator.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index 670335ffecbc..1d02f1bddb2f 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -434,6 +434,8 @@ class BumpPtrAllocatorImpl
   template <typename T> friend class SpecificBumpPtrAllocator;
 };
 
+extern template class BumpPtrAllocatorImpl<>;
+
 /// The standard BumpPtrAllocator which just uses the default template
 /// parameters.
 typedef BumpPtrAllocatorImpl<> BumpPtrAllocator;

diff  --git a/llvm/lib/Support/Allocator.cpp b/llvm/lib/Support/Allocator.cpp
index 718d3fc0d8e1..f6ba59fc787f 100644
--- a/llvm/lib/Support/Allocator.cpp
+++ b/llvm/lib/Support/Allocator.cpp
@@ -15,6 +15,8 @@
 
 namespace llvm {
 
+template class BumpPtrAllocatorImpl<>;
+
 namespace detail {
 
 void printBumpPtrAllocatorStats(unsigned NumSlabs, size_t BytesAllocated,


        


More information about the llvm-commits mailing list