@@ -6,6 +6,9 @@ import love.forte.plugin.suspendtrans.utils.*
6
6
import org.jetbrains.kotlin.backend.common.IrElementTransformerVoidWithContext
7
7
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
8
8
import org.jetbrains.kotlin.backend.wasm.ir2wasm.getSourceLocation
9
+ import org.jetbrains.kotlin.cli.common.messages.CompilerMessageLocation
10
+ import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity
11
+ import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSourceLocation
9
12
import org.jetbrains.kotlin.descriptors.CallableDescriptor
10
13
import org.jetbrains.kotlin.ir.IrStatement
11
14
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
@@ -20,7 +23,10 @@ import org.jetbrains.kotlin.ir.expressions.impl.IrFunctionExpressionImpl
20
23
import org.jetbrains.kotlin.ir.expressions.impl.IrTypeOperatorCallImpl
21
24
import org.jetbrains.kotlin.ir.symbols.IrSimpleFunctionSymbol
22
25
import org.jetbrains.kotlin.ir.types.*
23
- import org.jetbrains.kotlin.ir.util.*
26
+ import org.jetbrains.kotlin.ir.util.file
27
+ import org.jetbrains.kotlin.ir.util.isAnnotationWithEqualFqName
28
+ import org.jetbrains.kotlin.ir.util.kotlinFqName
29
+ import org.jetbrains.kotlin.ir.util.primaryConstructor
24
30
import org.jetbrains.kotlin.name.ClassId
25
31
import org.jetbrains.kotlin.name.FqName
26
32
import org.jetbrains.kotlin.wasm.ir.source.location.SourceLocation
@@ -224,7 +230,7 @@ class SuspendTransformTransformer(
224
230
if (reporter != null ) {
225
231
// WARN? DEBUG? IGNORE?
226
232
reporter.report(
227
- IrMessageLogger . Severity .INFO ,
233
+ CompilerMessageSeverity .INFO ,
228
234
message,
229
235
function.reportLocation()
230
236
)
@@ -240,7 +246,7 @@ class SuspendTransformTransformer(
240
246
val originFunction = originFunctions.first()
241
247
242
248
reporter?.report(
243
- IrMessageLogger . Severity .INFO ,
249
+ CompilerMessageSeverity .INFO ,
244
250
" Generate body for function " +
245
251
kotlin.runCatching { function.kotlinFqName.asString() }.getOrElse { function.name.asString() } +
246
252
" by origin function " +
@@ -265,15 +271,16 @@ class SuspendTransformTransformer(
265
271
}
266
272
}
267
273
268
- private fun IrFunction.reportLocation (): IrMessageLogger . Location ? {
274
+ private fun IrFunction.reportLocation (): CompilerMessageSourceLocation ? {
269
275
return when (val sourceLocation =
270
276
// getSourceLocation(runCatching { fileEntry }.getOrNull())) {
271
277
getSourceLocation(file)) {
272
278
is SourceLocation .Location -> {
273
- IrMessageLogger . Location (
274
- filePath = sourceLocation.file,
279
+ CompilerMessageLocation .create (
280
+ path = sourceLocation.file,
275
281
line = sourceLocation.line,
276
- column = sourceLocation.column
282
+ column = sourceLocation.column,
283
+ lineContent = null
277
284
)
278
285
}
279
286
0 commit comments