From f4ea1a2f41c0b5e688cafa5ff4de00baf08bbde2 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Tue, 4 Jul 2017 14:26:06 +0300 Subject: [PATCH] Minor: move RangeValue-related classes to proper packages --- .../kotlin/codegen/ExpressionCodegen.java | 2 +- .../codegen/range/ArrayIndicesRangeValue.kt | 33 +++++ .../kotlin/codegen/range/ArrayRangeValue.kt | 32 +++++ .../codegen/range/CallIntrinsicRangeValue.kt | 39 ++++++ .../range/CharSequenceIndicesRangeValue.kt | 33 +++++ .../codegen/range/CharSequenceRangeValue.kt | 32 +++++ .../range/CollectionIndicesRangeValue.kt | 33 +++++ .../range/ComparableRangeLiteralRangeValue.kt | 37 +++++ .../range/DownToProgressionRangeValue.kt | 33 +++++ .../codegen/range/IterableRangeValue.kt | 32 +++++ ...PrimitiveNumberRangeIntrinsicRangeValue.kt | 32 +++++ .../PrimitiveNumberRangeLiteralRangeValue.kt | 33 +++++ .../range/PrimitiveNumberUntilRangeValue.kt | 33 +++++ .../range/PrimitiveProgressionRangeValue.kt | 32 +++++ .../codegen/range/PrimitiveRangeRangeValue.kt | 32 +++++ .../kotlin/codegen/range/RangeValue.kt | 130 +----------------- ...bstractForInExclusiveRangeLoopGenerator.kt | 3 +- .../AbstractForInProgressionLoopGenerator.kt | 2 +- ...actForInProgressionOrRangeLoopGenerator.kt | 2 +- .../AbstractForInRangeLoopGenerator.kt | 2 +- ...tForInRangeWithGivenBoundsLoopGenerator.kt | 2 +- .../forLoop/AbstractForLoopGenerator.kt | 2 +- .../ForInArrayIndicesRangeLoopGenerator.kt | 2 +- .../forLoop/ForInArrayLoopGenerator.kt | 2 +- ...InCharSequenceIndicesRangeLoopGenerator.kt | 2 +- .../forLoop/ForInCharSequenceLoopGenerator.kt | 2 +- ...orInCollectionIndicesRangeLoopGenerator.kt | 2 +- .../ForInDownToProgressionLoopGenerator.kt | 2 +- .../ForInOptimizedIndicesLoopGenerator.kt | 2 +- ...ForInProgressionExpressionLoopGenerator.kt | 2 +- .../ForInRangeInstanceLoopGenerator.kt | 3 +- .../forLoop/ForInRangeLiteralLoopGenerator.kt | 2 +- .../forLoop/ForInUntilRangeLoopGenerator.kt | 2 +- .../{ => range}/forLoop/ForLoopGenerator.kt | 2 +- .../forLoop/IteratorForLoopGenerator.kt | 2 +- ...PrimitiveNumberRangeExpressionGenerator.kt | 2 +- ...RangeWithKnownBoundsExpressionGenerator.kt | 2 +- .../CallBasedInExpressionGenerator.kt | 4 +- .../InArrayIndicesGenerator.kt | 2 +- .../InCharSequenceIndicesGenerator.kt | 2 +- .../InCollectionIndicesGenerator.kt | 2 +- .../InComparableRangeLiteralGenerator.kt | 2 +- .../InExpressionGenerator.kt | 2 +- .../InPrimitiveNumberDownToGenerator.kt | 2 +- .../InPrimitiveNumberRangeLiteralGenerator.kt | 2 +- .../InPrimitiveNumberUntilGenerator.kt | 2 +- 46 files changed, 500 insertions(+), 162 deletions(-) create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayIndicesRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/CallIntrinsicRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceIndicesRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/CollectionIndicesRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/ComparableRangeLiteralRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/DownToProgressionRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/IterableRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeIntrinsicRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeLiteralRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberUntilRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveProgressionRangeValue.kt create mode 100644 compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveRangeRangeValue.kt rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/AbstractForInExclusiveRangeLoopGenerator.kt (94%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/AbstractForInProgressionLoopGenerator.kt (98%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/AbstractForInProgressionOrRangeLoopGenerator.kt (97%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/AbstractForInRangeLoopGenerator.kt (98%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/AbstractForInRangeWithGivenBoundsLoopGenerator.kt (96%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/AbstractForLoopGenerator.kt (99%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInArrayIndicesRangeLoopGenerator.kt (95%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInArrayLoopGenerator.kt (98%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInCharSequenceIndicesRangeLoopGenerator.kt (95%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInCharSequenceLoopGenerator.kt (98%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInCollectionIndicesRangeLoopGenerator.kt (95%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInDownToProgressionLoopGenerator.kt (96%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInOptimizedIndicesLoopGenerator.kt (97%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInProgressionExpressionLoopGenerator.kt (96%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInRangeInstanceLoopGenerator.kt (94%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInRangeLiteralLoopGenerator.kt (97%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForInUntilRangeLoopGenerator.kt (96%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/ForLoopGenerator.kt (94%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/{ => range}/forLoop/IteratorForLoopGenerator.kt (98%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/AbstractInPrimitiveNumberRangeExpressionGenerator.kt (98%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/AbstractInRangeWithKnownBoundsExpressionGenerator.kt (98%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/CallBasedInExpressionGenerator.kt (93%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InArrayIndicesGenerator.kt (96%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InCharSequenceIndicesGenerator.kt (97%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InCollectionIndicesGenerator.kt (97%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InComparableRangeLiteralGenerator.kt (97%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InExpressionGenerator.kt (93%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InPrimitiveNumberDownToGenerator.kt (96%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InPrimitiveNumberRangeLiteralGenerator.kt (96%) rename compiler/backend/src/org/jetbrains/kotlin/codegen/range/{ => inExpression}/InPrimitiveNumberUntilGenerator.kt (96%) diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index d6ed3b4bcfd..1c6cf63be2c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -39,7 +39,7 @@ import org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenForLambda; import org.jetbrains.kotlin.codegen.coroutines.CoroutineCodegenUtilKt; import org.jetbrains.kotlin.codegen.coroutines.ResolvedCallWithRealDescriptor; import org.jetbrains.kotlin.codegen.extensions.ExpressionCodegenExtension; -import org.jetbrains.kotlin.codegen.forLoop.ForLoopGenerator; +import org.jetbrains.kotlin.codegen.range.forLoop.ForLoopGenerator; import org.jetbrains.kotlin.codegen.inline.*; import org.jetbrains.kotlin.codegen.intrinsics.*; import org.jetbrains.kotlin.codegen.pseudoInsns.PseudoInsnsKt; diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayIndicesRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayIndicesRangeValue.kt new file mode 100644 index 00000000000..e80992e0104 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayIndicesRangeValue.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInArrayIndicesRangeLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InArrayIndicesGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +class ArrayIndicesRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInArrayIndicesRangeLoopGenerator(codegen, forExpression, rangeCall) + + override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = + InArrayIndicesGenerator(codegen, operatorReference, rangeCall) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayRangeValue.kt new file mode 100644 index 00000000000..bfd1a54ada1 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ArrayRangeValue.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInArrayLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression + +class ArrayRangeValue : RangeValue { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInArrayLoopGenerator(codegen, forExpression) + + override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = + CallBasedInExpressionGenerator(codegen, operatorReference) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CallIntrinsicRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CallIntrinsicRangeValue.kt new file mode 100644 index 00000000000..f96cb6ea75f --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CallIntrinsicRangeValue.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCallWithAssert +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +abstract class CallIntrinsicRangeValue(protected val rangeCall: ResolvedCall): RangeValue { + protected abstract fun isIntrinsicInCall(resolvedCallForIn: ResolvedCall): Boolean + + protected abstract fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator + + override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator { + val resolvedCall = operatorReference.getResolvedCallWithAssert(codegen.bindingContext) + return if (isIntrinsicInCall(resolvedCall)) + createIntrinsicInExpressionGenerator(codegen, operatorReference) + else + CallBasedInExpressionGenerator(codegen, operatorReference) + } +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceIndicesRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceIndicesRangeValue.kt new file mode 100644 index 00000000000..5935705ca19 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceIndicesRangeValue.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInCharSequenceIndicesRangeLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InCharSequenceIndicesGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +class CharSequenceIndicesRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInCharSequenceIndicesRangeLoopGenerator(codegen, forExpression, rangeCall) + + override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = + InCharSequenceIndicesGenerator(codegen, operatorReference, rangeCall) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceRangeValue.kt new file mode 100644 index 00000000000..2bbe5cbebf4 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CharSequenceRangeValue.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInCharSequenceLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression + +class CharSequenceRangeValue : RangeValue { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInCharSequenceLoopGenerator(codegen, forExpression) + + override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = + CallBasedInExpressionGenerator(codegen, operatorReference) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CollectionIndicesRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CollectionIndicesRangeValue.kt new file mode 100644 index 00000000000..ba3b7210b7c --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CollectionIndicesRangeValue.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInCollectionIndicesRangeLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InCollectionIndicesGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +class CollectionIndicesRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInCollectionIndicesRangeLoopGenerator(codegen, forExpression, rangeCall) + + override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = + InCollectionIndicesGenerator(codegen, operatorReference, rangeCall) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ComparableRangeLiteralRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ComparableRangeLiteralRangeValue.kt new file mode 100644 index 00000000000..bc2f6fd493b --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/ComparableRangeLiteralRangeValue.kt @@ -0,0 +1,37 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.IteratorForLoopGenerator +import org.jetbrains.kotlin.codegen.isClosedRangeContains +import org.jetbrains.kotlin.codegen.range.inExpression.InComparableRangeLiteralGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +class ComparableRangeLiteralRangeValue(rangeCall: ResolvedCall): CallIntrinsicRangeValue(rangeCall) { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + IteratorForLoopGenerator(codegen, forExpression) + + override fun isIntrinsicInCall(resolvedCallForIn: ResolvedCall) = + isClosedRangeContains(resolvedCallForIn.resultingDescriptor) + + override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression)= + InComparableRangeLiteralGenerator(codegen, operatorReference, rangeCall) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/DownToProgressionRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/DownToProgressionRangeValue.kt new file mode 100644 index 00000000000..dd7fc915885 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/DownToProgressionRangeValue.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInDownToProgressionLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InPrimitiveNumberDownToGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +class DownToProgressionRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInDownToProgressionLoopGenerator(codegen, forExpression, rangeCall) + + override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = + InPrimitiveNumberDownToGenerator(codegen, operatorReference, rangeCall) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/IterableRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/IterableRangeValue.kt new file mode 100644 index 00000000000..0c13390d2d7 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/IterableRangeValue.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.IteratorForLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression + +class IterableRangeValue : RangeValue { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + IteratorForLoopGenerator(codegen, forExpression) + + override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = + CallBasedInExpressionGenerator(codegen, operatorReference) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeIntrinsicRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeIntrinsicRangeValue.kt new file mode 100644 index 00000000000..a48c8c2f666 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeIntrinsicRangeValue.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.isClosedFloatingPointRangeContains +import org.jetbrains.kotlin.codegen.isIntPrimitiveRangeExtensionForInt +import org.jetbrains.kotlin.codegen.isPrimitiveRangeContains +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +abstract class PrimitiveNumberRangeIntrinsicRangeValue(rangeCall: ResolvedCall): CallIntrinsicRangeValue(rangeCall) { + override fun isIntrinsicInCall(resolvedCallForIn: ResolvedCall) = + resolvedCallForIn.resultingDescriptor.let { + isPrimitiveRangeContains(it) || + isClosedFloatingPointRangeContains(it) || + isIntPrimitiveRangeExtensionForInt(it) + } +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeLiteralRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeLiteralRangeValue.kt new file mode 100644 index 00000000000..ed66de564a6 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberRangeLiteralRangeValue.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInRangeLiteralLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InPrimitiveNumberRangeLiteralGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +class PrimitiveNumberRangeLiteralRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInRangeLiteralLoopGenerator(codegen, forExpression, rangeCall) + + override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = + InPrimitiveNumberRangeLiteralGenerator(codegen, operatorReference, rangeCall) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberUntilRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberUntilRangeValue.kt new file mode 100644 index 00000000000..001645b3e2d --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveNumberUntilRangeValue.kt @@ -0,0 +1,33 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInUntilRangeLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InPrimitiveNumberUntilGenerator +import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression +import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall + +class PrimitiveNumberUntilRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInUntilRangeLoopGenerator(codegen, forExpression, rangeCall) + + override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = + InPrimitiveNumberUntilGenerator(codegen, operatorReference, rangeCall) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveProgressionRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveProgressionRangeValue.kt new file mode 100644 index 00000000000..f2019eda3dc --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveProgressionRangeValue.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInProgressionExpressionLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression + +class PrimitiveProgressionRangeValue : RangeValue { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInProgressionExpressionLoopGenerator(codegen, forExpression) + + override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = + CallBasedInExpressionGenerator(codegen, operatorReference) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveRangeRangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveRangeRangeValue.kt new file mode 100644 index 00000000000..f8d93dfe8c4 --- /dev/null +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/PrimitiveRangeRangeValue.kt @@ -0,0 +1,32 @@ +/* + * Copyright 2010-2017 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.codegen.range + +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForInRangeInstanceLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.CallBasedInExpressionGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator +import org.jetbrains.kotlin.psi.KtForExpression +import org.jetbrains.kotlin.psi.KtSimpleNameExpression + +class PrimitiveRangeRangeValue : RangeValue { + override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = + ForInRangeInstanceLoopGenerator(codegen, forExpression) + + override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = + CallBasedInExpressionGenerator(codegen, operatorReference) +} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValue.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValue.kt index 4207a542fa2..c9ee51021ab 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValue.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/RangeValue.kt @@ -16,138 +16,14 @@ package org.jetbrains.kotlin.codegen.range -import org.jetbrains.kotlin.codegen.* -import org.jetbrains.kotlin.codegen.forLoop.* -import org.jetbrains.kotlin.descriptors.CallableDescriptor +import org.jetbrains.kotlin.codegen.ExpressionCodegen +import org.jetbrains.kotlin.codegen.range.forLoop.ForLoopGenerator +import org.jetbrains.kotlin.codegen.range.inExpression.InExpressionGenerator import org.jetbrains.kotlin.psi.KtForExpression import org.jetbrains.kotlin.psi.KtSimpleNameExpression -import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCallWithAssert -import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall interface RangeValue { fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression): ForLoopGenerator fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator } - -class ArrayRangeValue : RangeValue { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInArrayLoopGenerator(codegen, forExpression) - - override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = - CallBasedInExpressionGenerator(codegen, operatorReference) -} - -class PrimitiveRangeRangeValue : RangeValue { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInRangeInstanceLoopGenerator(codegen, forExpression) - - override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = - CallBasedInExpressionGenerator(codegen, operatorReference) -} - -class PrimitiveProgressionRangeValue : RangeValue { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInProgressionExpressionLoopGenerator(codegen, forExpression) - - override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = - CallBasedInExpressionGenerator(codegen, operatorReference) -} - -class CharSequenceRangeValue : RangeValue { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInCharSequenceLoopGenerator(codegen, forExpression) - - override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = - CallBasedInExpressionGenerator(codegen, operatorReference) -} - -class IterableRangeValue : RangeValue { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - IteratorForLoopGenerator(codegen, forExpression) - - override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator = - CallBasedInExpressionGenerator(codegen, operatorReference) -} - -abstract class CallIntrinsicRangeValue(protected val rangeCall: ResolvedCall): RangeValue { - protected abstract fun isIntrinsicInCall(resolvedCallForIn: ResolvedCall): Boolean - - protected abstract fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator - - override fun createInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression): InExpressionGenerator { - val resolvedCall = operatorReference.getResolvedCallWithAssert(codegen.bindingContext) - return if (isIntrinsicInCall(resolvedCall)) - createIntrinsicInExpressionGenerator(codegen, operatorReference) - else - CallBasedInExpressionGenerator(codegen, operatorReference) - } -} - -abstract class PrimitiveNumberRangeIntrinsicRangeValue(rangeCall: ResolvedCall): CallIntrinsicRangeValue(rangeCall) { - override fun isIntrinsicInCall(resolvedCallForIn: ResolvedCall) = - resolvedCallForIn.resultingDescriptor.let { - isPrimitiveRangeContains(it) || - isClosedFloatingPointRangeContains(it) || - isIntPrimitiveRangeExtensionForInt(it) - } -} - -class PrimitiveNumberRangeLiteralRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInRangeLiteralLoopGenerator(codegen, forExpression, rangeCall) - - override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = - InPrimitiveNumberRangeLiteralGenerator(codegen, operatorReference, rangeCall) -} - -class DownToProgressionRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInDownToProgressionLoopGenerator(codegen, forExpression, rangeCall) - - override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = - InPrimitiveNumberDownToGenerator(codegen, operatorReference, rangeCall) -} - -class PrimitiveNumberUntilRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInUntilRangeLoopGenerator(codegen, forExpression, rangeCall) - - override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = - InPrimitiveNumberUntilGenerator(codegen, operatorReference, rangeCall) -} - -class ArrayIndicesRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInArrayIndicesRangeLoopGenerator(codegen, forExpression, rangeCall) - - override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = - InArrayIndicesGenerator(codegen, operatorReference, rangeCall) -} - -class CollectionIndicesRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInCollectionIndicesRangeLoopGenerator(codegen, forExpression, rangeCall) - - override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = - InCollectionIndicesGenerator(codegen, operatorReference, rangeCall) -} - -class CharSequenceIndicesRangeValue(rangeCall: ResolvedCall): PrimitiveNumberRangeIntrinsicRangeValue(rangeCall) { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - ForInCharSequenceIndicesRangeLoopGenerator(codegen, forExpression, rangeCall) - - override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression) = - InCharSequenceIndicesGenerator(codegen, operatorReference, rangeCall) -} - -class ComparableRangeLiteralRangeValue(rangeCall: ResolvedCall): CallIntrinsicRangeValue(rangeCall) { - override fun createForLoopGenerator(codegen: ExpressionCodegen, forExpression: KtForExpression) = - IteratorForLoopGenerator(codegen, forExpression) - - override fun isIntrinsicInCall(resolvedCallForIn: ResolvedCall) = - isClosedRangeContains(resolvedCallForIn.resultingDescriptor) - - override fun createIntrinsicInExpressionGenerator(codegen: ExpressionCodegen, operatorReference: KtSimpleNameExpression)= - InComparableRangeLiteralGenerator(codegen, operatorReference, rangeCall) -} \ No newline at end of file diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInExclusiveRangeLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInExclusiveRangeLoopGenerator.kt similarity index 94% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInExclusiveRangeLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInExclusiveRangeLoopGenerator.kt index 11847e3329f..be62606634d 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInExclusiveRangeLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInExclusiveRangeLoopGenerator.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen -import org.jetbrains.kotlin.codegen.StackValue import org.jetbrains.kotlin.psi.KtForExpression import org.jetbrains.org.objectweb.asm.Label import org.jetbrains.org.objectweb.asm.Type diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInProgressionLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInProgressionLoopGenerator.kt similarity index 98% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInProgressionLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInProgressionLoopGenerator.kt index 4c63fafee72..5bd35cda8e9 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInProgressionLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInProgressionLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInProgressionOrRangeLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInProgressionOrRangeLoopGenerator.kt similarity index 97% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInProgressionOrRangeLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInProgressionOrRangeLoopGenerator.kt index 3235b9ec475..38f5f8aa1bb 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInProgressionOrRangeLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInProgressionOrRangeLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInRangeLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInRangeLoopGenerator.kt similarity index 98% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInRangeLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInRangeLoopGenerator.kt index 57bc17aef0c..2a375ebceaa 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInRangeLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInRangeLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.psi.KtForExpression import org.jetbrains.org.objectweb.asm.Label diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInRangeWithGivenBoundsLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInRangeWithGivenBoundsLoopGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInRangeWithGivenBoundsLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInRangeWithGivenBoundsLoopGenerator.kt index ad873d95e73..0a0ed5c7ca3 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForInRangeWithGivenBoundsLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForInRangeWithGivenBoundsLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForLoopGenerator.kt similarity index 99% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForLoopGenerator.kt index eee21d5d097..6049e8f30df 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/AbstractForLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/AbstractForLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInArrayIndicesRangeLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInArrayIndicesRangeLoopGenerator.kt similarity index 95% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInArrayIndicesRangeLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInArrayIndicesRangeLoopGenerator.kt index ac392701033..d2913fe16c0 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInArrayIndicesRangeLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInArrayIndicesRangeLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.psi.KtForExpression diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInArrayLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInArrayLoopGenerator.kt similarity index 98% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInArrayLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInArrayLoopGenerator.kt index 9beb83d8941..3ba965e57fd 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInArrayLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInArrayLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.psi.KtForExpression diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCharSequenceIndicesRangeLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCharSequenceIndicesRangeLoopGenerator.kt similarity index 95% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCharSequenceIndicesRangeLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCharSequenceIndicesRangeLoopGenerator.kt index b1a872098aa..6a94c9f085c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCharSequenceIndicesRangeLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCharSequenceIndicesRangeLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.psi.KtForExpression diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCharSequenceLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCharSequenceLoopGenerator.kt similarity index 98% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCharSequenceLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCharSequenceLoopGenerator.kt index 15b015b440a..43fdc0aa4c1 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCharSequenceLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCharSequenceLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCollectionIndicesRangeLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCollectionIndicesRangeLoopGenerator.kt similarity index 95% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCollectionIndicesRangeLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCollectionIndicesRangeLoopGenerator.kt index 18cf117b8b8..21783d2d4ad 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInCollectionIndicesRangeLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInCollectionIndicesRangeLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.psi.KtForExpression diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInDownToProgressionLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInDownToProgressionLoopGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInDownToProgressionLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInDownToProgressionLoopGenerator.kt index 62e59c4d6ed..204f46e724e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInDownToProgressionLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInDownToProgressionLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInOptimizedIndicesLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInOptimizedIndicesLoopGenerator.kt similarity index 97% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInOptimizedIndicesLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInOptimizedIndicesLoopGenerator.kt index 36cf35bf794..cbd7b01e363 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInOptimizedIndicesLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInOptimizedIndicesLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInProgressionExpressionLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInProgressionExpressionLoopGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInProgressionExpressionLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInProgressionExpressionLoopGenerator.kt index f4cfaad2f70..7d3417121f9 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInProgressionExpressionLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInProgressionExpressionLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.psi.KtForExpression diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInRangeInstanceLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInRangeInstanceLoopGenerator.kt similarity index 94% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInRangeInstanceLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInRangeInstanceLoopGenerator.kt index 4695c6d43ce..f62c6bcccf7 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInRangeInstanceLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInRangeInstanceLoopGenerator.kt @@ -14,10 +14,9 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen -import org.jetbrains.kotlin.codegen.StackValue import org.jetbrains.kotlin.psi.KtForExpression class ForInRangeInstanceLoopGenerator( diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInRangeLiteralLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInRangeLiteralLoopGenerator.kt similarity index 97% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInRangeLiteralLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInRangeLiteralLoopGenerator.kt index 01b24334f9d..7622436d4f1 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInRangeLiteralLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInRangeLiteralLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInUntilRangeLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInUntilRangeLoopGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInUntilRangeLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInUntilRangeLoopGenerator.kt index 35679aa4867..0224e91e7fa 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForInUntilRangeLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForInUntilRangeLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForLoopGenerator.kt similarity index 94% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForLoopGenerator.kt index ab686c23f56..24ebdd3c0c2 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/ForLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/ForLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.psi.KtForExpression import org.jetbrains.org.objectweb.asm.Label diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/IteratorForLoopGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/IteratorForLoopGenerator.kt similarity index 98% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/IteratorForLoopGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/IteratorForLoopGenerator.kt index cdf3aff4750..be523e12cf5 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/forLoop/IteratorForLoopGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/forLoop/IteratorForLoopGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.forLoop +package org.jetbrains.kotlin.codegen.range.forLoop import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/AbstractInPrimitiveNumberRangeExpressionGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/AbstractInPrimitiveNumberRangeExpressionGenerator.kt similarity index 98% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/AbstractInPrimitiveNumberRangeExpressionGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/AbstractInPrimitiveNumberRangeExpressionGenerator.kt index e9f8408c795..ddf738a7b22 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/AbstractInPrimitiveNumberRangeExpressionGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/AbstractInPrimitiveNumberRangeExpressionGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.codegen.ExpressionCodegen diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/AbstractInRangeWithKnownBoundsExpressionGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/AbstractInRangeWithKnownBoundsExpressionGenerator.kt similarity index 98% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/AbstractInRangeWithKnownBoundsExpressionGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/AbstractInRangeWithKnownBoundsExpressionGenerator.kt index 1dac14be8ba..08a8e5e4950 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/AbstractInRangeWithKnownBoundsExpressionGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/AbstractInRangeWithKnownBoundsExpressionGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.* import org.jetbrains.kotlin.lexer.KtTokens diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CallBasedInExpressionGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.kt similarity index 93% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/CallBasedInExpressionGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.kt index 76f44d8fcdc..7228825be19 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/CallBasedInExpressionGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.kt @@ -14,14 +14,12 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.* -import org.jetbrains.kotlin.descriptors.CallableDescriptor import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.KtSimpleNameExpression import org.jetbrains.kotlin.resolve.calls.callUtil.getResolvedCallWithAssert -import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall import org.jetbrains.org.objectweb.asm.Label import org.jetbrains.org.objectweb.asm.Opcodes import org.jetbrains.org.objectweb.asm.Type diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InArrayIndicesGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InArrayIndicesGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InArrayIndicesGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InArrayIndicesGenerator.kt index e893512ce88..59d45fb07a6 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InArrayIndicesGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InArrayIndicesGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InCharSequenceIndicesGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InCharSequenceIndicesGenerator.kt similarity index 97% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InCharSequenceIndicesGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InCharSequenceIndicesGenerator.kt index ffc34baee28..a012bae07a6 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InCharSequenceIndicesGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InCharSequenceIndicesGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InCollectionIndicesGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InCollectionIndicesGenerator.kt similarity index 97% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InCollectionIndicesGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InCollectionIndicesGenerator.kt index 0dd8d9234df..87eadd80844 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InCollectionIndicesGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InCollectionIndicesGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InComparableRangeLiteralGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InComparableRangeLiteralGenerator.kt similarity index 97% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InComparableRangeLiteralGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InComparableRangeLiteralGenerator.kt index ed1f5925915..ecc4907a507 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InComparableRangeLiteralGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InComparableRangeLiteralGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InExpressionGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InExpressionGenerator.kt similarity index 93% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InExpressionGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InExpressionGenerator.kt index 75a2509add7..0c7f7130232 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InExpressionGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InExpressionGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.BranchedValue import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberDownToGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberDownToGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberDownToGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberDownToGenerator.kt index e2b018a32a7..b40bf3abab6 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberDownToGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberDownToGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberRangeLiteralGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberRangeLiteralGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberRangeLiteralGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberRangeLiteralGenerator.kt index 10f86a8f70f..a3e6e2d0acd 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberRangeLiteralGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberRangeLiteralGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberUntilGenerator.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberUntilGenerator.kt similarity index 96% rename from compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberUntilGenerator.kt rename to compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberUntilGenerator.kt index 0a1c89edcba..78e2eb40776 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/range/InPrimitiveNumberUntilGenerator.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/range/inExpression/InPrimitiveNumberUntilGenerator.kt @@ -14,7 +14,7 @@ * limitations under the License. */ -package org.jetbrains.kotlin.codegen.range +package org.jetbrains.kotlin.codegen.range.inExpression import org.jetbrains.kotlin.codegen.ExpressionCodegen import org.jetbrains.kotlin.codegen.StackValue