Skip to content

Commit e3de80b

Browse files
committed
Rename using Context, CState to using Ctx, CState
This a blind to renming. Fixes in next commit, to better see what the change set is.
1 parent f1ed7c8 commit e3de80b

File tree

305 files changed

+4505
-4505
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

305 files changed

+4505
-4505
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
846846
}
847847
}
848848

849-
private def getGenericSignatureHelper(sym: Symbol, owner: Symbol, memberTpe: Type)(using Context, CState): Option[String] = {
849+
private def getGenericSignatureHelper(sym: Symbol, owner: Symbol, memberTpe: Type)(using Ctx, CState): Option[String] = {
850850
if (needsGenericSignature(sym)) {
851851
val erasedTypeSym = TypeErasure.fullErasure(sym.denot.info).typeSymbol
852852
if (erasedTypeSym.isPrimitiveValueClass) {
@@ -866,7 +866,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
866866
}
867867
}
868868

869-
private def verifySignature(sym: Symbol, sig: String)(using Context, CState): Unit = {
869+
private def verifySignature(sym: Symbol, sig: String)(using Ctx, CState): Unit = {
870870
import scala.tools.asm.util.CheckClassAdapter
871871
def wrap(body: => Unit): Unit = {
872872
try body
@@ -927,7 +927,7 @@ trait BCodeHelpers extends BCodeIdiomatic with BytecodeWriters {
927927
throw new RuntimeException(msg)
928928
}
929929

930-
private def compilingArray(using Context, CState) =
930+
private def compilingArray(using Ctx, CState) =
931931
ctx.compilationUnit.source.file.name == "Array.scala"
932932
}
933933

compiler/src/dotty/tools/backend/jvm/CollectSuperCalls.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class CollectSuperCalls extends MiniPhase {
2222

2323
def phaseName: String = "collectSuperCalls"
2424

25-
override def transformSelect(tree: Select)(using Context, CState): Tree = {
25+
override def transformSelect(tree: Select)(using Ctx, CState): Tree = {
2626
tree.qualifier match {
2727
case sup: Super =>
2828
if (tree.symbol.owner.is(Trait))
@@ -32,7 +32,7 @@ class CollectSuperCalls extends MiniPhase {
3232
tree
3333
}
3434

35-
private def registerSuperCall(sym: ClassSymbol, calls: ClassSymbol)(using Context, CState) = {
35+
private def registerSuperCall(sym: ClassSymbol, calls: ClassSymbol)(using Ctx, CState) = {
3636
genBCodePhase match {
3737
case genBCodePhase: GenBCode =>
3838
genBCodePhase.registerSuperCall(sym, calls)

compiler/src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import Annotations.Annotation
3737
import Names.Name
3838

3939
class DottyBackendInterface(val outputDirectory: AbstractFile, val superCallsMap: Map[Symbol, Set[ClassSymbol]])
40-
(using val ctx: Context, val cs: CState) {
40+
(using val ctx: Ctx, val cs: CState) {
4141

4242
private val desugared = new java.util.IdentityHashMap[Type, tpd.Select]
4343

@@ -110,16 +110,16 @@ object DottyBackendInterface {
110110
else clazz.getName
111111
}
112112

113-
def requiredClass(str: String)(using Context, CState): ClassSymbol =
113+
def requiredClass(str: String)(using Ctx, CState): ClassSymbol =
114114
Symbols.requiredClass(str)
115115

116-
def requiredClass[T](using evidence: ClassTag[T], ctx: Context, cs: CState): Symbol =
116+
def requiredClass[T](using evidence: ClassTag[T], ctx: Ctx, cs: CState): Symbol =
117117
requiredClass(erasureString(evidence.runtimeClass))
118118

119-
def requiredModule(str: String)(using Context, CState): Symbol =
119+
def requiredModule(str: String)(using Ctx, CState): Symbol =
120120
Symbols.requiredModule(str)
121121

122-
def requiredModule[T](using evidence: ClassTag[T], ctx: Context, cs: CState): Symbol = {
122+
def requiredModule[T](using evidence: ClassTag[T], ctx: Ctx, cs: CState): Symbol = {
123123
val moduleName = erasureString(evidence.runtimeClass)
124124
val className = if (moduleName.endsWith("$")) moduleName.dropRight(1) else moduleName
125125
requiredModule(className)
@@ -128,19 +128,19 @@ object DottyBackendInterface {
128128
given symExtensions as AnyRef:
129129
extension (sym: Symbol):
130130

131-
def isInterface(using Context, CState): Boolean = (sym.is(PureInterface)) || sym.is(Trait)
131+
def isInterface(using Ctx, CState): Boolean = (sym.is(PureInterface)) || sym.is(Trait)
132132

133-
def isStaticConstructor(using Context, CState): Boolean = (sym.isStaticMember && sym.isClassConstructor) || (sym.name eq nme.STATIC_CONSTRUCTOR)
133+
def isStaticConstructor(using Ctx, CState): Boolean = (sym.isStaticMember && sym.isClassConstructor) || (sym.name eq nme.STATIC_CONSTRUCTOR)
134134

135-
def isStaticMember(using Context, CState): Boolean = (sym ne NoSymbol) &&
135+
def isStaticMember(using Ctx, CState): Boolean = (sym ne NoSymbol) &&
136136
(sym.is(JavaStatic) || sym.isScalaStatic)
137137
// guard against no sumbol cause this code is executed to select which call type(static\dynamic) to use to call array.clone
138138

139139
/**
140140
* True for module classes of modules that are top-level or owned only by objects. Module classes
141141
* for such objects will get a MODULE$ flag and a corresponding static initializer.
142142
*/
143-
def isStaticModuleClass(using Context, CState): Boolean =
143+
def isStaticModuleClass(using Ctx, CState): Boolean =
144144
(sym.is(Module)) && {
145145
// scalac uses atPickling here
146146
// this would not work if modules are created after pickling
@@ -154,7 +154,7 @@ object DottyBackendInterface {
154154

155155

156156

157-
def originalLexicallyEnclosingClass(using Context, CState): Symbol =
157+
def originalLexicallyEnclosingClass(using Ctx, CState): Symbol =
158158
// used to populate the EnclosingMethod attribute.
159159
// it is very tricky in presence of classes(and annonymous classes) defined inside supper calls.
160160
if (sym.exists) {
@@ -168,15 +168,15 @@ object DottyBackendInterface {
168168
* True for module classes of package level objects. The backend will generate a mirror class for
169169
* such objects.
170170
*/
171-
def isTopLevelModuleClass(using Context, CState): Boolean =
171+
def isTopLevelModuleClass(using Ctx, CState): Boolean =
172172
sym.is(ModuleClass) &&
173173
atPhase(flattenPhase) {
174174
toDenot(sym).owner.is(PackageClass)
175175
}
176176

177-
def javaSimpleName(using Context, CState): String = toDenot(sym).name.mangledString
178-
def javaClassName(using Context, CState): String = toDenot(sym).fullName.mangledString
179-
def javaBinaryName(using Context, CState): String = javaClassName.replace('.', '/')
177+
def javaSimpleName(using Ctx, CState): String = toDenot(sym).name.mangledString
178+
def javaClassName(using Ctx, CState): String = toDenot(sym).fullName.mangledString
179+
def javaBinaryName(using Ctx, CState): String = javaClassName.replace('.', '/')
180180

181181
end extension
182182

@@ -198,7 +198,7 @@ object DottyBackendInterface {
198198
* True if the current compilation unit is of a primitive class (scala.Boolean et al).
199199
* Used only in assertions.
200200
*/
201-
def isCompilingPrimitive(using Context, CState) = {
201+
def isCompilingPrimitive(using Ctx, CState) = {
202202
primitiveCompilationUnits(ctx.compilationUnit.source.file.name)
203203
}
204204

compiler/src/dotty/tools/backend/jvm/GenBCode.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ class GenBCode extends Phase {
4343

4444
private var myOutput: AbstractFile = _
4545

46-
private def outputDir(using Context, CState): AbstractFile = {
46+
private def outputDir(using Ctx, CState): AbstractFile = {
4747
if (myOutput eq null)
4848
myOutput = ctx.settings.outputDir.value
4949
myOutput
5050
}
5151

52-
def run(using Context, CState): Unit =
52+
def run(using Ctx, CState): Unit =
5353
new GenBCodePipeline(
5454
new DottyBackendInterface(
5555
outputDir, superCallsMap.toMap
@@ -76,7 +76,7 @@ object GenBCode {
7676
val name: String = "genBCode"
7777
}
7878

79-
class GenBCodePipeline(val int: DottyBackendInterface)(using Context, CState) extends BCodeSyncAndTry {
79+
class GenBCodePipeline(val int: DottyBackendInterface)(using Ctx, CState) extends BCodeSyncAndTry {
8080
import DottyBackendInterface.symExtensions
8181

8282
private var tree: Tree = _

compiler/src/dotty/tools/backend/jvm/scalaPrimitives.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class DottyPrimitives(ictx: Context, cs: CState) {
5050
* @param tpe The type of the receiver object. It is used only for array
5151
* operations
5252
*/
53-
def getPrimitive(app: Apply, tpe: Type)(using Context, CState): Int = {
53+
def getPrimitive(app: Apply, tpe: Type)(using Ctx, CState): Int = {
5454
val fun = app.fun.symbol
5555
val defn = ctx.definitions
5656
val code = app.fun match {
@@ -132,7 +132,7 @@ class DottyPrimitives(ictx: Context, cs: CState) {
132132
primitives(s) = code
133133
}
134134

135-
def addPrimitives(cls: Symbol, method: TermName, code: Int)(using Context, CState): Unit = {
135+
def addPrimitives(cls: Symbol, method: TermName, code: Int)(using Ctx, CState): Unit = {
136136
val alts = cls.info.member(method).alternatives.map(_.symbol)
137137
if (alts.isEmpty)
138138
report.error(s"Unknown primitive method $cls.$method")

compiler/src/dotty/tools/backend/sjs/GenSJSIR.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import Phases._
88
class GenSJSIR extends Phase {
99
def phaseName: String = "genSJSIR"
1010

11-
override def isRunnable(using Context): Boolean =
11+
override def isRunnable(using Ctx): Boolean =
1212
super.isRunnable && ctx.settings.scalajs.value
1313

14-
def run(using Context, CState): Unit =
14+
def run(using Ctx, CState): Unit =
1515
new JSCodeGen().run()
1616
}

compiler/src/dotty/tools/backend/sjs/JSCodeGen.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import ScopedVar.withScopedVars
5656
* - `genMethod()` and similar methods generate the declarations of methods.
5757
* - `genStatOrExpr()` and everything else generate the bodies of methods.
5858
*/
59-
class JSCodeGen()(using genCtx: Context, cs: CState) {
59+
class JSCodeGen()(using genCtx: Ctx, cs: CState) {
6060
import JSCodeGen._
6161
import tpd._
6262

@@ -2733,7 +2733,7 @@ class JSCodeGen()(using genCtx: Context, cs: CState) {
27332733
private def genActualJSArgs(sym: Symbol, args: List[Tree])(
27342734
implicit pos: Position): List[js.TreeOrJSSpread] = {
27352735

2736-
def paramNamesAndTypes(using Context, CState): List[(Names.TermName, Type)] =
2736+
def paramNamesAndTypes(using Ctx, CState): List[(Names.TermName, Type)] =
27372737
sym.info.paramNamess.flatten.zip(sym.info.paramInfoss.flatten)
27382738

27392739
val wereRepeated = atPhase(elimRepeatedPhase) {

0 commit comments

Comments
 (0)