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

[CIR][CIRGen] Refactor StructType builders #294

Merged

Conversation

sitio-couto
Copy link
Collaborator

Instead of using a single builder for every possible StructType, we now have three builders: identified complete, identified incomplete, and anonymous struct types. This allows us to enforce correctness and to explicitly show the intent when creating a StructType.

Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

Great, thanks! Comments inline

clang/test/CIR/CodeGen/vtable-rtti.cpp Show resolved Hide resolved
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
@sitio-couto sitio-couto force-pushed the vinicius/refactor-struct-type-builders branch from fb7508b to fb2026d Compare November 1, 2023 19:59
Copy link
Member

@bcardosolopes bcardosolopes left a comment

Choose a reason for hiding this comment

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

LGTM with one minor addition: add some doc bits to tablegen about how structs can be seen in the wild. E.g. it might not be obvious why anonymous structs must be complete. You can pick adding to this PR, or creating a new one.

@sitio-couto
Copy link
Collaborator Author

LGTM with one minor addition: add some doc bits to tablegen about how structs can be seen in the wild. E.g. it might not be obvious why anonymous structs must be complete. You can pick adding to this PR, or creating a new one.

I'm going to avoid this for now because one of the follow-up PRs moves the tablegen definition to pure C++. This is required because mutable types are not yet supported in tablegen.

@sitio-couto sitio-couto changed the title [CIR][CIRGen][NFC] Refactor StructType builders [CIR][CIRGen] Refactor StructType builders Nov 1, 2023
@sitio-couto sitio-couto merged commit 6d98e8c into llvm:main Nov 1, 2023
1 check passed
@sitio-couto sitio-couto deleted the vinicius/refactor-struct-type-builders branch November 14, 2023 11:55
lanza pushed a commit that referenced this pull request Dec 20, 2023
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
lanza pushed a commit that referenced this pull request Jan 29, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
lanza pushed a commit that referenced this pull request Mar 23, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Mar 24, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
lanza pushed a commit that referenced this pull request Apr 29, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
lanza pushed a commit that referenced this pull request Apr 29, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
eZWALT pushed a commit to eZWALT/clangir that referenced this pull request Apr 29, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
lanza pushed a commit that referenced this pull request Apr 29, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
bruteforceboy pushed a commit to bruteforceboy/clangir that referenced this pull request Oct 2, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
lanza pushed a commit that referenced this pull request Nov 5, 2024
Instead of using a single builder for every possible StructType, we now
have three builders: identified complete, identified incomplete, and
anonymous struct types. This allows us to enforce correctness and to
explicitly show the intent when creating a StructType.

This patch also adds support for anonymous structs type aliases. When a
StructType has no name, it will generate a `ty_anon_<kind>` alias.
Conflicts are automatically resolved by MLIR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants