Skip to content

[NFC] Reduce size of FunctionEffect to 1 byte. #100753

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 26, 2024

Conversation

dougsonos
Copy link
Contributor

As a preliminary to PR #99656 , reduce the size of FunctionEffect to 1 byte.

@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jul 26, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 26, 2024

@llvm/pr-subscribers-clang

Author: Doug Wyatt (dougsonos)

Changes

As a preliminary to PR #99656 , reduce the size of FunctionEffect to 1 byte.


Full diff: https://github.com/llvm/llvm-project/pull/100753.diff

1 Files Affected:

  • (modified) clang/include/clang/AST/Type.h (+3-3)
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index 25defea58c2dc..cb345c3028909 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -4699,16 +4699,16 @@ class FunctionEffect {
 
 private:
   LLVM_PREFERRED_TYPE(Kind)
-  unsigned FKind : 3;
+  uint8_t FKind : 3;
 
   // Expansion: for hypothetical TCB+types, there could be one Kind for TCB,
   // then ~16(?) bits "SubKind" to map to a specific named TCB. SubKind would
   // be considered for uniqueness.
 
 public:
-  FunctionEffect() : FKind(unsigned(Kind::None)) {}
+  FunctionEffect() : FKind(uint8_t(Kind::None)) {}
 
-  explicit FunctionEffect(Kind K) : FKind(unsigned(K)) {}
+  explicit FunctionEffect(Kind K) : FKind(uint8_t(K)) {}
 
   /// The kind of the effect.
   Kind kind() const { return Kind(FKind); }

@cor3ntin cor3ntin requested a review from AaronBallman July 26, 2024 14:44
Copy link
Member

@Sirraide Sirraide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Sirraide Sirraide merged commit 6ac0cf9 into llvm:main Jul 26, 2024
7 checks passed
dougsonos pushed a commit to dougsonos/llvm-project that referenced this pull request Aug 2, 2024
Make FunctionEffect just have a Kind instead of a bitfield

(from PR llvm#100753)
cjappl pushed a commit to cjappl/llvm-project that referenced this pull request Aug 27, 2024
Make FunctionEffect just have a Kind instead of a bitfield

(from PR llvm#100753)
cjappl pushed a commit to cjappl/llvm-project that referenced this pull request Aug 27, 2024
Make FunctionEffect just have a Kind instead of a bitfield

(from PR llvm#100753)
jroelofs pushed a commit to swiftlang/llvm-project that referenced this pull request Oct 17, 2024
As a preliminary to PR llvm#99656 ,
reduce the size of `FunctionEffect` to 1 byte.

---------

Co-authored-by: Doug Wyatt <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants