Skip to content

Commit cefc22f

Browse files
committed
address feedback: ctx.settings
1 parent 64c62ef commit cefc22f

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

src/dotty/tools/dotc/backend/jvm/BCodeHelpers.scala

+4-4
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
388388

389389
trait BCInnerClassGen extends HasContext {
390390

391-
def debugLevel = ctx.base.settings.g.indexOfChoice
391+
def debugLevel = ctx.settings.g.indexOfChoice
392392

393393
val emitSource = debugLevel >= 1
394394
val emitLines = debugLevel >= 2
@@ -790,7 +790,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
790790
// without it. This is particularly bad because the availability of
791791
// generic information could disappear as a consequence of a seemingly
792792
// unrelated change.
793-
ctx.base.settings.Ynogenericsig
793+
ctx.settings.Ynogenericsig
794794
|| sym.isArtifact
795795
|| sym.isLiftedMethod
796796
|| sym.isBridge
@@ -822,7 +822,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
822822
catch { case _: Throwable => false }
823823
}
824824

825-
if (ctx.base.settings.Xverify) {
825+
if (ctx.settings.Xverify) {
826826
// Run the signature parser to catch bogus signatures.
827827
val isValidSignature = wrap {
828828
// Alternative: scala.tools.reflect.SigParser (frontend to sun.reflect.generics.parser.SignatureParser)
@@ -842,7 +842,7 @@ abstract class BCodeHelpers extends BCodeTypes with BytecodeWriters {
842842
}
843843
}
844844

845-
if ((ctx.base.settings.check containsName phaseName)) {
845+
if ((ctx.settings.check containsName phaseName)) {
846846
val normalizedTpe = enteringErasure(erasure.prepareSigMap(memberTpe))
847847
val bytecodeTpe = owner.thisType.memberInfo(sym)
848848
if (!sym.isType && !sym.isConstructor && !(erasure.erasure(sym)(normalizedTpe) =:= bytecodeTpe)) {

src/dotty/tools/dotc/backend/jvm/BCodeIdiomatic.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import core.Symbols.{Symbol, NoSymbol}
2525
*/
2626
abstract class BCodeIdiomatic extends BCodeGlue {
2727

28-
def classfileVersion(implicit ctx: Context): Int = ctx.base.settings.target.value match {
28+
def classfileVersion(implicit ctx: Context): Int = ctx.settings.target.value match {
2929
case "jvm-1.5" => asm.Opcodes.V1_5
3030
case "jvm-1.6" => asm.Opcodes.V1_6
3131
case "jvm-1.7" => asm.Opcodes.V1_7

src/dotty/tools/dotc/backend/jvm/BCodeSkelBuilder.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ abstract class BCodeSkelBuilder extends BCodeHelpers {
171171

172172
} else {
173173

174-
val skipStaticForwarders = (claszSymbol.isInterface || ctx.base.settings.noForwarders)
174+
val skipStaticForwarders = (claszSymbol.isInterface || ctx.settings.noForwarders)
175175
if (!skipStaticForwarders) {
176176
val lmoc = claszSymbol.companionModule
177177
// add static forwarders if there are no name conflicts; see bugs #363 and #1735
@@ -605,7 +605,7 @@ abstract class BCodeSkelBuilder extends BCodeHelpers {
605605
case Return(_) => ()
606606
case EmptyTree =>
607607
globalError("Concrete method has no definition: " + dd + (
608-
if (ctx.base.settings.debug) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
608+
if (ctx.settings.debug) "(found: " + methSymbol.owner.info.decls.toList.mkString(", ") + ")"
609609
else "")
610610
)
611611
case _ =>

src/dotty/tools/dotc/backend/jvm/BCodeTypes.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import StdNames.{nme, tpnme}
2929
abstract class BCodeTypes extends BCodeIdiomatic {
3030

3131
// when compiling the Scala library, some assertions don't hold (e.g., scala.Boolean has null superClass although it's not an interface)
32-
def isCompilingStdLib(implicit ctx: Context) = !(ctx.base.settings.sourcepath.isDefault)
32+
def isCompilingStdLib(implicit ctx: Context) = !(ctx.settings.sourcepath.isDefault)
3333

3434
val srBoxedUnit = brefType("scala/runtime/BoxedUnit")
3535

src/dotty/tools/dotc/backend/jvm/BytecodeWriters.scala

+5-5
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FileConflictException(msg: String, val file: AbstractFile) extends IOExcep
2424
trait BytecodeWriters {
2525

2626
def outputDirectory(sym: Symbol)(implicit ctx: Context): AbstractFile =
27-
ctx.base.settings.outputDirs outputDirFor enteringFlatten(sym.sourceFile)
27+
ctx.settings.outputDirs outputDirFor enteringFlatten(sym.sourceFile)
2828

2929
/**
3030
* @param clsName cls.getName
@@ -61,8 +61,8 @@ trait BytecodeWriters {
6161
extends BytecodeWriter
6262
with HasContext {
6363
val jarMainAttrs = (
64-
if (ctx.base.settings.mainClass.isDefault) Nil
65-
else List(Name.MAIN_CLASS -> ctx.base.settings.mainClass.value)
64+
if (ctx.settings.mainClass.isDefault) Nil
65+
else List(Name.MAIN_CLASS -> ctx.settings.mainClass.value)
6666
)
6767
val writer = new Jar(jfile).jarWriter(jarMainAttrs: _*)
6868

@@ -91,7 +91,7 @@ trait BytecodeWriters {
9191
trait AsmpBytecodeWriter extends BytecodeWriter with HasContext {
9292
import dotty.tools.asm
9393

94-
private val baseDir = Directory(ctx.base.settings.Ygenasmp.value).createDirectory()
94+
private val baseDir = Directory(ctx.settings.Ygenasmp.value).createDirectory()
9595

9696
private def emitAsmp(jclassBytes: Array[Byte], asmpFile: io.File): Unit = {
9797
val pw = asmpFile.printWriter()
@@ -130,7 +130,7 @@ trait BytecodeWriters {
130130
}
131131

132132
trait DumpBytecodeWriter extends BytecodeWriter with HasContext {
133-
val baseDir = Directory(ctx.base.settings.Ydumpclasses.value).createDirectory()
133+
val baseDir = Directory(ctx.settings.Ydumpclasses.value).createDirectory()
134134

135135
abstract override def writeClass(label: String, jclassName: String, jclassBytes: Array[Byte], outfile: AbstractFile): Unit = {
136136
super.writeClass(label, jclassName, jclassBytes, outfile)

0 commit comments

Comments
 (0)