[clang] Improve stack usage to increase recursive initialization depth (PR #88546)

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 16 04:54:43 PDT 2024


================
@@ -1070,57 +1077,24 @@ class Sema;
     };
 
   private:
-    SmallVector<OverloadCandidate, 16> Candidates;
-    llvm::SmallPtrSet<uintptr_t, 16> Functions;
-
-    // Allocator for ConversionSequenceLists. We store the first few of these
-    // inline to avoid allocation for small sets.
-    llvm::BumpPtrAllocator SlabAllocator;
+    ASTContext &Ctx;
+    SmallVector<OverloadCandidate, 4> Candidates;
+    llvm::SmallPtrSet<uintptr_t, 4> Functions;
----------------
AaronBallman wrote:

The reason it works to drop the `llvm::` prefix for `SmallVector` is because we do this: https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Basic/LLVM.h

`SmallPtrSet` is not included in there which is why the prefix is necessary, and I'm not certain it's worth including it or not.

Thoughts?

https://github.com/llvm/llvm-project/pull/88546


More information about the cfe-commits mailing list