-
-
Notifications
You must be signed in to change notification settings - Fork 418
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
Add basic compiler plugins #2566
Conversation
be986e1
to
a16c285
Compare
This change adds a framework for compiler plugins. Plugins are specified through the new `--plugin` command line option and can observe the compiler data structures at various stages of the compilation process. Only read-only plugins are supported. An example of this functionality is a plugin that reports detailed metrics about the compilation process.
a16c285
to
37ba1cf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, and is a cool feature.
Out of curiosity, what utility do you have in mind for a read-only plugin?
Is it planned to support plugins that mutate in the future?
@jemc The initial motivation for this feature was that I wanted to add more compilation information to the I personally haven't thought about use cases for mutating plugins, but if somebody comes up with use cases in the future it should be possible to support this kind of plugins. |
That is super nice work. I think the docgen pass could be implemented as a read only plugin and thus benefit from all stages of the compilation process for gathering information. |
This change adds a framework for compiler plugins. Plugins are specified through the new `--plugin` command line option and can observe the compiler data structures at various stages of the compilation process. Only read-only plugins are supported. An example of this functionality is a plugin that reports detailed metrics about the compilation process.
This change adds a framework for compiler plugins. Plugins are specified through the new
--plugin
command line option and can observe the compiler data structures at various stages of the compilation process. Only read-only plugins are supported.An example of this functionality is a plugin that reports detailed metrics about the compilation process.