Minor. Remove sourceFile from CoroutineTransformerMethodVisitor's parameters
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
* that can be found in the license/LICENSE.txt file.
|
* that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -461,8 +461,7 @@ class CoroutineCodegenForLambda private constructor(
|
|||||||
shouldPreserveClassInitialization = constructorCallNormalizationMode.shouldPreserveClassInitialization,
|
shouldPreserveClassInitialization = constructorCallNormalizationMode.shouldPreserveClassInitialization,
|
||||||
containingClassInternalName = v.thisName,
|
containingClassInternalName = v.thisName,
|
||||||
isForNamedFunction = false,
|
isForNamedFunction = false,
|
||||||
languageVersionSettings = languageVersionSettings,
|
languageVersionSettings = languageVersionSettings
|
||||||
sourceFile = element.containingFile.name
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -60,7 +60,6 @@ class CoroutineTransformerMethodVisitor(
|
|||||||
private val isForNamedFunction: Boolean,
|
private val isForNamedFunction: Boolean,
|
||||||
private val shouldPreserveClassInitialization: Boolean,
|
private val shouldPreserveClassInitialization: Boolean,
|
||||||
private val languageVersionSettings: LanguageVersionSettings,
|
private val languageVersionSettings: LanguageVersionSettings,
|
||||||
private val sourceFile: String,
|
|
||||||
// These two are needed to report diagnostics about suspension points inside critical section
|
// These two are needed to report diagnostics about suspension points inside critical section
|
||||||
private val element: KtElement,
|
private val element: KtElement,
|
||||||
private val diagnostics: DiagnosticSink,
|
private val diagnostics: DiagnosticSink,
|
||||||
@@ -73,7 +72,8 @@ class CoroutineTransformerMethodVisitor(
|
|||||||
) : TransformationMethodVisitor(delegate, access, name, desc, signature, exceptions) {
|
) : TransformationMethodVisitor(delegate, access, name, desc, signature, exceptions) {
|
||||||
|
|
||||||
private val classBuilderForCoroutineState: ClassBuilder by lazy(obtainClassBuilderForCoroutineState)
|
private val classBuilderForCoroutineState: ClassBuilder by lazy(obtainClassBuilderForCoroutineState)
|
||||||
private val lineNumber = element?.let { CodegenUtil.getLineNumberForElement(it, false) } ?: 0
|
private val lineNumber = CodegenUtil.getLineNumberForElement(element, false) ?: 0
|
||||||
|
private val sourceFile = element.containingKtFile.name
|
||||||
|
|
||||||
private var continuationIndex = if (isForNamedFunction) -1 else 0
|
private var continuationIndex = if (isForNamedFunction) -1 else 0
|
||||||
private var dataIndex = if (isForNamedFunction) -1 else 1
|
private var dataIndex = if (isForNamedFunction) -1 else 1
|
||||||
|
|||||||
+2
-3
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
* Copyright 2010-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||||
* that can be found in the license/LICENSE.txt file.
|
* that can be found in the license/LICENSE.txt file.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -70,8 +70,7 @@ open class SuspendFunctionGenerationStrategy(
|
|||||||
shouldPreserveClassInitialization = constructorCallNormalizationMode.shouldPreserveClassInitialization,
|
shouldPreserveClassInitialization = constructorCallNormalizationMode.shouldPreserveClassInitialization,
|
||||||
needDispatchReceiver = originalSuspendDescriptor.dispatchReceiverParameter != null,
|
needDispatchReceiver = originalSuspendDescriptor.dispatchReceiverParameter != null,
|
||||||
internalNameForDispatchReceiver = containingClassInternalNameOrNull(),
|
internalNameForDispatchReceiver = containingClassInternalNameOrNull(),
|
||||||
languageVersionSettings = languageVersionSettings,
|
languageVersionSettings = languageVersionSettings
|
||||||
sourceFile = declaration.containingFile.name
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-3
@@ -110,7 +110,6 @@ class CoroutineTransformer(
|
|||||||
shouldPreserveClassInitialization = state.constructorCallNormalizationMode.shouldPreserveClassInitialization,
|
shouldPreserveClassInitialization = state.constructorCallNormalizationMode.shouldPreserveClassInitialization,
|
||||||
containingClassInternalName = classBuilder.thisName,
|
containingClassInternalName = classBuilder.thisName,
|
||||||
isForNamedFunction = false,
|
isForNamedFunction = false,
|
||||||
sourceFile = element.containingKtFile.name,
|
|
||||||
isCrossinlineLambda = inliningContext.isContinuation
|
isCrossinlineLambda = inliningContext.isContinuation
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -138,8 +137,7 @@ class CoroutineTransformer(
|
|||||||
containingClassInternalName = classBuilder.thisName,
|
containingClassInternalName = classBuilder.thisName,
|
||||||
isForNamedFunction = true,
|
isForNamedFunction = true,
|
||||||
needDispatchReceiver = true,
|
needDispatchReceiver = true,
|
||||||
internalNameForDispatchReceiver = classBuilder.thisName,
|
internalNameForDispatchReceiver = classBuilder.thisName
|
||||||
sourceFile = element.containingKtFile.name
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user