[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-21 Thread Haojian Wu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rGaf29591650c4: [AST] Reduce the size of TemplateArgumentLocInfo. (authored by hokein). Changed prior to comm

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-21 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. This revision is now accepted and ready to land. Forgot to mention, 3% memory saving is huge, way more than I expected (was mostly just hoping for no regression). Nice work! Comment at: clang/include/clang/AST/Templa

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/include/clang/AST/Expr.h:963 }; +static_assert(llvm::PointerLikeTypeTraits::SpecializationForExpr, + "Specialization in TemplateBase.h must be seen here"); sammccall wrote: > I think this is it: > ```

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 293094. hokein marked 2 inline comments as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87080/new/ https://reviews.llvm.org/D87080 Files: clang/include/

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-21 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clang/include/clang/AST/Expr.h:963 }; +static_assert(llvm::PointerLikeTypeTraits::SpecializationForExpr, + "Specialization in TemplateBase.h must be seen here"); I think this is it: ``` // PointerLikeType

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-20 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/include/clang/AST/TemplateBase.h:421 -public: - constexpr TemplateArgumentLocInfo() : Template({nullptr, nullptr, 0, 0}) {} - - TemplateArgumentLocInfo(TypeSourceInfo *TInfo) : Declarator(TInfo) {} + T *getTemplate() const { +

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > Would it be possible to compile some big file in LLVM (probably doesn't > matter much which, Sema something?) and observe if there's a significant > change in overall ASTContext size? ~3% saving (measuring the `ASTContext::.getASTAllocatedMemory`) | | Bef

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 293029. hokein marked an inline comment as done. hokein added a comment. address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87080/new/ https://reviews.llvm.org/D87080 Files: clang/include/

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Looks good apart from a minor technical issue with the traits. Would it be possible to compile some big file in LLVM (probably doesn't matter much which, Sema something?) and observe if there's a significant change in overall ASTContext size? Comme

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang/include/clang/AST/TemplateBase.h:429 + auto *T = getTemplate(); + T->Ctx->Deallocate(T); +} sammccall wrote: > sammccall wrote: > > this is a no-op, and thus not worth stashing a pointer to Ctx for! >

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 290188. hokein added a comment. format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87080/new/ https://reviews.llvm.org/D87080 Files: clang/include/clang/AST/TemplateBase.h clang/lib/AST/ASTImporter.cpp

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 290187. hokein marked 2 inline comments as done. hokein added a comment. address review comments: - use PointerUnion - keep the TemplateArgumentLocInfo trivial, allocate from allocator, no deallocation. Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Nit on the commit message: I think this is TemplateArgumentLoc 48 -> 32 bytes, and DynTypedNode 56 -> 40 bytes. Comment at: clang/include/clang/AST/TemplateBase.h:415 -public: - constexpr TemplateArgumentLocInfo() : Template({nullptr, nullptr, 0,

[PATCH] D87080: [AST] Reduce the size of TemplateArgumentLocInfo.

2020-09-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added a subscriber: martong. Herald added a reviewer: shafik. Herald added a project: clang. hokein requested review of this revision. heap-allocate the Template kind, this would reduce AST memory usage - TemplateArgumentLoc