[FIR] Implement IR body generators for all FIR declarations generators in plugin prototype

This commit is contained in:
Dmitriy Novozhilov
2021-12-01 16:23:33 +03:00
committed by TeamCityServer
parent 9a0e73e132
commit 86404b8027
35 changed files with 485 additions and 610 deletions
@@ -187,6 +187,8 @@ class NaiveSourceBasedFileEntryImpl(
override val name: String,
private val lineStartOffsets: IntArray = intArrayOf()
) : IrFileEntry {
val lineStartOffsetsAreEmpty: Boolean
get() = lineStartOffsets.isEmpty()
private val MAX_SAVED_LINE_NUMBERS = 50
@@ -254,4 +256,4 @@ inline fun MemberScope.findFirstFunction(name: String, predicate: (CallableMembe
fun filterOutAnnotations(fqName: FqName, annotations: List<IrConstructorCall>): List<IrConstructorCall> {
return annotations.filterNot { it.annotationClass.hasEqualFqName(fqName) }
}
}
@@ -42,6 +42,11 @@ fun IrFile.dumpTreesFromLineNumber(lineNumber: Int, normalizeNames: Boolean = fa
return sb.toString()
}
fun IrFile.shouldSkipDump(): Boolean {
val entry = fileEntry as? NaiveSourceBasedFileEntryImpl ?: return false
return entry.lineStartOffsetsAreEmpty
}
class DumpIrTreeVisitor(
out: Appendable,
normalizeNames: Boolean = false,