[clang] Don't redundantly specify the default template argument to `BumpPtrAllocatorImpl` (PR #114857)

Richard Smith via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 4 11:30:02 PST 2024


https://github.com/zygoloid created https://github.com/llvm/llvm-project/pull/114857

None

>From 25047a9f9b8b961451bef0d0c526944d17ffe9d7 Mon Sep 17 00:00:00 2001
From: Richard Smith <richard at metafoo.co.uk>
Date: Mon, 4 Nov 2024 11:27:46 -0800
Subject: [PATCH 1/2] Don't redundantly specify the default template argument
 to `BumpPtrAllocatorImpl`

---
 clang/lib/AST/ByteCode/Program.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/AST/ByteCode/Program.h b/clang/lib/AST/ByteCode/Program.h
index 9aabe67b550ec7..c9c3d20f198c6e 100644
--- a/clang/lib/AST/ByteCode/Program.h
+++ b/clang/lib/AST/ByteCode/Program.h
@@ -171,7 +171,7 @@ class Program final {
   llvm::DenseMap<const void *, unsigned> NativePointerIndices;
 
   /// Custom allocator for global storage.
-  using PoolAllocTy = llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator>;
+  using PoolAllocTy = llvm::BumpPtrAllocator;
 
   /// Descriptor + storage for a global object.
   ///

>From 3620093eefee02bfa7c59bebdc52dd8807c4d6dc Mon Sep 17 00:00:00 2001
From: Richard Smith <richard at metafoo.co.uk>
Date: Mon, 4 Nov 2024 11:28:40 -0800
Subject: [PATCH 2/2] Don't redundantly specify the default template argument
 to `BumpPtrAllocatorImpl`

---
 clang/lib/AST/ByteCode/DynamicAllocator.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/clang/lib/AST/ByteCode/DynamicAllocator.h b/clang/lib/AST/ByteCode/DynamicAllocator.h
index 1ed5dc843e4c8c..51829403d73228 100644
--- a/clang/lib/AST/ByteCode/DynamicAllocator.h
+++ b/clang/lib/AST/ByteCode/DynamicAllocator.h
@@ -97,7 +97,7 @@ class DynamicAllocator final {
 private:
   llvm::DenseMap<const Expr *, AllocationSite> AllocationSites;
 
-  using PoolAllocTy = llvm::BumpPtrAllocatorImpl<llvm::MallocAllocator>;
+  using PoolAllocTy = llvm::BumpPtrAllocator;
   PoolAllocTy DescAllocator;
 
   /// Allocates a new descriptor.



More information about the cfe-commits mailing list