Skip to content

Tweak -Xprint output #13268

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 1 commit into from
Aug 17, 2021
Merged

Tweak -Xprint output #13268

merged 1 commit into from
Aug 17, 2021

Conversation

dwijnand
Copy link
Member

@dwijnand dwijnand commented Aug 7, 2021

Most importantly, move "unchanged since $phase" to be on the same line
as the lead-in. And then I copied over the lead-in from Scala 2,
because I like it. It doesn't look as nice because MegaPhases don't
have their own trim name, but it starts nicely:

[[syntax trees at end of                     typer]] // a.scala
package <empty> {
  class C() extends Object() {
    def foo: Int = 1
  }
}

[[syntax trees at end of          inlinedPositions]] // a.scala: unchanged since typer
[[syntax trees at end of                 posttyper]] // a.scala
package <empty> {
  @scala.annotation.internal.SourceFile("a.scala") class C() extends Object() {
    def foo: Int = 1
  }
}

[[syntax trees at end of                   pickler]] // a.scala: unchanged since posttyper
[[syntax trees at end of                  inlining]] // a.scala: unchanged since posttyper
[[syntax trees at end of              postInlining]] // a.scala: unchanged since posttyper
[[syntax trees at end of                   staging]] // a.scala: unchanged since posttyper
[[syntax trees at end of              pickleQuotes]] // a.scala: unchanged since posttyper
[[syntax trees at end of MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments, checkStatic, betaReduce, inlineVals, expandSAMs}]] // a.scala: unchanged since posttyper
[[syntax trees at end of MegaPhase{elimRepeated, protectedAccessors, extmethods, uncacheGivenAliases, byNameClosures, hoistSuperArgs, specializeApplyMethods, refchecks, tryCatchPatterns, patternMatcher}]] // a.scala: unchanged since posttyper
[[syntax trees at end of MegaPhase{elimOpaque, explicitOuter, explicitSelf, elimByName, stringInterpolatorOpt}]] // a.scala: unchanged since posttyper
[[syntax trees at end of MegaPhase{pruneErasedDefs, uninitializedDefs, inlinePatterns, vcInlineMethods, seqLiterals, intercepted, getters, specializeFunctions, liftTry, collectNullableFields, elimOuterSelect, resolveSuper, functionXXLForwarders, paramForwarding, genericTuples, letOverApply, arrayConstructors}]] // a.scala: unchanged since posttyper

@dwijnand dwijnand force-pushed the tweak-Xprint-output branch 2 times, most recently from d5736ec to 9da4942 Compare August 7, 2021 18:19
@dwijnand dwijnand marked this pull request as ready for review August 7, 2021 19:33
@dwijnand dwijnand requested a review from nicolasstucki August 17, 2021 14:02
Copy link
Contributor

@nicolasstucki nicolasstucki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise LGTM

Most importantly, move "unchanged since $phase" to be on the same line
as the lead-in.  And then I copied over the lead-in from Scala 2,
because I like it.  It doesn't look as nice because MegaPhases don't
have their own trim name, but it starts nicely:

    [[syntax trees at end of                     typer]] // a.scala
    package <empty> {
      class C() extends Object() {
        def foo: Int = 1
      }
    }

    [[syntax trees at end of          inlinedPositions]] // a.scala: unchanged since typer
    [[syntax trees at end of                 posttyper]] // a.scala
    package <empty> {
      @scala.annotation.internal.SourceFile("a.scala") class C() extends Object() {
        def foo: Int = 1
      }
    }

    [[syntax trees at end of                   pickler]] // a.scala: unchanged since posttyper
    [[syntax trees at end of                  inlining]] // a.scala: unchanged since posttyper
    [[syntax trees at end of              postInlining]] // a.scala: unchanged since posttyper
    [[syntax trees at end of                   staging]] // a.scala: unchanged since posttyper
    [[syntax trees at end of              pickleQuotes]] // a.scala: unchanged since posttyper
    [[syntax trees at end of MegaPhase{firstTransform, checkReentrant, elimPackagePrefixes, cookComments, checkStatic, betaReduce, inlineVals, expandSAMs}]] // a.scala: unchanged since posttyper
    [[syntax trees at end of MegaPhase{elimRepeated, protectedAccessors, extmethods, uncacheGivenAliases, byNameClosures, hoistSuperArgs, specializeApplyMethods, refchecks, tryCatchPatterns, patternMatcher}]] // a.scala: unchanged since posttyper
    [[syntax trees at end of MegaPhase{elimOpaque, explicitOuter, explicitSelf, elimByName, stringInterpolatorOpt}]] // a.scala: unchanged since posttyper
    [[syntax trees at end of MegaPhase{pruneErasedDefs, uninitializedDefs, inlinePatterns, vcInlineMethods, seqLiterals, intercepted, getters, specializeFunctions, liftTry, collectNullableFields, elimOuterSelect, resolveSuper, functionXXLForwarders, paramForwarding, genericTuples, letOverApply, arrayConstructors}]] // a.scala: unchanged since posttyper
@dwijnand dwijnand force-pushed the tweak-Xprint-output branch from 9da4942 to 5c10120 Compare August 17, 2021 14:27
@dwijnand dwijnand enabled auto-merge August 17, 2021 14:27
@dwijnand dwijnand merged commit f27c250 into scala:master Aug 17, 2021
@dwijnand dwijnand deleted the tweak-Xprint-output branch August 19, 2021 08:06
@Kordyjan Kordyjan added this to the 3.1.0 milestone Aug 2, 2023
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.

3 participants