mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
Kotlin: Change handling of version variants in build script
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.KotlinUsesExtractor
|
||||
import com.github.codeql.Severity
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun <TIrStub> KotlinUsesExtractor.getIrStubFromDescriptor(generateStub: (DeclarationStubGenerator) -> TIrStub) : TIrStub? =
|
||||
(pluginContext.symbolTable as? SymbolTable) ?.let {
|
||||
val stubGenerator = DeclarationStubGenerator(pluginContext.moduleDescriptor, it, pluginContext.languageVersionSettings)
|
||||
generateStub(stubGenerator)
|
||||
} ?: run {
|
||||
logger.error("Plugin context has no symbol table, couldn't get IR stub")
|
||||
null
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.SourceManager
|
||||
|
||||
typealias FileEntry = SourceManager.FileEntry
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
|
||||
fun functionN(pluginContext: IrPluginContext): (Int) -> IrClass {
|
||||
return { i -> pluginContext.irBuiltIns.functionFactory.functionN(i) }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.util.isSingleUnderscore
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun isUnderscoreParameter(vp: IrValueParameter) =
|
||||
try {
|
||||
DescriptorToSourceUtils.getSourceFromDescriptor(vp.descriptor)
|
||||
?.safeAs<KtParameter>()?.isSingleUnderscore == true
|
||||
} catch(e: NotImplementedError) {
|
||||
// Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
|
||||
// be applied to synthetic functions.
|
||||
false
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class Psi2Ir(private val logger: FileLogger) : Psi2IrFacade {
|
||||
override fun getKtFile(irFile: IrFile): KtFile? {
|
||||
logger.warn("Comment extraction is not supported for Kotlin < 1.5.20")
|
||||
return null
|
||||
}
|
||||
|
||||
override fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement? {
|
||||
logger.error("Attempted comment extraction for Kotlin < 1.5.20")
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.withHasQuestionMark
|
||||
|
||||
fun IrType.codeQlWithHasQuestionMark(b : Boolean): IrType {
|
||||
return this.withHasQuestionMark(b)
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.KotlinUsesExtractor
|
||||
import com.github.codeql.Severity
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun <TIrStub> KotlinUsesExtractor.getIrStubFromDescriptor(generateStub: (DeclarationStubGenerator) -> TIrStub) : TIrStub? =
|
||||
(pluginContext.symbolTable as? SymbolTable) ?.let {
|
||||
val stubGenerator = DeclarationStubGenerator(pluginContext.moduleDescriptor, it, pluginContext.languageVersionSettings)
|
||||
generateStub(stubGenerator)
|
||||
} ?: run {
|
||||
logger.error("Plugin context has no symbol table, couldn't get IR stub")
|
||||
null
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.SourceManager
|
||||
|
||||
typealias FileEntry = SourceManager.FileEntry
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
|
||||
fun functionN(pluginContext: IrPluginContext): (Int) -> IrClass {
|
||||
return { i -> pluginContext.irBuiltIns.functionFactory.functionN(i) }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.util.isSingleUnderscore
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun isUnderscoreParameter(vp: IrValueParameter) =
|
||||
try {
|
||||
DescriptorToSourceUtils.getSourceFromDescriptor(vp.descriptor)
|
||||
?.safeAs<KtParameter>()?.isSingleUnderscore == true
|
||||
} catch(e: NotImplementedError) {
|
||||
// Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
|
||||
// be applied to synthetic functions.
|
||||
false
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class Psi2Ir(private val logger: FileLogger) : Psi2IrFacade {
|
||||
override fun getKtFile(irFile: IrFile): KtFile? {
|
||||
logger.warn("Comment extraction is not supported for Kotlin < 1.5.20")
|
||||
return null
|
||||
}
|
||||
|
||||
override fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement? {
|
||||
logger.error("Attempted comment extraction for Kotlin < 1.5.20")
|
||||
return null
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.withHasQuestionMark
|
||||
|
||||
fun IrType.codeQlWithHasQuestionMark(b : Boolean): IrType {
|
||||
return this.withHasQuestionMark(b)
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
|
||||
fun functionN(pluginContext: IrPluginContext): (Int) -> IrClass {
|
||||
return { i -> pluginContext.irBuiltIns.functionFactory.functionN(i) }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.util.isSingleUnderscore
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun isUnderscoreParameter(vp: IrValueParameter) =
|
||||
try {
|
||||
DescriptorToSourceUtils.getSourceFromDescriptor(vp.descriptor)
|
||||
?.safeAs<KtParameter>()?.isSingleUnderscore == true
|
||||
} catch(e: NotImplementedError) {
|
||||
// Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
|
||||
// be applied to synthetic functions.
|
||||
false
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.withHasQuestionMark
|
||||
|
||||
fun IrType.codeQlWithHasQuestionMark(b : Boolean): IrType {
|
||||
return this.withHasQuestionMark(b)
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.KotlinUsesExtractor
|
||||
import com.github.codeql.Severity
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.psi2ir.generators.DeclarationStubGeneratorImpl
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun <TIrStub> KotlinUsesExtractor.getIrStubFromDescriptor(generateStub: (DeclarationStubGenerator) -> TIrStub) : TIrStub? =
|
||||
(pluginContext.symbolTable as? SymbolTable) ?.let {
|
||||
val stubGenerator = DeclarationStubGeneratorImpl(pluginContext.moduleDescriptor, it, pluginContext.languageVersionSettings)
|
||||
generateStub(stubGenerator)
|
||||
} ?: run {
|
||||
logger.error("Plugin context has no symbol table, couldn't get IR stub")
|
||||
null
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrFileEntry
|
||||
|
||||
typealias FileEntry = IrFileEntry
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
|
||||
fun functionN(pluginContext: IrPluginContext): (Int) -> IrClass {
|
||||
return { i -> pluginContext.irBuiltIns.functionFactory.functionN(i) }
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.util.isSingleUnderscore
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun isUnderscoreParameter(vp: IrValueParameter) =
|
||||
try {
|
||||
DescriptorToSourceUtils.getSourceFromDescriptor(vp.descriptor)
|
||||
?.safeAs<KtParameter>()?.isSingleUnderscore == true
|
||||
} catch(e: NotImplementedError) {
|
||||
// Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
|
||||
// be applied to synthetic functions.
|
||||
false
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.psi.PsiSourceManager
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class Psi2Ir(private val logger: FileLogger): Psi2IrFacade {
|
||||
override fun getKtFile(irFile: IrFile): KtFile? {
|
||||
return irFile.getKtFile()
|
||||
}
|
||||
|
||||
override fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement? {
|
||||
return PsiSourceManager.findPsiElement(irElement, irFile)
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.withHasQuestionMark
|
||||
|
||||
fun IrType.codeQlWithHasQuestionMark(b : Boolean): IrType {
|
||||
return this.withHasQuestionMark(b)
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrFileEntry
|
||||
|
||||
typealias FileEntry = IrFileEntry
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
import org.jetbrains.kotlin.resolve.DescriptorToSourceUtils
|
||||
import org.jetbrains.kotlin.resolve.calls.util.isSingleUnderscore
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun isUnderscoreParameter(vp: IrValueParameter) =
|
||||
try {
|
||||
DescriptorToSourceUtils.getSourceFromDescriptor(vp.descriptor)
|
||||
?.safeAs<KtParameter>()?.isSingleUnderscore == true
|
||||
} catch(e: NotImplementedError) {
|
||||
// Some kinds of descriptor throw in `getSourceFromDescriptor` as that method is not normally expected to
|
||||
// be applied to synthetic functions.
|
||||
false
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.psi.PsiSourceManager
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class Psi2Ir(private val logger: FileLogger): Psi2IrFacade {
|
||||
override fun getKtFile(irFile: IrFile): KtFile? {
|
||||
return irFile.getKtFile()
|
||||
}
|
||||
|
||||
override fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement? {
|
||||
return PsiSourceManager.findPsiElement(irElement, irFile)
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.withHasQuestionMark
|
||||
|
||||
fun IrType.codeQlWithHasQuestionMark(b : Boolean): IrType {
|
||||
return this.withHasQuestionMark(b)
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.KotlinUsesExtractor
|
||||
import com.github.codeql.Severity
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.util.DeclarationStubGenerator
|
||||
import org.jetbrains.kotlin.ir.util.SymbolTable
|
||||
import org.jetbrains.kotlin.psi2ir.generators.DeclarationStubGeneratorImpl
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun <TIrStub> KotlinUsesExtractor.getIrStubFromDescriptor(generateStub: (DeclarationStubGenerator) -> TIrStub) : TIrStub? =
|
||||
(pluginContext.symbolTable as? SymbolTable) ?.let {
|
||||
val stubGenerator = DeclarationStubGeneratorImpl(pluginContext.moduleDescriptor, it, pluginContext.irBuiltIns)
|
||||
generateStub(stubGenerator)
|
||||
} ?: run {
|
||||
logger.error("Plugin context has no symbol table, couldn't get IR stub")
|
||||
null
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrFileEntry
|
||||
|
||||
typealias FileEntry = IrFileEntry
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
|
||||
fun functionN(pluginContext: IrPluginContext) = pluginContext.irBuiltIns::functionN
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.psi.PsiSourceManager
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class Psi2Ir(private val logger: FileLogger): Psi2IrFacade {
|
||||
override fun getKtFile(irFile: IrFile): KtFile? {
|
||||
return irFile.getKtFile()
|
||||
}
|
||||
|
||||
override fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement? {
|
||||
return PsiSourceManager.findPsiElement(irElement, irFile)
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.withHasQuestionMark
|
||||
|
||||
fun IrType.codeQlWithHasQuestionMark(b : Boolean): IrType {
|
||||
return this.withHasQuestionMark(b)
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.IrFileEntry
|
||||
|
||||
typealias FileEntry = IrFileEntry
|
||||
@@ -1,5 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
|
||||
fun functionN(pluginContext: IrPluginContext) = pluginContext.irBuiltIns::functionN
|
||||
@@ -1,6 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
|
||||
fun isUnderscoreParameter(vp: IrValueParameter) = vp.origin == IrDeclarationOrigin.UNDERSCORE_PARAMETER
|
||||
@@ -1,19 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import com.github.codeql.FileLogger
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.psi.PsiSourceManager
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.getKtFile
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
import org.jetbrains.kotlin.psi.KtFile
|
||||
|
||||
class Psi2Ir(private val logger: FileLogger): Psi2IrFacade {
|
||||
override fun getKtFile(irFile: IrFile): KtFile? {
|
||||
return irFile.getKtFile()
|
||||
}
|
||||
|
||||
override fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement? {
|
||||
return PsiSourceManager.findPsiElement(irElement, irFile)
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
Reference in New Issue
Block a user