Skip to content
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

[AST] Bump Type::NumOfBuiltinTypeBits. NFCI. #113559

Closed
wants to merge 1 commit into from

Conversation

jayfoad
Copy link
Contributor

@jayfoad jayfoad commented Oct 24, 2024

BuiltinType::LastKind is currently 507 which is close to the current
limit of 511.

BuiltinType::LastKind is currently 507 which is close to the current
limit of 511.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Oct 24, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 24, 2024

@llvm/pr-subscribers-clang

Author: Jay Foad (jayfoad)

Changes

BuiltinType::LastKind is currently 507 which is close to the current
limit of 511.


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

1 Files Affected:

  • (modified) clang/include/clang/AST/Type.h (+1-1)
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index ba3161c366f4d9..2598a794fe8796 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -1930,7 +1930,7 @@ class alignas(TypeAlignment) Type : public ExtQualsTypeCommonBase {
     unsigned : NumTypeBits;
 
     /// The kind (BuiltinType::Kind) of builtin type this is.
-    static constexpr unsigned NumOfBuiltinTypeBits = 9;
+    static constexpr unsigned NumOfBuiltinTypeBits = 10;
     unsigned Kind : NumOfBuiltinTypeBits;
   };
 

@jayfoad
Copy link
Contributor Author

jayfoad commented Oct 24, 2024

This is mostly so that we don't need to carry this change downstream, while we have downstream patches that add a few builtin types. It seems inevitable that it will need to be changed upstream pretty soon anyway.

Copy link
Collaborator

@AaronBallman AaronBallman left a comment

Choose a reason for hiding this comment

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

The community doesn't add new builtin types particularly often, so having four leftover bits isn't actually that close to the limit for us. Is there a problem with keeping this change downstream until we get to the limit in community?

@jayfoad
Copy link
Contributor Author

jayfoad commented Oct 30, 2024

The community doesn't add new builtin types particularly often, so having four leftover bits isn't actually that close to the limit for us.

I guess "close" is subjective.

Is there a problem with keeping this change downstream until we get to the limit in community?

No, I was just trying to separate out some changes that seemed upstreamable.

@jayfoad jayfoad closed this Oct 30, 2024
@AaronBallman
Copy link
Collaborator

The community doesn't add new builtin types particularly often, so having four leftover bits isn't actually that close to the limit for us.

I guess "close" is subjective.

Is there a problem with keeping this change downstream until we get to the limit in community?

No, I was just trying to separate out some changes that seemed upstreamable.

Ah! I appreciate the effort, but yeah, this one may cause more questions like "why are we using 10 bits when we only need 9?" while folks review code. Otherwise, it is harmless (it doesn't seem to increase the size of anything, so it's not adding extra memory pressure anywhere).

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.

3 participants