Skip to content

Commit fa12b14

Browse files
committed
Remove extra dotc -decompile settings
1 parent fc49e86 commit fa12b14

File tree

3 files changed

+2
-24
lines changed

3 files changed

+2
-24
lines changed

compiler/src/dotty/tools/dotc/config/ScalaSettings.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,6 @@ class ScalaSettings extends Settings.SettingGroup {
9696
val YnoPatmatOpt = BooleanSetting("-Yno-patmat-opt", "disable all pattern matching optimizations.")
9797
val YplainPrinter = BooleanSetting("-Yplain-printer", "Pretty-print using a plain printer.")
9898
val YprintSyms = BooleanSetting("-Yprint-syms", "when printing trees print info in symbols instead of corresponding info in trees.")
99-
val YprintNoPrivate = BooleanSetting("-Yprint-no-private", "when printing trees print do not print private/protected members.")
10099
val YprintDebug = BooleanSetting("-Yprint-debug", "when printing trees, print some extra information useful for debugging.")
101100
val YtestPickler = BooleanSetting("-Ytest-pickler", "self-test for pickling functionality; should be used with -Ystop-after:pickler")
102101
val YcheckReentrant = BooleanSetting("-Ycheck-reentrant", "check that compiled program does not contain vars that can be accessed from a global root.")

compiler/src/dotty/tools/dotc/decompiler/Main.scala

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,7 @@ object Main extends dotc.Driver {
1515

1616
override def setup(args0: Array[String], rootCtx: Context): (List[String], Context) = {
1717
var args = args0.filter(a => a != "-decompile")
18-
args = if (args.contains("-tasty")) args else args :+ "-tasty"
19-
args = if (args.exists(a => a == "-private" || a == "-p")) args.filter(a => a != "-private" && a != "-p") else args :+ "-Yprint-no-private"
20-
args = if (args.exists(a => a == "-code" || a == "-c")) args.filter(a => a != "-code" && a != "-c") else args :+ "-Yprint-syms"
21-
22-
if (args.contains("-help")) {
23-
printHelp()
24-
sys.exit(0)
25-
} else super.setup(args, rootCtx)
26-
}
27-
28-
private def printHelp(): Unit = {
29-
val msg =
30-
"""dotc -decompiler <option|class>*
31-
|
32-
|options:
33-
| -private | -p Print private and protected members
34-
| -code | -c Print implementations (code disassembly)
35-
| -classpath <path> Classpath where to find the classes
36-
| -help Print this message
37-
""".stripMargin
38-
println(msg)
18+
args = if (args.contains("-tasty")) args else "-tasty" +: args
19+
super.setup(args, rootCtx)
3920
}
4021
}

compiler/src/dotty/tools/dotc/printing/RefinedPrinter.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,6 @@ class RefinedPrinter(_ctx: Context) extends PlainPrinter(_ctx) {
318318
case _ => false
319319
}
320320
params ::: rest
321-
} else if (ctx.settings.YprintNoPrivate.value) {
322-
impl.body.filter(t => !t.symbol.isPrivate && !t.symbol.is(Protected))
323321
} else impl.body
324322

325323
val bodyText = "{" ~~ selfText ~~ toTextGlobal(primaryConstrs ::: body, "\n") ~ "}"

0 commit comments

Comments
 (0)