From c6b259c36cbb944f7500ab46c9eca87e7baf6d98 Mon Sep 17 00:00:00 2001 From: Dmitry Petrov Date: Fri, 10 Mar 2017 10:53:44 +0300 Subject: [PATCH] IrSymbol interface hierarchy, initial import "Symbols" are (presumably simpler) alternative to descriptors, tailored for IR-based back-end implementation. --- .../{IrGeneralFunction.kt => IrFunction.kt} | 0 .../ir/declarations/impl/IrFunctionBase.kt | 5 ++- .../impl/IrGeneralFunctionBase.kt | 35 ----------------- .../symbols/IrAnonymousInitializerSymbol.kt | 23 +++++++++++ .../kotlin/ir/symbols/IrCallSignature.kt | 26 +++++++++++++ .../kotlin/ir/symbols/IrCallableSymbol.kt | 27 +++++++++++++ .../kotlin/ir/symbols/IrClassSymbol.kt | 30 +++++++++++++++ .../kotlin/ir/symbols/IrClassifierSymbol.kt | 22 +++++++++++ .../kotlin/ir/symbols/IrConstructorSymbol.kt | 23 +++++++++++ .../kotlin/ir/symbols/IrDeclarationSymbol.kt | 24 ++++++++++++ .../kotlin/ir/symbols/IrEnumEntrySymbol.kt | 25 ++++++++++++ .../kotlin/ir/symbols/IrFieldSymbol.kt | 27 +++++++++++++ .../kotlin/ir/symbols/IrFileSymbol.kt | 26 +++++++++++++ .../kotlin/ir/symbols/IrFunctionSymbol.kt | 21 ++++++++++ .../kotlin/ir/symbols/IrMemberSymbol.kt | 25 ++++++++++++ .../kotlin/ir/symbols/IrNamedSymbol.kt | 23 +++++++++++ .../jetbrains/kotlin/ir/symbols/IrSymbol.kt | 25 ++++++++++++ .../ir/symbols/IrTypeParameterSymbol.kt | 30 +++++++++++++++ .../ir/symbols/IrValueParameterSymbol.kt | 24 ++++++++++++ .../kotlin/ir/symbols/IrValueSymbol.kt | 24 ++++++++++++ .../kotlin/ir/symbols/IrVariableSymbol.kt | 25 ++++++++++++ .../impl/IrAnonymousInitializerSymbolImpl.kt | 28 ++++++++++++++ .../ir/symbols/impl/IrCallableSymbolBase.kt | 32 ++++++++++++++++ .../ir/symbols/impl/IrClassSymbolImpl.kt | 37 ++++++++++++++++++ .../ir/symbols/impl/IrClassifierSymbolBase.kt | 29 ++++++++++++++ .../symbols/impl/IrConstructorSymbolImpl.kt | 33 ++++++++++++++++ .../symbols/impl/IrDeclarationSymbolBase.kt | 24 ++++++++++++ .../ir/symbols/impl/IrEnumEntrySymbolImpl.kt | 32 ++++++++++++++++ .../ir/symbols/impl/IrFieldSymbolImpl.kt | 34 +++++++++++++++++ .../ir/symbols/impl/IrFileSymbolImpl.kt | 28 ++++++++++++++ .../ir/symbols/impl/IrFunctionSymbolImpl.kt | 37 ++++++++++++++++++ .../ir/symbols/impl/IrMemberSymbolBase.kt | 33 ++++++++++++++++ .../ir/symbols/impl/IrNamedSymbolBase.kt | 24 ++++++++++++ .../kotlin/ir/symbols/impl/IrSymbolBase.kt | 25 ++++++++++++ .../symbols/impl/IrTypeParameterSymbolImpl.kt | 38 +++++++++++++++++++ .../impl/IrValueParameterSymbolImpl.kt | 30 +++++++++++++++ .../ir/symbols/impl/IrValueSymbolBase.kt | 27 +++++++++++++ .../ir/symbols/impl/IrVariableSymbolImpl.kt | 30 +++++++++++++++ 38 files changed, 975 insertions(+), 36 deletions(-) rename compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/{IrGeneralFunction.kt => IrFunction.kt} (100%) delete mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrGeneralFunctionBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallSignature.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallableSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassifierSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrConstructorSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrDeclarationSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFieldSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFileSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFunctionSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrMemberSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrNamedSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrVariableSymbol.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrAnonymousInitializerSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrCallableSymbolBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassifierSymbolBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrConstructorSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrDeclarationSymbolBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrEnumEntrySymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFieldSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFileSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFunctionSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrMemberSymbolBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrNamedSymbolBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrSymbolBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrTypeParameterSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueParameterSymbolImpl.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueSymbolBase.kt create mode 100644 compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrVariableSymbolImpl.kt diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrGeneralFunction.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt similarity index 100% rename from compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrGeneralFunction.kt rename to compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/IrFunction.kt diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionBase.kt index 53aa60feca3..9f6b0b33e0e 100644 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionBase.kt +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrFunctionBase.kt @@ -19,6 +19,7 @@ package org.jetbrains.kotlin.ir.declarations.impl import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.expressions.IrBody import org.jetbrains.kotlin.ir.expressions.IrExpressionBody import org.jetbrains.kotlin.ir.visitors.IrElementTransformer import org.jetbrains.kotlin.ir.visitors.IrElementVisitor @@ -28,9 +29,11 @@ abstract class IrFunctionBase( startOffset: Int, endOffset: Int, origin: IrDeclarationOrigin -) : IrGeneralFunctionBase(startOffset, endOffset, origin), IrFunction { +) : IrDeclarationBase(startOffset, endOffset, origin), IrFunction { private val defaults = LinkedHashMap() + final override var body: IrBody? = null + override fun getDefault(parameter: ValueParameterDescriptor): IrExpressionBody? = defaults[parameter] diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrGeneralFunctionBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrGeneralFunctionBase.kt deleted file mode 100644 index 92488527e01..00000000000 --- a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/declarations/impl/IrGeneralFunctionBase.kt +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2010-2016 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.ir.declarations.impl - -import org.jetbrains.kotlin.ir.* -import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin -import org.jetbrains.kotlin.ir.declarations.IrFunction -import org.jetbrains.kotlin.ir.expressions.IrBody -import org.jetbrains.kotlin.ir.visitors.IrElementVisitor - -abstract class IrGeneralFunctionBase( - startOffset: Int, - endOffset: Int, - origin: IrDeclarationOrigin -) : IrDeclarationBase(startOffset, endOffset, origin), IrFunction { - final override var body: IrBody? = null - - override fun acceptChildren(visitor: IrElementVisitor, data: D) { - body?.accept(visitor, data) - } -} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol.kt new file mode 100644 index 00000000000..ffe5f9ed1b5 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrAnonymousInitializerSymbol.kt @@ -0,0 +1,23 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer + +interface IrAnonymousInitializerSymbol : IrDeclarationSymbol { + override val declaration: IrAnonymousInitializer +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallSignature.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallSignature.kt new file mode 100644 index 00000000000..8575868e003 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallSignature.kt @@ -0,0 +1,26 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.types.KotlinType + +interface IrCallSignature { + val dispatchReceiverType: KotlinType? + val extensionReceiverType: KotlinType? + val valueParameterTypes: List + val returnType: KotlinType +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallableSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallableSymbol.kt new file mode 100644 index 00000000000..a5065cc8533 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrCallableSymbol.kt @@ -0,0 +1,27 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.types.KotlinType + +interface IrCallableSymbol : IrMemberSymbol { + override val declaration: IrFunction + + val returnType: KotlinType +} + diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassSymbol.kt new file mode 100644 index 00000000000..cafaa6825a8 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassSymbol.kt @@ -0,0 +1,30 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.types.KotlinType + +interface IrClassSymbol : IrClassifierSymbol { + override val declaration: IrClass + + val kind: ClassKind + val supertypes: List + val isCompanionObject: Boolean + val isData: Boolean +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassifierSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassifierSymbol.kt new file mode 100644 index 00000000000..98d827b0960 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrClassifierSymbol.kt @@ -0,0 +1,22 @@ +/* + * 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.ir.symbols + +interface IrClassifierSymbol : IrMemberSymbol { + // TODO type constructor for symbols? + // val typeConstructor: TypeConstructor +} diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrConstructorSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrConstructorSymbol.kt new file mode 100644 index 00000000000..b04cb466df6 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrConstructorSymbol.kt @@ -0,0 +1,23 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrConstructor + +interface IrConstructorSymbol : IrCallableSymbol { + override val declaration: IrConstructor +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrDeclarationSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrDeclarationSymbol.kt new file mode 100644 index 00000000000..7a456f0e735 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrDeclarationSymbol.kt @@ -0,0 +1,24 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrDeclaration + +interface IrDeclarationSymbol : IrSymbol { + val declaration: IrDeclaration + val container: IrSymbol +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol.kt new file mode 100644 index 00000000000..bf211266485 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrEnumEntrySymbol.kt @@ -0,0 +1,25 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrEnumEntry + +interface IrEnumEntrySymbol : IrMemberSymbol { + override val declaration: IrEnumEntry + + val ordinal: Int +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFieldSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFieldSymbol.kt new file mode 100644 index 00000000000..d8bfdced6e2 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFieldSymbol.kt @@ -0,0 +1,27 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrField +import org.jetbrains.kotlin.types.KotlinType + +interface IrFieldSymbol : IrMemberSymbol { + override val declaration: IrField + + val type: KotlinType + val isMutable: Boolean +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFileSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFileSymbol.kt new file mode 100644 index 00000000000..20333c51dc8 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFileSymbol.kt @@ -0,0 +1,26 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.name.FqName + +interface IrFileSymbol : IrSymbol { + val fileName: String + val packageFqName: FqName + val element: IrFile +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFunctionSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFunctionSymbol.kt new file mode 100644 index 00000000000..891e2ece9fb --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrFunctionSymbol.kt @@ -0,0 +1,21 @@ +/* + * 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.ir.symbols + +interface IrFunctionSymbol : IrCallableSymbol { + val overridden: List +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrMemberSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrMemberSymbol.kt new file mode 100644 index 00000000000..2badecb5bbb --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrMemberSymbol.kt @@ -0,0 +1,25 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility + +interface IrMemberSymbol : IrNamedSymbol { + val modality: Modality + val visibility: Visibility +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrNamedSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrNamedSymbol.kt new file mode 100644 index 00000000000..32b8dcf1fea --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrNamedSymbol.kt @@ -0,0 +1,23 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.name.Name + +interface IrNamedSymbol : IrDeclarationSymbol { + val name: Name +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt new file mode 100644 index 00000000000..90a91491cc6 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrSymbol.kt @@ -0,0 +1,25 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor + +interface IrSymbol { + val annotations: MutableList +} + + diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol.kt new file mode 100644 index 00000000000..16b76370a67 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrTypeParameterSymbol.kt @@ -0,0 +1,30 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.Variance + +interface IrTypeParameterSymbol : IrClassifierSymbol { + // TODO IrTypeParameter + // override val declaration: IrTypeParameter + + val isReified: Boolean + val variance: Variance + val upperBounds: List + val index: Int +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol.kt new file mode 100644 index 00000000000..9b4cb16ab25 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueParameterSymbol.kt @@ -0,0 +1,24 @@ +/* + * 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.ir.symbols + +interface IrValueParameterSymbol : IrValueSymbol { + // TODO IrValueParameter + // override val declaration: IrValueParameter + + val index: Int +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueSymbol.kt new file mode 100644 index 00000000000..591455494c8 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrValueSymbol.kt @@ -0,0 +1,24 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.types.KotlinType + +interface IrValueSymbol : IrNamedSymbol { + val type: KotlinType +} + diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrVariableSymbol.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrVariableSymbol.kt new file mode 100644 index 00000000000..98fc262bc67 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/IrVariableSymbol.kt @@ -0,0 +1,25 @@ +/* + * 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.ir.symbols + +import org.jetbrains.kotlin.ir.declarations.IrVariable + +interface IrVariableSymbol : IrValueSymbol { + override val declaration: IrVariable + + val isMutable: Boolean +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrAnonymousInitializerSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrAnonymousInitializerSymbolImpl.kt new file mode 100644 index 00000000000..edd9c569e99 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrAnonymousInitializerSymbolImpl.kt @@ -0,0 +1,28 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.ir.declarations.IrAnonymousInitializer +import org.jetbrains.kotlin.ir.symbols.IrAnonymousInitializerSymbol + +class IrAnonymousInitializerSymbolImpl() : IrDeclarationSymbolBase(), IrAnonymousInitializerSymbol { + override lateinit var declaration: IrAnonymousInitializer + + constructor(declaration: IrAnonymousInitializer) : this() { + this.declaration = declaration + } +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrCallableSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrCallableSymbolBase.kt new file mode 100644 index 00000000000..b3823877573 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrCallableSymbolBase.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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.symbols.IrCallableSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType + +abstract class IrCallableSymbolBase( + name: Name, + modality: Modality, + visibility: Visibility, + override val returnType: KotlinType +) : IrMemberSymbolBase(name, modality, visibility), IrCallableSymbol + + diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassSymbolImpl.kt new file mode 100644 index 00000000000..1a935e81685 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassSymbolImpl.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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.ClassKind +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.declarations.IrClass +import org.jetbrains.kotlin.ir.symbols.IrClassSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType + +class IrClassSymbolImpl( + name: Name, + modality: Modality, + visibility: Visibility, + override val kind: ClassKind, + override val supertypes: List, + override val isData: Boolean, + override val isCompanionObject: Boolean +) : IrClassifierSymbolBase(name, modality, visibility), IrClassSymbol { + override lateinit var declaration: IrClass +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassifierSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassifierSymbolBase.kt new file mode 100644 index 00000000000..48443dee6ff --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrClassifierSymbolBase.kt @@ -0,0 +1,29 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.symbols.IrClassifierSymbol +import org.jetbrains.kotlin.name.Name + +abstract class IrClassifierSymbolBase( + name: Name, + modality: Modality, + visibility: Visibility +) : IrMemberSymbolBase(name, modality, visibility), + IrClassifierSymbol diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrConstructorSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrConstructorSymbolImpl.kt new file mode 100644 index 00000000000..056b20d289b --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrConstructorSymbolImpl.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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.declarations.IrConstructor +import org.jetbrains.kotlin.ir.symbols.IrConstructorSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType + +class IrConstructorSymbolImpl( + name: Name, + modality: Modality, + visibility: Visibility, + returnType: KotlinType +) : IrCallableSymbolBase(name, modality, visibility, returnType), IrConstructorSymbol { + override lateinit var declaration: IrConstructor +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrDeclarationSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrDeclarationSymbolBase.kt new file mode 100644 index 00000000000..986054d1772 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrDeclarationSymbolBase.kt @@ -0,0 +1,24 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.ir.symbols.IrDeclarationSymbol +import org.jetbrains.kotlin.ir.symbols.IrSymbol + +abstract class IrDeclarationSymbolBase : IrSymbolBase(), IrDeclarationSymbol { + override final lateinit var container: IrSymbol +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrEnumEntrySymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrEnumEntrySymbolImpl.kt new file mode 100644 index 00000000000..f090c3209cc --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrEnumEntrySymbolImpl.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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.declarations.IrEnumEntry +import org.jetbrains.kotlin.ir.symbols.IrEnumEntrySymbol +import org.jetbrains.kotlin.name.Name + +class IrEnumEntrySymbolImpl( + name: Name, + modality: Modality, + visibility: Visibility, + override val ordinal: Int +) : IrMemberSymbolBase(name, modality, visibility), IrEnumEntrySymbol { + override lateinit var declaration: IrEnumEntry +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFieldSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFieldSymbolImpl.kt new file mode 100644 index 00000000000..b7b52173015 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFieldSymbolImpl.kt @@ -0,0 +1,34 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.declarations.IrField +import org.jetbrains.kotlin.ir.symbols.IrFieldSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType + +class IrFieldSymbolImpl( + name: Name, + modality: Modality, + visibility: Visibility, + override val type: KotlinType, + override val isMutable: Boolean +) : IrMemberSymbolBase(name, modality, visibility), IrFieldSymbol { + override lateinit var declaration: IrField +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFileSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFileSymbolImpl.kt new file mode 100644 index 00000000000..4b5f95da806 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFileSymbolImpl.kt @@ -0,0 +1,28 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.ir.declarations.IrFile +import org.jetbrains.kotlin.ir.symbols.IrFileSymbol +import org.jetbrains.kotlin.name.FqName + +class IrFileSymbolImpl( + override val fileName: String, + override val packageFqName: FqName +) : IrSymbolBase(), IrFileSymbol { + override lateinit var element: IrFile +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFunctionSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFunctionSymbolImpl.kt new file mode 100644 index 00000000000..5d1d7239b17 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrFunctionSymbolImpl.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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.declarations.IrFunction +import org.jetbrains.kotlin.ir.symbols.IrFunctionSymbol +import org.jetbrains.kotlin.ir.symbols.IrSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.utils.SmartList + +class IrFunctionSymbolImpl( + name: Name, + modality: Modality, + visibility: Visibility, + returnType: KotlinType +) : IrCallableSymbolBase(name, modality, visibility, returnType), IrFunctionSymbol { + override lateinit var declaration: IrFunction + + override val overridden: MutableList = SmartList() +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrMemberSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrMemberSymbolBase.kt new file mode 100644 index 00000000000..12e26b6ac6f --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrMemberSymbolBase.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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.symbols.IrMemberSymbol +import org.jetbrains.kotlin.ir.symbols.IrSymbol +import org.jetbrains.kotlin.name.Name + +abstract class IrMemberSymbolBase( + name: Name, + override val modality: Modality, + override val visibility: Visibility +) : IrNamedSymbolBase(name), IrMemberSymbol { + constructor(name: Name, modality: Modality, visibility: Visibility, container: IrSymbol) : this(name, modality, visibility) { + this.container = container + } +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrNamedSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrNamedSymbolBase.kt new file mode 100644 index 00000000000..7488e1c78ce --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrNamedSymbolBase.kt @@ -0,0 +1,24 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.ir.symbols.IrNamedSymbol +import org.jetbrains.kotlin.name.Name + +abstract class IrNamedSymbolBase( + override val name: Name +) : IrDeclarationSymbolBase(), IrNamedSymbol \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrSymbolBase.kt new file mode 100644 index 00000000000..6eee6071cbf --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrSymbolBase.kt @@ -0,0 +1,25 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor +import org.jetbrains.kotlin.ir.symbols.IrSymbol +import org.jetbrains.kotlin.utils.SmartList + +abstract class IrSymbolBase : IrSymbol { + override val annotations: MutableList = SmartList() +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrTypeParameterSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrTypeParameterSymbolImpl.kt new file mode 100644 index 00000000000..c269609d3d8 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrTypeParameterSymbolImpl.kt @@ -0,0 +1,38 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.descriptors.Modality +import org.jetbrains.kotlin.descriptors.Visibility +import org.jetbrains.kotlin.ir.declarations.IrDeclaration +import org.jetbrains.kotlin.ir.symbols.IrTypeParameterSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType +import org.jetbrains.kotlin.types.Variance + +class IrTypeParameterSymbolImpl( + name: Name, + modality: Modality, + visibility: Visibility, + override val variance: Variance, + override val upperBounds: List, + override val index: Int, + override val isReified: Boolean +) : IrClassifierSymbolBase(name, modality, visibility), IrTypeParameterSymbol { + // TODO IrTypeParameter + override lateinit var declaration: IrDeclaration +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueParameterSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueParameterSymbolImpl.kt new file mode 100644 index 00000000000..35e441ead84 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueParameterSymbolImpl.kt @@ -0,0 +1,30 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.ir.declarations.IrDeclaration +import org.jetbrains.kotlin.ir.symbols.IrValueParameterSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType + +class IrValueParameterSymbolImpl( + name: Name, + type: KotlinType, + override val index: Int +) : IrValueSymbolBase(name, type), IrValueParameterSymbol { + override lateinit var declaration: IrDeclaration +} \ No newline at end of file diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueSymbolBase.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueSymbolBase.kt new file mode 100644 index 00000000000..7337be089e8 --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrValueSymbolBase.kt @@ -0,0 +1,27 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.ir.symbols.IrValueSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType + +abstract class IrValueSymbolBase( + name: Name, + override val type: KotlinType +) : IrNamedSymbolBase(name), IrValueSymbol + diff --git a/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrVariableSymbolImpl.kt b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrVariableSymbolImpl.kt new file mode 100644 index 00000000000..6dc32fa16bb --- /dev/null +++ b/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/symbols/impl/IrVariableSymbolImpl.kt @@ -0,0 +1,30 @@ +/* + * 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.ir.symbols.impl + +import org.jetbrains.kotlin.ir.declarations.IrVariable +import org.jetbrains.kotlin.ir.symbols.IrVariableSymbol +import org.jetbrains.kotlin.name.Name +import org.jetbrains.kotlin.types.KotlinType + +class IrVariableSymbolImpl( + name: Name, + type: KotlinType, + override val isMutable: Boolean +) : IrValueSymbolBase(name, type), IrVariableSymbol { + override lateinit var declaration: IrVariable +} \ No newline at end of file