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

Don't emit synthesized attributes on closure methods #41235

Open
RikkiGibson opened this issue Jan 27, 2020 · 1 comment
Open

Don't emit synthesized attributes on closure methods #41235

RikkiGibson opened this issue Jan 27, 2020 · 1 comment
Labels
Area-Compilers Code Gen Quality Room for improvement in the quality of the compiler's generated code

Comments

@RikkiGibson
Copy link
Contributor

Follow up to #39226 (comment)

Consider a few lambdas and local functions like the following:

  • (Action<dynamic>)(dynamic d) => ...
  • void local1(in string s) { ... }
  • void local1(params int[] arr) { ... }

For methods like these we synthesize InAttribute, DynamicAttribute, ParamArrayAttribute, etc. so that we can recognize these C# language concepts when we read the methods back in from metadata. But it may not be necessary to do this for local functions or lambdas. There could be a modest size improvement if we stopped emitting these attributes.

This could negatively affect ILSpy's ability to decompile the closures, but this isn't typically something that's extremely important to us.

/cc @jaredpar

@RikkiGibson RikkiGibson added Area-Compilers Code Gen Quality Room for improvement in the quality of the compiler's generated code labels Jan 27, 2020
@tmat
Copy link
Member

tmat commented Jan 27, 2020

The debugger needs these attributes when compiling expressions in EEs, no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers Code Gen Quality Room for improvement in the quality of the compiler's generated code
Projects
None yet
Development

No branches or pull requests

2 participants