Skip to content

cgo: cherry-picked commits #341

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 3 commits into from
May 12, 2019
Merged

cgo: cherry-picked commits #341

merged 3 commits into from
May 12, 2019

Conversation

aykevl
Copy link
Member

@aykevl aykevl commented May 10, 2019

Here are a few commits cherry-picked from the softdevice branch. They implement a few missing things in CGo. The refactor commit is also part of #285 and is in general a good cleanup. However, perhaps I could have split out the package move into a separate commit (the refactor itself led to fixing the issue that only one file in a package could contain an import "C" statement).

aykevl added 3 commits May 10, 2019 20:12
These are converted to Go constants where possible.
This doesn't make a lot of sense, but we shouldn't crash on it.
This is a big commit that does a few things:

  * It moves CGo processing into a separate package. It never really
    belonged in the loader package, and certainly not now that the
    loader package may be refactored into a driver package.
  * It adds support for multiple CGo files (files that import package
    "C") in a single package. Previously, this led to multiple
    definition errors in the Go typecheck phase because certain C
    symbols were defined multiple times in all the files. Now it
    generates a new fake AST that defines these, to avoid multiple
    definition errors.
  * It improves debug info in a few edge cases that are probably not
    relevant outside of bugs in cgo itself.
@deadprogram
Copy link
Member

The package move is a really good separation of concerns, and helps me understand a lot better what is happening with the CGo implementation. Likewise with the additional comments that were added as part of the move.

Probably true about the separate commit for the move, but not worth worrying about. There are plenty of other more important commits to work no, so I will merge now.

Great progress!

@deadprogram deadprogram merged commit 11567c6 into dev May 12, 2019
@deadprogram deadprogram deleted the cgo-cherrypick branch May 12, 2019 08:49
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