@@ -181,7 +181,7 @@ open class KotlinFileExtractor(
181181 }
182182 }
183183
184- fun extractTypeParameter (tp : IrTypeParameter , apparentIndex : Int , javaTypeParameter : JavaTypeParameter ? ): Label <out DbTypevariable >? {
184+ private fun extractTypeParameter (tp : IrTypeParameter , apparentIndex : Int , javaTypeParameter : JavaTypeParameter ? ): Label <out DbTypevariable >? {
185185 with (" type parameter" , tp) {
186186 val parentId = getTypeParameterParentLabel(tp) ? : return null
187187 val id = tw.getLabelFor<DbTypevariable >(getTypeParameterLabel(tp))
@@ -216,7 +216,7 @@ open class KotlinFileExtractor(
216216 }
217217 }
218218
219- fun extractVisibility (elementForLocation : IrElement , id : Label <out DbModifiable >, v : DescriptorVisibility ) {
219+ private fun extractVisibility (elementForLocation : IrElement , id : Label <out DbModifiable >, v : DescriptorVisibility ) {
220220 with (" visibility" , elementForLocation) {
221221 when (v) {
222222 DescriptorVisibilities .PRIVATE -> addModifiers(id, " private" )
@@ -250,7 +250,7 @@ open class KotlinFileExtractor(
250250 }
251251 }
252252
253- fun extractClassModifiers (c : IrClass , id : Label <out DbClassorinterface >) {
253+ private fun extractClassModifiers (c : IrClass , id : Label <out DbClassorinterface >) {
254254 with (" class modifiers" , c) {
255255 when (c.modality) {
256256 Modality .FINAL -> addModifiers(id, " final" )
@@ -371,7 +371,7 @@ open class KotlinFileExtractor(
371371 tw.writeHasLocation(stmtId, locId)
372372 }
373373
374- fun extractObinitFunction (c : IrClass , parentId : Label <out DbClassorinterface >) {
374+ private fun extractObinitFunction (c : IrClass , parentId : Label <out DbClassorinterface >) {
375375 // add method:
376376 val obinitLabel = getObinitLabel(c)
377377 val obinitId = tw.getLabelFor<DbMethod >(obinitLabel)
@@ -506,7 +506,7 @@ open class KotlinFileExtractor(
506506
507507 data class FieldResult (val id : Label <DbField >, val name : String )
508508
509- fun useCompanionObjectClassInstance (c : IrClass ): FieldResult ? {
509+ private fun useCompanionObjectClassInstance (c : IrClass ): FieldResult ? {
510510 val parent = c.parent
511511 if (! c.isCompanion) {
512512 logger.error(" Using companion instance for non-companion class" )
@@ -524,7 +524,7 @@ open class KotlinFileExtractor(
524524 }
525525 }
526526
527- fun useObjectClassInstance (c : IrClass ): FieldResult {
527+ private fun useObjectClassInstance (c : IrClass ): FieldResult {
528528 if (! c.isNonCompanionObject) {
529529 logger.error(" Using instance for non-object class" )
530530 }
@@ -719,13 +719,13 @@ open class KotlinFileExtractor(
719719 }
720720 }
721721
722- fun extractFunction (f : IrFunction , parentId : Label <out DbReftype >, extractBody : Boolean , extractMethodAndParameterTypeAccesses : Boolean , typeSubstitution : TypeSubstitution ? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? ) =
722+ private fun extractFunction (f : IrFunction , parentId : Label <out DbReftype >, extractBody : Boolean , extractMethodAndParameterTypeAccesses : Boolean , typeSubstitution : TypeSubstitution ? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? ) =
723723 if (isFake(f))
724724 null
725725 else
726726 forceExtractFunction(f, parentId, extractBody, extractMethodAndParameterTypeAccesses, typeSubstitution, classTypeArgsIncludingOuterClasses, null , null )
727727
728- fun forceExtractFunction (f : IrFunction , parentId : Label <out DbReftype >, extractBody : Boolean , extractMethodAndParameterTypeAccesses : Boolean , typeSubstitution : TypeSubstitution ? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? , idOverride : Label <DbMethod >? , locOverride : Label <DbLocation >? ): Label <out DbCallable > {
728+ private fun forceExtractFunction (f : IrFunction , parentId : Label <out DbReftype >, extractBody : Boolean , extractMethodAndParameterTypeAccesses : Boolean , typeSubstitution : TypeSubstitution ? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? , idOverride : Label <DbMethod >? , locOverride : Label <DbLocation >? ): Label <out DbCallable > {
729729 with (" function" , f) {
730730 DeclarationStackAdjuster (f).use {
731731
@@ -828,7 +828,7 @@ open class KotlinFileExtractor(
828828 && f.symbol !is IrConstructorSymbol // not a constructor
829829 }
830830
831- fun extractField (f : IrField , parentId : Label <out DbReftype >): Label <out DbField > {
831+ private fun extractField (f : IrField , parentId : Label <out DbReftype >): Label <out DbField > {
832832 with (" field" , f) {
833833 DeclarationStackAdjuster (f).use {
834834 declarationStack.push(f)
@@ -862,7 +862,7 @@ open class KotlinFileExtractor(
862862 return id
863863 }
864864
865- fun extractProperty (p : IrProperty , parentId : Label <out DbReftype >, extractBackingField : Boolean , extractFunctionBodies : Boolean , typeSubstitution : TypeSubstitution ? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? ) {
865+ private fun extractProperty (p : IrProperty , parentId : Label <out DbReftype >, extractBackingField : Boolean , extractFunctionBodies : Boolean , typeSubstitution : TypeSubstitution ? , classTypeArgsIncludingOuterClasses : List <IrTypeArgument >? ) {
866866 with (" property" , p) {
867867 if (isFake(p)) return
868868
@@ -931,7 +931,7 @@ open class KotlinFileExtractor(
931931 }
932932 }
933933
934- fun extractEnumEntry (ee : IrEnumEntry , parentId : Label <out DbReftype >, extractTypeAccess : Boolean ) {
934+ private fun extractEnumEntry (ee : IrEnumEntry , parentId : Label <out DbReftype >, extractTypeAccess : Boolean ) {
935935 with (" enum entry" , ee) {
936936 DeclarationStackAdjuster (ee).use {
937937 val id = useEnumEntry(ee)
@@ -953,7 +953,7 @@ open class KotlinFileExtractor(
953953 }
954954 }
955955
956- fun extractTypeAlias (ta : IrTypeAlias ) {
956+ private fun extractTypeAlias (ta : IrTypeAlias ) {
957957 with (" type alias" , ta) {
958958 if (ta.typeParameters.isNotEmpty()) {
959959 // TODO: Extract this information
@@ -968,7 +968,7 @@ open class KotlinFileExtractor(
968968 }
969969 }
970970
971- fun extractBody (b : IrBody , callable : Label <out DbCallable >) {
971+ private fun extractBody (b : IrBody , callable : Label <out DbCallable >) {
972972 with (" body" , b) {
973973 when (b) {
974974 is IrBlockBody -> extractBlockBody(b, callable)
@@ -981,7 +981,7 @@ open class KotlinFileExtractor(
981981 }
982982 }
983983
984- fun extractBlockBody (b : IrBlockBody , callable : Label <out DbCallable >) {
984+ private fun extractBlockBody (b : IrBlockBody , callable : Label <out DbCallable >) {
985985 with (" block body" , b) {
986986 val id = tw.getFreshIdLabel<DbBlock >()
987987 val locId = tw.getLocation(b)
@@ -993,7 +993,7 @@ open class KotlinFileExtractor(
993993 }
994994 }
995995
996- fun extractSyntheticBody (b : IrSyntheticBody , callable : Label <out DbCallable >) {
996+ private fun extractSyntheticBody (b : IrSyntheticBody , callable : Label <out DbCallable >) {
997997 with (" synthetic body" , b) {
998998 when (b.kind) {
999999 IrSyntheticBodyKind .ENUM_VALUES -> tw.writeKtSyntheticBody(callable, 1 )
@@ -1002,7 +1002,7 @@ open class KotlinFileExtractor(
10021002 }
10031003 }
10041004
1005- fun extractExpressionBody (b : IrExpressionBody , callable : Label <out DbCallable >) {
1005+ private fun extractExpressionBody (b : IrExpressionBody , callable : Label <out DbCallable >) {
10061006 with (" expression body" , b) {
10071007 val blockId = tw.getFreshIdLabel<DbBlock >()
10081008 val locId = tw.getLocation(b)
@@ -1026,7 +1026,7 @@ open class KotlinFileExtractor(
10261026 return v
10271027 }
10281028
1029- fun extractVariable (v : IrVariable , callable : Label <out DbCallable >, parent : Label <out DbStmtparent >, idx : Int ) {
1029+ private fun extractVariable (v : IrVariable , callable : Label <out DbCallable >, parent : Label <out DbStmtparent >, idx : Int ) {
10301030 with (" variable" , v) {
10311031 val stmtId = tw.getFreshIdLabel<DbLocalvariabledeclstmt >()
10321032 val locId = tw.getLocation(getVariableLocationProvider(v))
@@ -1036,7 +1036,7 @@ open class KotlinFileExtractor(
10361036 }
10371037 }
10381038
1039- fun extractVariableExpr (v : IrVariable , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int , enclosingStmt : Label <out DbStmt >) {
1039+ private fun extractVariableExpr (v : IrVariable , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int , enclosingStmt : Label <out DbStmt >) {
10401040 with (" variable expr" , v) {
10411041 val varId = useVariable(v)
10421042 val exprId = tw.getFreshIdLabel<DbLocalvariabledeclexpr >()
@@ -1060,7 +1060,7 @@ open class KotlinFileExtractor(
10601060 }
10611061 }
10621062
1063- fun extractStatement (s : IrStatement , callable : Label <out DbCallable >, parent : Label <out DbStmtparent >, idx : Int ) {
1063+ private fun extractStatement (s : IrStatement , callable : Label <out DbCallable >, parent : Label <out DbStmtparent >, idx : Int ) {
10641064 with (" statement" , s) {
10651065 when (s) {
10661066 is IrExpression -> {
@@ -1399,15 +1399,15 @@ open class KotlinFileExtractor(
13991399 }
14001400 }
14011401
1402- fun findFunction (cls : IrClass , name : String ): IrFunction ? = cls.declarations.find { it is IrFunction && it.name.asString() == name } as IrFunction ?
1402+ private fun findFunction (cls : IrClass , name : String ): IrFunction ? = cls.declarations.find { it is IrFunction && it.name.asString() == name } as IrFunction ?
14031403
14041404 val jvmIntrinsicsClass by lazy {
14051405 val result = pluginContext.referenceClass(FqName (" kotlin.jvm.internal.Intrinsics" ))?.owner
14061406 result?.let { extractExternalClassLater(it) }
14071407 result
14081408 }
14091409
1410- fun findJdkIntrinsicOrWarn (name : String , warnAgainstElement : IrElement ): IrFunction ? {
1410+ private fun findJdkIntrinsicOrWarn (name : String , warnAgainstElement : IrElement ): IrFunction ? {
14111411 val result = jvmIntrinsicsClass?.let { findFunction(it, name) }
14121412 if (result == null ) {
14131413 logger.errorElement(" Couldn't find JVM intrinsic function $name " , warnAgainstElement)
@@ -1501,7 +1501,7 @@ open class KotlinFileExtractor(
15011501 result
15021502 }
15031503
1504- fun isFunction (target : IrFunction , pkgName : String , classNameLogged : String , classNamePredicate : (String ) -> Boolean , fName : String , hasQuestionMark : Boolean? = false): Boolean {
1504+ private fun isFunction (target : IrFunction , pkgName : String , classNameLogged : String , classNamePredicate : (String ) -> Boolean , fName : String , hasQuestionMark : Boolean? = false): Boolean {
15051505 val verbose = false
15061506 fun verboseln (s : String ) { if (verbose) println (s) }
15071507 verboseln(" Attempting match for $pkgName $classNameLogged $fName " )
@@ -1545,10 +1545,10 @@ open class KotlinFileExtractor(
15451545 return true
15461546 }
15471547
1548- fun isFunction (target : IrFunction , pkgName : String , className : String , fName : String , hasQuestionMark : Boolean? = false) =
1548+ private fun isFunction (target : IrFunction , pkgName : String , className : String , fName : String , hasQuestionMark : Boolean? = false) =
15491549 isFunction(target, pkgName, className, { it == className }, fName, hasQuestionMark)
15501550
1551- fun isNumericFunction (target : IrFunction , fName : String ): Boolean {
1551+ private fun isNumericFunction (target : IrFunction , fName : String ): Boolean {
15521552 return isFunction(target, " kotlin" , " Int" , fName) ||
15531553 isFunction(target, " kotlin" , " Byte" , fName) ||
15541554 isFunction(target, " kotlin" , " Short" , fName) ||
@@ -1557,7 +1557,7 @@ open class KotlinFileExtractor(
15571557 isFunction(target, " kotlin" , " Double" , fName)
15581558 }
15591559
1560- fun isArrayType (typeName : String ) =
1560+ private fun isArrayType (typeName : String ) =
15611561 when (typeName) {
15621562 " Array" -> true
15631563 " IntArray" -> true
@@ -1571,7 +1571,7 @@ open class KotlinFileExtractor(
15711571 else -> false
15721572 }
15731573
1574- fun extractCall (c : IrCall , callable : Label <out DbCallable >, stmtExprParent : StmtExprParent ) {
1574+ private fun extractCall (c : IrCall , callable : Label <out DbCallable >, stmtExprParent : StmtExprParent ) {
15751575 with (" call" , c) {
15761576 val target = tryReplaceSyntheticFunction(c.symbol.owner)
15771577
@@ -2250,7 +2250,7 @@ open class KotlinFileExtractor(
22502250 else -> null
22512251 }
22522252
2253- fun getUpdateInPlaceRHS (origin : IrStatementOrigin ? , isExpectedLhs : (IrExpression ? ) -> Boolean , updateRhs : IrExpression ): IrExpression ? {
2253+ private fun getUpdateInPlaceRHS (origin : IrStatementOrigin ? , isExpectedLhs : (IrExpression ? ) -> Boolean , updateRhs : IrExpression ): IrExpression ? {
22542254 // Check for a desugared in-place update operator, such as "v += e":
22552255 return getStatementOriginOperator(origin)?.let {
22562256 if (updateRhs is IrCall &&
@@ -2265,7 +2265,7 @@ open class KotlinFileExtractor(
22652265 }
22662266 }
22672267
2268- fun writeUpdateInPlaceExpr (origin : IrStatementOrigin , tw : TrapWriter , id : Label <DbAssignexpr >, type : TypeResults , exprParent : ExprParent ): Boolean {
2268+ private fun writeUpdateInPlaceExpr (origin : IrStatementOrigin , tw : TrapWriter , id : Label <DbAssignexpr >, type : TypeResults , exprParent : ExprParent ): Boolean {
22692269 when (origin) {
22702270 IrStatementOrigin .PLUSEQ -> tw.writeExprs_assignaddexpr(id.cast<DbAssignaddexpr >(), type.javaResult.id, exprParent.parent, exprParent.idx)
22712271 IrStatementOrigin .MINUSEQ -> tw.writeExprs_assignsubexpr(id.cast<DbAssignsubexpr >(), type.javaResult.id, exprParent.parent, exprParent.idx)
@@ -2277,7 +2277,7 @@ open class KotlinFileExtractor(
22772277 return true
22782278 }
22792279
2280- fun tryExtractArrayUpdate (e : IrContainerExpression , callable : Label <out DbCallable >, parent : StmtExprParent ): Boolean {
2280+ private fun tryExtractArrayUpdate (e : IrContainerExpression , callable : Label <out DbCallable >, parent : StmtExprParent ): Boolean {
22812281 /*
22822282 * We're expecting the pattern
22832283 * {
@@ -2348,15 +2348,15 @@ open class KotlinFileExtractor(
23482348 return false
23492349 }
23502350
2351- fun extractExpressionStmt (e : IrExpression , callable : Label <out DbCallable >, parent : Label <out DbStmtparent >, idx : Int ) {
2351+ private fun extractExpressionStmt (e : IrExpression , callable : Label <out DbCallable >, parent : Label <out DbStmtparent >, idx : Int ) {
23522352 extractExpression(e, callable, StmtParent (parent, idx))
23532353 }
23542354
23552355 fun extractExpressionExpr (e : IrExpression , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int , enclosingStmt : Label <out DbStmt >) {
23562356 extractExpression(e, callable, ExprParent (parent, idx, enclosingStmt))
23572357 }
23582358
2359- fun extractExpression (e : IrExpression , callable : Label <out DbCallable >, parent : StmtExprParent ) {
2359+ private fun extractExpression (e : IrExpression , callable : Label <out DbCallable >, parent : StmtExprParent ) {
23602360 with (" expression" , e) {
23612361 when (e) {
23622362 is IrDelegatingConstructorCall -> {
@@ -3819,7 +3819,7 @@ open class KotlinFileExtractor(
38193819 }
38203820 }
38213821
3822- fun extractVarargElement (e : IrVarargElement , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int , enclosingStmt : Label <out DbStmt >) {
3822+ private fun extractVarargElement (e : IrVarargElement , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int , enclosingStmt : Label <out DbStmt >) {
38233823 with (" vararg element" , e) {
38243824 val argExpr = when (e) {
38253825 is IrExpression -> e
@@ -4011,7 +4011,7 @@ open class KotlinFileExtractor(
40114011 return initId
40124012 }
40134013
4014- fun extractTypeOperatorCall (e : IrTypeOperatorCall , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int , enclosingStmt : Label <out DbStmt >) {
4014+ private fun extractTypeOperatorCall (e : IrTypeOperatorCall , callable : Label <out DbCallable >, parent : Label <out DbExprparent >, idx : Int , enclosingStmt : Label <out DbStmt >) {
40154015 with (" type operator call" , e) {
40164016 when (e.operator ) {
40174017 IrTypeOperator .CAST -> {
0 commit comments