Skip to content

[SIL] Fix incorrect handling of 'forwarding' when parsing SIL #38065

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 1 commit into from
Jun 28, 2021

Conversation

mshockwave
Copy link
Contributor

The forwarding directive should be optional for SIL instructions. However, the current SIL parser put it as a requirement when there is a comma follows after the main instruction components, which conflicts with debug info directives (if there is any) like loc or scope. This patch teaches the parser to treat forwarding as an optional directive.

Resolves SR-14814.

@mshockwave
Copy link
Contributor Author

@swift-ci test

@adrian-prantl
Copy link
Contributor

Could you also add a new test case that covers the changes?

@adrian-prantl adrian-prantl self-requested a review June 23, 2021 21:52
Copy link
Contributor

@adrian-prantl adrian-prantl left a comment

Choose a reason for hiding this comment

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

Thanks!

@adrian-prantl
Copy link
Contributor

@swift-ci test

@mshockwave
Copy link
Contributor Author

Could you also add a new test case that covers the changes?

Sorry I forgot about the test. Currently I only add minimum amount of test that just covers SR-14814. Please let me know if I should add tests to cover every affected instruction types.

Also, I though the test should come with the fix so I amend the changes with the original commit instead of making a new one. Please let me know if that's improper

@adrian-prantl
Copy link
Contributor

Could you also add a new test case that covers the changes?

Sorry I forgot about the test. Currently I only add minimum amount of test that just covers SR-14814. Please let me know if I should add tests to cover every affected instruction types.

I think most important is that we have coverage of the line with the if (P.consumeIf(tok::comma) && P.Tok.is(tok::identifier) && P.Tok.getText() == "forwarding") { logic that you changed, so the test looks good to me!

Also, I though the test should come with the fix so I amend the changes with the original commit instead of making a new one. Please let me know if that's improper

When making edits to address review feedback, we usually just amend the commit and git-push -f it, which I think is exactly what you did! Thanks for updating the PR so quickly.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - e23157947e380e50d19c823320c94b70b02f871b

@mshockwave
Copy link
Contributor Author

Make the test case more portable across 64/32-bit platforms.

The `forwarding` directive should be optional for SIL instructions.
However, the current SIL parser put it as a requirement when there is a
comma follows after the main instruction components, which conflicts
with debug info directives like `loc` or `scope`. This patch teaches the
parser to treat `forwarding` as an optional directive.

Resolves SR-14814.
@mshockwave
Copy link
Contributor Author

@swift-ci test

1 similar comment
@adrian-prantl
Copy link
Contributor

@swift-ci test

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