6
6
package org.jetbrains.kotlin.backend.konan
7
7
8
8
import llvm.*
9
- import org.jetbrains.kotlin.backend.common.DumpIrTreeWithDescriptorsVisitor
10
9
import org.jetbrains.kotlin.backend.konan.descriptors.*
11
10
import org.jetbrains.kotlin.backend.konan.ir.KonanIr
12
11
import org.jetbrains.kotlin.library.SerializedMetadata
@@ -21,11 +20,9 @@ import org.jetbrains.kotlin.descriptors.impl.PropertyDescriptorImpl
21
20
import org.jetbrains.kotlin.descriptors.impl.ReceiverParameterDescriptorImpl
22
21
import org.jetbrains.kotlin.incremental.components.NoLookupLocation
23
22
import org.jetbrains.kotlin.ir.IrElement
24
- import org.jetbrains.kotlin.ir.SourceManager
25
23
import org.jetbrains.kotlin.ir.declarations.*
26
24
import org.jetbrains.kotlin.ir.declarations.impl.IrFieldImpl
27
25
import org.jetbrains.kotlin.ir.declarations.impl.IrFunctionImpl
28
- import org.jetbrains.kotlin.ir.declarations.impl.IrTypeParameterImpl
29
26
import org.jetbrains.kotlin.ir.util.*
30
27
import org.jetbrains.kotlin.ir.visitors.IrElementVisitor
31
28
import org.jetbrains.kotlin.ir.visitors.IrElementVisitorVoid
@@ -48,9 +45,7 @@ import org.jetbrains.kotlin.backend.common.ir.copyToWithoutSuperTypes
48
45
import org.jetbrains.kotlin.backend.konan.objcexport.ObjCExport
49
46
import org.jetbrains.kotlin.backend.konan.llvm.coverage.CoverageManager
50
47
import org.jetbrains.kotlin.ir.descriptors.WrappedSimpleFunctionDescriptor
51
- import org.jetbrains.kotlin.ir.descriptors.WrappedTypeParameterDescriptor
52
48
import org.jetbrains.kotlin.ir.symbols.IrSymbol
53
- import org.jetbrains.kotlin.ir.symbols.impl.IrTypeParameterSymbolImpl
54
49
import org.jetbrains.kotlin.name.FqName
55
50
import org.jetbrains.kotlin.konan.library.KonanLibraryLayout
56
51
import org.jetbrains.kotlin.library.SerializedIrModule
@@ -364,49 +359,6 @@ internal class Context(config: KonanConfig) : KonanBackendContext(config) {
364
359
irModule!! .accept(DumpIrTreeVisitor (out ), " " )
365
360
}
366
361
367
- fun printIrWithDescriptors () {
368
- if (irModule == null ) return
369
- separator(" IR:" )
370
- irModule!! .accept(DumpIrTreeWithDescriptorsVisitor (out ), " " )
371
- }
372
-
373
- fun printLocations () {
374
- if (irModule == null ) return
375
- separator(" Locations:" )
376
- irModule!! .acceptVoid(object : IrElementVisitorVoid {
377
- override fun visitElement (element : IrElement ) {
378
- element.acceptChildrenVoid(this )
379
- }
380
-
381
- override fun visitFile (declaration : IrFile ) {
382
- val fileEntry = declaration.fileEntry
383
- declaration.acceptChildren(object : IrElementVisitor <Unit , Int > {
384
- override fun visitElement (element : IrElement , data : Int ) {
385
- for (i in 0 .. data) print (" " )
386
- println (" ${element.javaClass.name} : ${fileEntry.range(element)} " )
387
- element.acceptChildren(this , data + 1 )
388
- }
389
- }, 0 )
390
- }
391
-
392
- fun SourceManager.FileEntry.range (element : IrElement ):String {
393
- try {
394
- /* wasn't use multi line string to prevent appearing odd line
395
- * breaks in the dump. */
396
- return " ${this .name} : ${this .line(element.startOffset)} " +
397
- " :${this .column(element.startOffset)} - " +
398
- " ${this .line(element.endOffset)} " +
399
- " :${this .column(element.endOffset)} "
400
-
401
- } catch (e: Exception ) {
402
- return " ${this .name} : ERROR(${e.javaClass.name} ): ${e.message} "
403
- }
404
- }
405
- fun SourceManager.FileEntry.line (offset : Int ) = this .getLineNumber(offset)
406
- fun SourceManager.FileEntry.column (offset : Int ) = this .getColumnNumber(offset)
407
- })
408
- }
409
-
410
362
fun verifyBitCode () {
411
363
if (llvmModule == null ) return
412
364
verifyModule(llvmModule!! )
0 commit comments