-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Adds -Xprint-phases #7508
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
Adds -Xprint-phases #7508
Conversation
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.
Hello, and thank you for opening this PR! 🎉
All contributors have signed the CLA, thank you! ❤️
Have an awesome day! ☀️
contribution per https://gitter.im/lampepfl/dotty?at=5dc1a7c3a03ae1584f720b9d |
@@ -76,7 +76,8 @@ class ScalaSettings extends Settings.SettingGroup { | |||
val XprintTypes: Setting[Boolean] = BooleanSetting("-Xprint-types", "Print tree types (debugging option).") | |||
val XprintDiff: Setting[Boolean] = BooleanSetting("-Xprint-diff", "Print changed parts of the tree since last print.") | |||
val XprintDiffDel: Setting[Boolean] = BooleanSetting("-Xprint-diff-del", "Print changed parts of the tree since last print including deleted parts.") | |||
val XprintInline: Setting[Boolean] = BooleanSetting("-Xprint-inline", "Show where inlined code comes from") | |||
val XprintInline: Setting[Boolean] = BooleanSetting("-Xprint-inline", "Show where inlined code comes from") | |||
val XshowPhases: Setting[Boolean] = BooleanSetting("-Xprint-phases", "Print all compiler phases") |
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.
It's called -Xshow-phases
in scalac so we might as well keep the same name:
val XshowPhases: Setting[Boolean] = BooleanSetting("-Xprint-phases", "Print all compiler phases") | |
val XshowPhases: Setting[Boolean] = BooleanSetting("-Xshow-phases", "Print all compiler phases") |
|
||
def phasesMessage: String = { | ||
(new Compiler()).phases.map(phasegroup => { | ||
if(phasegroup.length == 1) phasegroup.head.phaseName |
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.
Do a pattern match instead ? { case List(phase) => phase.phaseName; case phases => ... }
makes
-Xprint-phases
prints phases as inCompiler.scala
Also, I snuck in
-X
and-Y
in the main options list, as I thought that was useful but not worth a full PR, but I'm happy to revert that.