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][Dialect][NFC] Fix double white spaces in cir.global assembly #1096

Merged
merged 3 commits into from
Nov 11, 2024

Conversation

seven-mile
Copy link
Collaborator

@seven-mile seven-mile commented Nov 10, 2024

Following #1009 and #1028, this PR removes the double white spaces in the assembly format of cir.global op.

It's basically some mlir-tablegen-builtin magic: With constBuilderCall specified, we can apply DefaultValuedAttr with any default value we can construct from constant values. Then we can easily omit the default in assembly. Hence, we don't need to compromise anything for the wrapper attribute cir::VisibilityAttr.

Similarly to #1009, an empty literal `` is used to omit the leading space emitted by inner attribute.

The test case visibility-attribute.c is modified to save the intermediate CIR to disk and reflect the effects.

Double whitespaces in other test files are removed.

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.

Thank you a bunch, this is great!

@bcardosolopes bcardosolopes merged commit e53464f into llvm:main Nov 11, 2024
6 checks passed
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