Skip to content

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

Merged
merged 2 commits into from
Nov 6, 2019
Merged

Adds -Xprint-phases #7508

merged 2 commits into from
Nov 6, 2019

Conversation

martijnhoekstra
Copy link
Contributor

makes -Xprint-phases prints phases as in Compiler.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.

Copy link
Member

@dottybot dottybot left a 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! ☀️

@martijnhoekstra
Copy link
Contributor Author

@@ -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")
Copy link
Member

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:

Suggested change
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
Copy link
Member

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 => ... }

@odersky odersky merged commit 3128591 into scala:master Nov 6, 2019
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.

4 participants