File tree Expand file tree Collapse file tree 6 files changed +57
-0
lines changed
java/kotlin-extractor/src/main/kotlin/utils/versions/v_1_7_0-RC Expand file tree Collapse file tree 6 files changed +57
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com.github.codeql.utils.versions
2
+
3
+ import com.github.codeql.KotlinUsesExtractor
4
+ import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator
5
+
6
+ fun <TIrStub > KotlinUsesExtractor.getIrStubFromDescriptor (generateStub : (DeclarationStubGenerator ) -> TIrStub ) : TIrStub ? {
7
+ logger.error(" Descriptors not yet supported for Kotlin 1.7" )
8
+ return null
9
+ }
Original file line number Diff line number Diff line change
1
+ package com.github.codeql.utils.versions
2
+
3
+ import org.jetbrains.kotlin.ir.IrFileEntry
4
+
5
+ typealias FileEntry = IrFileEntry
Original file line number Diff line number Diff line change
1
+ package com.github.codeql.utils.versions
2
+
3
+ import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
4
+
5
+ fun functionN (pluginContext : IrPluginContext ) = pluginContext.irBuiltIns::functionN
Original file line number Diff line number Diff line change
1
+ package com.github.codeql.utils.versions
2
+
3
+ import com.intellij.psi.PsiElement
4
+ import org.jetbrains.kotlin.backend.common.psi.PsiSourceManager
5
+ import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
6
+ import org.jetbrains.kotlin.ir.IrElement
7
+ import org.jetbrains.kotlin.ir.declarations.IrFile
8
+ import org.jetbrains.kotlin.psi.KtFile
9
+
10
+ class Psi2Ir : Psi2IrFacade {
11
+ override fun getKtFile (irFile : IrFile ): KtFile ? {
12
+ return irFile.getKtFile()
13
+ }
14
+
15
+ override fun findPsiElement (irElement : IrElement , irFile : IrFile ): PsiElement ? {
16
+ return PsiSourceManager .findPsiElement(irElement, irFile)
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ package com.github.codeql.utils.versions
2
+
3
+ import org.jetbrains.kotlin.backend.jvm.ir.isRawType
4
+ import org.jetbrains.kotlin.ir.types.IrSimpleType
5
+
6
+
7
+ fun IrSimpleType.isRawType () = this .isRawType()
Original file line number Diff line number Diff line change
1
+ package com.github.codeql.utils.versions
2
+
3
+ import org.jetbrains.kotlin.ir.types.IrType
4
+ import org.jetbrains.kotlin.ir.types.makeNotNull
5
+ import org.jetbrains.kotlin.ir.types.makeNullable
6
+
7
+ fun IrType.codeQlWithHasQuestionMark (b : Boolean ): IrType {
8
+ if (b) {
9
+ return this .makeNullable()
10
+ } else {
11
+ return this .makeNotNull()
12
+ }
13
+ }
You can’t perform that action at this time.
0 commit comments