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][IR] Fix parsing of dsolocal in cir.func #732

Merged
merged 2 commits into from
Jul 12, 2024
Merged

Conversation

ghehg
Copy link
Collaborator

@ghehg ghehg commented Jul 12, 2024

as title. document will be in another PR as it seems to be a different upstream branch

@ghehg ghehg changed the title add missing parser code for FuncOP attribute dsolocal [CIR][IR]add missing parser code for FuncOP attribute dsolocal Jul 12, 2024
Copy link
Member

@Lancern Lancern left a comment

Choose a reason for hiding this comment

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

Looks like parse and print does not fully match. See the inline comment.

@@ -1935,6 +1936,8 @@ ParseResult cir::FuncOp::parse(OpAsmParser &parser, OperationState &state) {
state.addAttribute(lambdaNameAttr, parser.getBuilder().getUnitAttr());
if (parser.parseOptionalKeyword(noProtoNameAttr).succeeded())
state.addAttribute(noProtoNameAttr, parser.getBuilder().getUnitAttr());
if (parser.parseOptionalKeyword(dsolocalNameAttr).succeeded())
state.addAttribute(dsolocalNameAttr, parser.getBuilder().getUnitAttr());
Copy link
Member

@Lancern Lancern Jul 12, 2024

Choose a reason for hiding this comment

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

According to FuncOp::print, I believe dsolocal should rather come after the visibility attribute? See in FuncOp::print:

if (getNoProto())
p << "no_proto ";
if (getLinkage() != GlobalLinkageKind::ExternalLinkage)
p << stringifyGlobalLinkageKind(getLinkage()) << ' ';
auto vis = getVisibility();
if (vis != mlir::SymbolTable::Visibility::Public)
p << vis << " ";
if (getDsolocal())
p << "dsolocal ";

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! good catch! fixed in the next commit

Copy link
Member

@Lancern Lancern left a comment

Choose a reason for hiding this comment

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

LGTM!

@bcardosolopes bcardosolopes changed the title [CIR][IR]add missing parser code for FuncOP attribute dsolocal [CIR][IR] Fix parsing of dsolocal in cir.func Jul 12, 2024
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

@bcardosolopes bcardosolopes merged commit 96b0628 into llvm:main Jul 12, 2024
6 checks passed
Hugobros3 pushed a commit to shady-gang/clangir that referenced this pull request Oct 2, 2024
as title. document will be in another PR as it seems to be a different
upstream branch
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
as title. document will be in another PR as it seems to be a different
upstream branch
smeenai pushed a commit to smeenai/clangir that referenced this pull request Oct 9, 2024
as title. document will be in another PR as it seems to be a different
upstream branch
keryell pushed a commit to keryell/clangir that referenced this pull request Oct 19, 2024
as title. document will be in another PR as it seems to be a different
upstream branch
lanza pushed a commit that referenced this pull request Nov 5, 2024
as title. document will be in another PR as it seems to be a different
upstream branch
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.

3 participants