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

ir: Add Parent field to Func for its parent module #87

Merged
merged 3 commits into from
Jun 8, 2019
Merged

Conversation

mewmew
Copy link
Member

@mewmew mewmew commented Jun 5, 2019

This is to be consistent with ir.Block which already contains a Parent field for its parent function, and to enable further use cases of the IR API (for background, see #86 (comment)).

cc: @pwaller and @justinclift

@coveralls
Copy link

coveralls commented Jun 5, 2019

Coverage Status

Coverage increased (+0.003%) to 67.776% when pulling cb6620c on parent into a687e6f on master.

@pwaller
Copy link
Member

pwaller commented Jun 5, 2019

Oh dear, CI is unhappy.

@mewmew
Copy link
Member Author

mewmew commented Jun 6, 2019

Oh dear, CI is unhappy.

Ah, that is to be expected. Since on of the examples (which is also run by go test) pretty-prints the IR structure, and we just added a new field to ir.Func.

Edit: the example test case has now been updated. Also, this helped us uncover that the asm parser did not instantiate the Parent field when creating new ir.Funcs, since it was not using ir.Module.NewFunc as constructor (but rather creating a struct literal). This has been fixed in cb6620c.

@mewmew
Copy link
Member Author

mewmew commented Jun 8, 2019

The CI for Go 1.11 now completes successfully. For Go tip, we get the following error:

The command "go get -u github.com/golangci/golangci-lint/cmd/golangci-lint" failed and exited with 1 during .

Edit: I tried to reproduce this locally but the go get -u github.com/golangci/golangci-lint/cmd/golangci-lint command completed successfully for me using both Go 1.13 and gotip (at rev golang/go@13f179b).

@mewmew
Copy link
Member Author

mewmew commented Jun 8, 2019

Since the PR is rather non-invasive and the CI for Go 1.11 is happy, I'll go ahead and merge this.

@mewmew mewmew merged commit c5c443d into master Jun 8, 2019
@mewmew mewmew deleted the parent branch June 30, 2019 18:17
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