| commit | 702e228249906d43687952d9a2f3d2f90d8024c6 | [log] [tgz] |
|---|---|---|
| author | Haojian Wu <hokein.wu@gmail.com> | Thu Jun 05 15:14:25 2025 +0200 |
| committer | GitHub <noreply@github.com> | Thu Jun 05 15:14:25 2025 +0200 |
| tree | 49b5681c549789011155b9a20403f71421ab6792 | |
| parent | 754f2caa5c5fb3675b1972eafeae78679831b644 [diff] |
[clang] Reduce LateInstantiatedAttrVec vector default size. (#142840) This increases clang's template instantiation depths. I can see 7% increase (1510 -> 1612 on my local machine) for the `clang/test/SemaTemplate/instantiation-depth-default.cpp` case. No performance regressions have been observed: https://llvm-compile-time-tracker.com/compare.php?from=5f8cf33650c0c71119ecf81f07014329d9466d0d&to=05c2403b0f784325f5b88760ef43a15b6aaf4181&stat=instructions:u
diff --git a/clang/include/clang/Sema/Sema.h b/clang/include/clang/Sema/Sema.h index 65c84c0..f9a086b 100644 --- a/clang/include/clang/Sema/Sema.h +++ b/clang/include/clang/Sema/Sema.h
@@ -14031,7 +14031,7 @@ Decl *D) : TmplAttr(A), Scope(S), NewDecl(D) {} }; - typedef SmallVector<LateInstantiatedAttribute, 16> LateInstantiatedAttrVec; + typedef SmallVector<LateInstantiatedAttribute, 1> LateInstantiatedAttrVec; void InstantiateAttrs(const MultiLevelTemplateArgumentList &TemplateArgs, const Decl *Pattern, Decl *Inst,