[clang] [Clang][AST][NFC] Store template parameter position for TemplateTypeParmType in TypeBit (PR #102481)
Matheus Izvekov via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 8 12:00:53 PDT 2024
================
@@ -6131,52 +6149,30 @@ class BTFTagAttributedType : public Type, public llvm::FoldingSetNode {
class TemplateTypeParmType : public Type, public llvm::FoldingSetNode {
friend class ASTContext; // ASTContext creates these
- // Helper data collector for canonical types.
- struct CanonicalTTPTInfo {
- unsigned Depth : 15;
- unsigned ParameterPack : 1;
- unsigned Index : 16;
- };
-
- union {
- // Info for the canonical type.
- CanonicalTTPTInfo CanTTPTInfo;
-
- // Info for the non-canonical type.
- TemplateTypeParmDecl *TTPDecl;
- };
+ // The associated TemplateTypeParmDecl for the non-canonical type.
+ TemplateTypeParmDecl *TTPDecl;
----------------
mizvekov wrote:
By the way, you could tail allocate this instead now. It will save some memory on the canonical types.
https://github.com/llvm/llvm-project/pull/102481
More information about the cfe-commits
mailing list