Author: Timm Bäder Date: 2023-10-16T06:52:07+02:00 New Revision: 94d0a3c4a8b43759cb896bbbe8bd38e7e02eb70e
URL: https://github.com/llvm/llvm-project/commit/94d0a3c4a8b43759cb896bbbe8bd38e7e02eb70e DIFF: https://github.com/llvm/llvm-project/commit/94d0a3c4a8b43759cb896bbbe8bd38e7e02eb70e.diff LOG: [clang][Interp][NFC] Add comments to Descriptor ctors I can't tell these apart every time I look at them. Added: Modified: clang/lib/AST/Interp/Descriptor.cpp Removed: ################################################################################ diff --git a/clang/lib/AST/Interp/Descriptor.cpp b/clang/lib/AST/Interp/Descriptor.cpp index 4ecb7466998e705..3990282686fe3d6 100644 --- a/clang/lib/AST/Interp/Descriptor.cpp +++ b/clang/lib/AST/Interp/Descriptor.cpp @@ -221,6 +221,7 @@ static BlockMoveFn getMoveArrayPrim(PrimType Type) { COMPOSITE_TYPE_SWITCH(Type, return moveArrayTy<T>, return nullptr); } +/// Primitives. Descriptor::Descriptor(const DeclTy &D, PrimType Type, MetadataSize MD, bool IsConst, bool IsTemporary, bool IsMutable) : Source(D), ElemSize(primSize(Type)), Size(ElemSize), @@ -231,6 +232,7 @@ Descriptor::Descriptor(const DeclTy &D, PrimType Type, MetadataSize MD, assert(Source && "Missing source"); } +/// Primitive arrays. Descriptor::Descriptor(const DeclTy &D, PrimType Type, MetadataSize MD, size_t NumElems, bool IsConst, bool IsTemporary, bool IsMutable) @@ -243,6 +245,7 @@ Descriptor::Descriptor(const DeclTy &D, PrimType Type, MetadataSize MD, assert(Source && "Missing source"); } +/// Primitive unknown-size arrays. Descriptor::Descriptor(const DeclTy &D, PrimType Type, bool IsTemporary, UnknownSize) : Source(D), ElemSize(primSize(Type)), Size(UnknownSizeMark), MDSize(0), @@ -252,6 +255,7 @@ Descriptor::Descriptor(const DeclTy &D, PrimType Type, bool IsTemporary, assert(Source && "Missing source"); } +/// Arrays of composite elements. Descriptor::Descriptor(const DeclTy &D, Descriptor *Elem, MetadataSize MD, unsigned NumElems, bool IsConst, bool IsTemporary, bool IsMutable) @@ -264,6 +268,7 @@ Descriptor::Descriptor(const DeclTy &D, Descriptor *Elem, MetadataSize MD, assert(Source && "Missing source"); } +/// Unknown-size arrays of composite elements. Descriptor::Descriptor(const DeclTy &D, Descriptor *Elem, bool IsTemporary, UnknownSize) : Source(D), ElemSize(Elem->getAllocSize() + sizeof(InlineDescriptor)), @@ -274,6 +279,7 @@ Descriptor::Descriptor(const DeclTy &D, Descriptor *Elem, bool IsTemporary, assert(Source && "Missing source"); } +/// Composite records. Descriptor::Descriptor(const DeclTy &D, Record *R, MetadataSize MD, bool IsConst, bool IsTemporary, bool IsMutable) : Source(D), ElemSize(std::max<size_t>(alignof(void *), R->getFullSize())), _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits