IR: Drop obsolete builders (should be rewritten)
This commit is contained in:
@@ -17,17 +17,10 @@
|
||||
package org.jetbrains.kotlin.psi2ir.generators
|
||||
|
||||
import org.jetbrains.kotlin.descriptors.CallableDescriptor
|
||||
import org.jetbrains.kotlin.ir.builders.*
|
||||
import org.jetbrains.kotlin.ir.expressions.IrBlockBody
|
||||
import org.jetbrains.kotlin.ir.expressions.IrExpression
|
||||
import org.jetbrains.kotlin.ir.expressions.IrStatementOrigin
|
||||
import org.jetbrains.kotlin.ir.expressions.impl.IrErrorExpressionImpl
|
||||
import org.jetbrains.kotlin.ir.builders.IrGenerator
|
||||
import org.jetbrains.kotlin.ir.builders.IrGeneratorWithScope
|
||||
import org.jetbrains.kotlin.psi.KtElement
|
||||
import org.jetbrains.kotlin.psi.KtExpression
|
||||
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
||||
import org.jetbrains.kotlin.psi.psiUtil.startOffset
|
||||
import org.jetbrains.kotlin.psi2ir.endOffsetOrUndefined
|
||||
import org.jetbrains.kotlin.psi2ir.startOffsetOrUndefined
|
||||
import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCall
|
||||
import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall
|
||||
import org.jetbrains.kotlin.types.KotlinType
|
||||
@@ -39,8 +32,7 @@ interface Generator : IrGenerator {
|
||||
override val context: GeneratorContext
|
||||
}
|
||||
|
||||
interface GeneratorWithScope : Generator, IrGeneratorWithScope {
|
||||
}
|
||||
interface GeneratorWithScope : Generator, IrGeneratorWithScope
|
||||
|
||||
|
||||
fun <K, V : Any> Generator.get(slice: ReadOnlySlice<K, V>, key: K): V? =
|
||||
@@ -61,22 +53,3 @@ fun Generator.getInferredTypeWithImplicitCastsOrFail(key: KtExpression): KotlinT
|
||||
fun Generator.getResolvedCall(key: KtElement): ResolvedCall<out CallableDescriptor>? =
|
||||
key.getResolvedCall(context.bindingContext)
|
||||
|
||||
fun Generator.createDummyExpression(ktExpression: KtExpression, description: String): IrErrorExpressionImpl =
|
||||
IrErrorExpressionImpl(
|
||||
ktExpression.startOffset,
|
||||
ktExpression.endOffset,
|
||||
getInferredTypeWithImplicitCastsOrFail(ktExpression),
|
||||
description
|
||||
)
|
||||
|
||||
inline fun GeneratorWithScope.irBlock(
|
||||
ktElement: KtElement?,
|
||||
origin: IrStatementOrigin? = null, resultType: KotlinType? = null,
|
||||
body: IrBlockBuilder.() -> Unit
|
||||
): IrExpression =
|
||||
this.irBlock(ktElement.startOffsetOrUndefined, ktElement.endOffsetOrUndefined, origin, resultType, body)
|
||||
|
||||
inline fun GeneratorWithScope.irBlockBody(ktElement: KtElement?, body: IrBlockBodyBuilder.() -> Unit): IrBlockBody =
|
||||
this.irBlockBody(ktElement.startOffsetOrUndefined, ktElement.endOffsetOrUndefined, body)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user