[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll closed https://github.com/llvm/llvm-project/pull/70296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM! https://github.com/llvm/llvm-project/pull/70296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -1663,11 +1663,12 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// Actually an ArrayType::ArraySizeModifier. unsigned SizeModifier : 3; }; + enum { NumArrayTypeBits = NumTypeBits + 3 + 3 }; Endilll wrote: Applied. http

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -1739,10 +1734,8 @@ class DeclContext { uint64_t IsSimpleExplicit : 1; }; - /// Number of non-inherited bits in CXXConstructorDeclBitfields. - enum { -NumCXXConstructorDeclBits = 64 - NumDeclContextBits - NumFunctionDeclBits - }; + /// Number of inherited and

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
@@ -1819,10 +1812,10 @@ class DeclContext { SourceLocation AtStart; }; - /// Number of non-inherited bits in ObjCContainerDeclBitfields. + /// Number of inherited and non-inherited bits in ObjCContainerDeclBitfields. /// Note that here we rely on the fact that Sourc

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll updated https://github.com/llvm/llvm-project/pull/70296 >From 9a20b9609c5d4c18772907e82af4995411c42da6 Mon Sep 17 00:00:00 2001 From: Vlad Serebrennikov Date: Thu, 26 Oct 2023 09:04:22 +0300 Subject: [PATCH 1/2] [clang][NFC] Refactor enums that hold size of Type and

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Aaron Ballman via cfe-commits
@@ -1819,10 +1812,10 @@ class DeclContext { SourceLocation AtStart; }; - /// Number of non-inherited bits in ObjCContainerDeclBitfields. + /// Number of inherited and non-inherited bits in ObjCContainerDeclBitfields. /// Note that here we rely on the fact that Sourc

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Aaron Ballman via cfe-commits
@@ -1663,11 +1663,12 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase { /// Actually an ArrayType::ArraySizeModifier. unsigned SizeModifier : 3; }; + enum { NumArrayTypeBits = NumTypeBits + 3 + 3 }; AaronBallman wrote: ```sugges

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Aaron Ballman via cfe-commits
@@ -1739,10 +1734,8 @@ class DeclContext { uint64_t IsSimpleExplicit : 1; }; - /// Number of non-inherited bits in CXXConstructorDeclBitfields. - enum { -NumCXXConstructorDeclBits = 64 - NumDeclContextBits - NumFunctionDeclBits - }; + /// Number of inherited and

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman approved this pull request. LGTM though I have some NFC suggestions you can take or leave. https://github.com/llvm/llvm-project/pull/70296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Aaron Ballman via cfe-commits
https://github.com/AaronBallman edited https://github.com/llvm/llvm-project/pull/70296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-26 Thread Chuanqi Xu via cfe-commits
https://github.com/ChuanqiXu9 approved this pull request. LGTM. Consistency is good. https://github.com/llvm/llvm-project/pull/70296 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-25 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-modules Author: Vlad Serebrennikov (Endilll) Changes This patch refactor said enums to hold total size of a bit-field, and not just non-inherited bits. This brings `Type` and `DeclContext` in line with `Comment` and `Stmt`. It also makes it unnec

[clang] [clang][NFC] Refactor enums that hold size of `Type` and `DeclContext` bit-fields (PR #70296)

2023-10-25 Thread Vlad Serebrennikov via cfe-commits
https://github.com/Endilll created https://github.com/llvm/llvm-project/pull/70296 This patch refactor said enums to hold total size of a bit-field, and not just non-inherited bits. This brings `Type` and `DeclContext` in line with `Comment` and `Stmt`. It also makes it unnecessary to list all