Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Optional aggressive dead code elimination #186

Open
@neelance

Description

@neelance

Proposal:
A package-level flag in the source code that can only be used in the main package which switches the dead code elimination into "aggressive" mode. In this mode, the reflection can only invoke methods that are also referenced somewhere else in the code. If they are not referenced, the DCE eliminates them at compile time and calling them via reflection will cause a panic properly describing the situation.

This flag is an opt-in feature to produce smaller output. Since it can only be set in the main package, it is the application author's responsibility to make sure that it does not break the program at runtime. The author can always add a dummy reference somewhere to make the DCE include a certain method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions