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

Emit lambdas as linkonce_odr, including contained globals #3650

Merged
merged 3 commits into from
Feb 9, 2021

Conversation

kinke
Copy link
Member

@kinke kinke commented Jan 31, 2021

As they are emitted into each referencing object file anyway.
Handling the globals resolves issue #3648.

I think this also solves issue #2968 - in the presumably rare event that you absolutely don't want to emit a function into its owning CU and only into each referencing CU, an enum-lambda can be used as shown in the testcase.
With pragma(inline, true), it'll most likely be actually inlined and not make it to the object files.

kinke added 3 commits February 7, 2021 02:23
As they are emitted into each referencing object file anyway.
Handling the globals resolves issue ldc-developers#3648.

I think this also solves issue ldc-developers#2968 - in the presumably rare event
that you absolutely don't want to emit a function into its owning
CU and only into each referencing CU, an enum-lambda can be used as
shown in the testcase.
With `pragma(inline, true)`, it'll most likely be actually inlined
and not make it to the object files.
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.

1 participant