[FIR] Add transformBody to FirFunction
This commit is contained in:
committed by
Ilya Gorbunov
parent
23dc75fb87
commit
8ce28cb509
@@ -113,6 +113,10 @@ class FirJavaConstructor @FirImplementationDetail constructor(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirConstructor {
|
||||
return this
|
||||
}
|
||||
|
||||
override var containerSource: DeserializedContainerSource? = null
|
||||
|
||||
override fun replaceReturnTypeRef(newReturnTypeRef: FirTypeRef) {
|
||||
|
||||
@@ -64,4 +64,6 @@ abstract class FirAnonymousFunction : FirFunction<FirAnonymousFunction>, FirExpr
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||
|
||||
abstract override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirAnonymousFunction
|
||||
}
|
||||
|
||||
@@ -64,4 +64,6 @@ abstract class FirConstructor : FirPureAbstractElement(), FirFunction<FirConstru
|
||||
abstract override fun <D> transformAnnotations(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
|
||||
abstract fun <D> transformDelegatedConstructor(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
|
||||
abstract override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirConstructor
|
||||
}
|
||||
|
||||
@@ -57,4 +57,6 @@ abstract class FirErrorFunction : FirPureAbstractElement(), FirFunction<FirError
|
||||
abstract override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirErrorFunction
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirErrorFunction
|
||||
|
||||
abstract override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirErrorFunction
|
||||
}
|
||||
|
||||
@@ -55,4 +55,6 @@ interface FirFunction<F : FirFunction<F>> : FirCallableDeclaration<F>, FirTarget
|
||||
override fun <D> transformControlFlowGraphReference(transformer: FirTransformer<D>, data: D): FirFunction<F>
|
||||
|
||||
fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirFunction<F>
|
||||
|
||||
fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirFunction<F>
|
||||
}
|
||||
|
||||
@@ -60,6 +60,8 @@ abstract class FirPropertyAccessor : FirPureAbstractElement(), FirFunction<FirPr
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract override fun <D> transformContractDescription(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
abstract fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirPropertyAccessor
|
||||
|
||||
@@ -62,6 +62,8 @@ abstract class FirSimpleFunction : FirPureAbstractElement(), FirFunction<FirSimp
|
||||
|
||||
abstract override fun <D> transformValueParameters(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
abstract override fun <D> transformContractDescription(transformer: FirTransformer<D>, data: D): FirSimpleFunction
|
||||
|
||||
+6
-1
@@ -69,7 +69,7 @@ internal class FirAnonymousFunctionImpl(
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
transformValueParameters(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
transformBody(transformer, data)
|
||||
typeRef = typeRef.transformSingle(transformer, data)
|
||||
label = label?.transformSingle(transformer, data)
|
||||
typeParameters.transformInplace(transformer, data)
|
||||
@@ -101,6 +101,11 @@ internal class FirAnonymousFunctionImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirAnonymousFunctionImpl {
|
||||
body = body?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+6
-1
@@ -74,7 +74,7 @@ internal class FirConstructorImpl(
|
||||
transformStatus(transformer, data)
|
||||
transformAnnotations(transformer, data)
|
||||
transformDelegatedConstructor(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
transformBody(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -113,6 +113,11 @@ internal class FirConstructorImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirConstructorImpl {
|
||||
body = body?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+4
@@ -90,6 +90,10 @@ internal class FirErrorFunctionImpl(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirErrorFunctionImpl {
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+6
-1
@@ -74,7 +74,7 @@ internal class FirPrimaryConstructor(
|
||||
transformStatus(transformer, data)
|
||||
transformAnnotations(transformer, data)
|
||||
transformDelegatedConstructor(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
transformBody(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
@@ -113,6 +113,11 @@ internal class FirPrimaryConstructor(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirPrimaryConstructor {
|
||||
body = body?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
resolvePhase = newResolvePhase
|
||||
}
|
||||
|
||||
+6
-1
@@ -69,7 +69,7 @@ open class FirPropertyAccessorImpl @FirImplementationDetail constructor(
|
||||
transformReturnTypeRef(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
transformValueParameters(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
transformBody(transformer, data)
|
||||
transformContractDescription(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
transformAnnotations(transformer, data)
|
||||
@@ -96,6 +96,11 @@ open class FirPropertyAccessorImpl @FirImplementationDetail constructor(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirPropertyAccessorImpl {
|
||||
body = body?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformContractDescription(transformer: FirTransformer<D>, data: D): FirPropertyAccessorImpl {
|
||||
contractDescription = contractDescription.transformSingle(transformer, data)
|
||||
return this
|
||||
|
||||
+6
-1
@@ -72,7 +72,7 @@ open class FirSimpleFunctionImpl @FirImplementationDetail constructor(
|
||||
transformReceiverTypeRef(transformer, data)
|
||||
transformControlFlowGraphReference(transformer, data)
|
||||
transformValueParameters(transformer, data)
|
||||
body = body?.transformSingle(transformer, data)
|
||||
transformBody(transformer, data)
|
||||
transformStatus(transformer, data)
|
||||
transformContractDescription(transformer, data)
|
||||
transformAnnotations(transformer, data)
|
||||
@@ -100,6 +100,11 @@ open class FirSimpleFunctionImpl @FirImplementationDetail constructor(
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirSimpleFunctionImpl {
|
||||
body = body?.transformSingle(transformer, data)
|
||||
return this
|
||||
}
|
||||
|
||||
override fun <D> transformStatus(transformer: FirTransformer<D>, data: D): FirSimpleFunctionImpl {
|
||||
status = status.transformSingle(transformer, data)
|
||||
return this
|
||||
|
||||
+4
@@ -109,6 +109,10 @@ class FirSyntheticPropertyAccessor(
|
||||
throw AssertionError("Transformation of synthetic property accessor isn't supported")
|
||||
}
|
||||
|
||||
override fun <D> transformBody(transformer: FirTransformer<D>, data: D): FirPropertyAccessor {
|
||||
throw AssertionError("Transformation of synthetic property accessor isn't supported")
|
||||
}
|
||||
|
||||
override fun replaceResolvePhase(newResolvePhase: FirResolvePhase) {
|
||||
throw AssertionError("Mutation of synthetic property accessor isn't supported")
|
||||
}
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ object NodeConfigurator : AbstractFieldConfigurator<FirTreeBuilder>(FirTreeBuild
|
||||
parentArg(callableDeclaration, "F", "F")
|
||||
+symbol("FirFunctionSymbol", "F")
|
||||
+fieldList(valueParameter, withReplace = true).withTransform()
|
||||
+body(nullable = true)
|
||||
+body(nullable = true).withTransform()
|
||||
}
|
||||
|
||||
errorFunction.configure {
|
||||
|
||||
Reference in New Issue
Block a user