mirror of
https://github.com/github/codeql.git
synced 2026-05-22 07:07:09 +02:00
KE2: Comment out KE1 code
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.isExternalFileClassMember
|
||||
import com.semmle.extractor.java.OdasaOutput
|
||||
import com.semmle.util.data.StringDigestor
|
||||
@@ -202,3 +204,4 @@ class ExternalDeclExtractor(
|
||||
output.writeTrapSet()
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
|
||||
import org.jetbrains.kotlin.compiler.plugin.CliOption
|
||||
import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor
|
||||
@@ -98,3 +100,4 @@ private val OPTION_COMPILATION_STARTTIME = "compilationStartTime"
|
||||
val KEY_COMPILATION_STARTTIME = CompilerConfigurationKey<Long>(OPTION_COMPILATION_STARTTIME)
|
||||
private val OPTION_EXIT_AFTER_EXTRACTION = "exitAfterExtraction"
|
||||
val KEY_EXIT_AFTER_EXTRACTION = CompilerConfigurationKey<Boolean>(OPTION_EXIT_AFTER_EXTRACTION)
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.intellij.mock.MockProject
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrGenerationExtension
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
@@ -27,3 +29,4 @@ class KotlinExtractorComponentRegistrar : Kotlin2ComponentRegistrar() {
|
||||
)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.versions.usesK2
|
||||
import com.semmle.util.files.FileUtil
|
||||
import com.semmle.util.trap.pathtransformers.PathTransformer
|
||||
@@ -582,3 +584,4 @@ private class GZipCompressedTrapFileWriter(logger: FileLogger, trapName: String)
|
||||
)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.comments.CommentExtractorLighterAST
|
||||
import com.github.codeql.comments.CommentExtractorPSI
|
||||
import com.github.codeql.utils.*
|
||||
@@ -9208,3 +9210,4 @@ open class KotlinFileExtractor(
|
||||
CALLABLE_CLASS(13),
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.*
|
||||
import com.github.codeql.utils.versions.*
|
||||
import com.semmle.extractor.java.OdasaOutput
|
||||
@@ -2249,3 +2251,4 @@ open class KotlinUsesExtractor(
|
||||
return tw.getVariableLabelFor<DbLocalvar>(v)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
/** This represents a label (`#...`) in a TRAP file. */
|
||||
interface Label<T : AnyDbType> {
|
||||
fun <U : AnyDbType> cast(): Label<U> {
|
||||
@@ -19,3 +21,4 @@ class IntLabel<T : AnyDbType>(val i: Int) : Label<T> {
|
||||
class StringLabel<T : AnyDbType>(val name: String) : Label<T> {
|
||||
override fun toString(): String = "#$name"
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
|
||||
class LinesOfCode(val logger: FileLogger, val tw: FileTrapWriter, val file: IrFile) {
|
||||
@@ -28,3 +30,4 @@ class LinesOfCode(val logger: FileLogger, val tw: FileTrapWriter, val file: IrFi
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.versions.getPsi2Ir
|
||||
import com.intellij.psi.PsiComment
|
||||
import com.intellij.psi.PsiElement
|
||||
@@ -148,3 +150,4 @@ class LinesOfCodePSI(val logger: FileLogger, val tw: FileTrapWriter, val file: I
|
||||
var containsCode = false
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.versions.copyParameterToFunction
|
||||
import com.github.codeql.utils.versions.createImplicitParameterDeclarationWithWrappedDescriptor
|
||||
import com.github.codeql.utils.versions.getAnnotationType
|
||||
@@ -511,3 +513,4 @@ class MetaAnnotationSupport(
|
||||
generateDocumentedAnnotation(c)
|
||||
)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.*
|
||||
import com.github.codeql.utils.versions.*
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
@@ -103,3 +105,4 @@ class PrimitiveTypeMapping(val logger: Logger, val pluginContext: IrPluginContex
|
||||
)
|
||||
}()
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.KotlinUsesExtractor.LocallyVisibleFunctionLabels
|
||||
import com.semmle.extractor.java.PopulateFile
|
||||
import com.semmle.util.unicode.UTF8Util
|
||||
@@ -462,3 +464,4 @@ class SourceFileTrapWriter(
|
||||
return "file://$filePath:$startLine:$startColumn:$endLine:$endColumn"
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.comments
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.*
|
||||
import com.github.codeql.utils.isLocalFunction
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
@@ -95,3 +97,4 @@ open class CommentExtractor(
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.comments
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.*
|
||||
import com.github.codeql.utils.IrVisitorLookup
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
@@ -120,3 +122,4 @@ class CommentExtractorPSI(
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.comments
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
enum class CommentType(val value: Int) {
|
||||
SingleLine(1),
|
||||
Block(2),
|
||||
Doc(3)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
// Functions copied from stdlib/jdk7/src/kotlin/AutoCloseable.kt, which is not available within
|
||||
// kotlinc,
|
||||
// but allows the `.use` pattern to be applied to JDK7 AutoCloseables:
|
||||
@@ -45,3 +47,4 @@ fun AutoCloseable?.closeFinallyAC(cause: Throwable?) =
|
||||
cause.addSuppressed(closeException)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.getJvmName
|
||||
import com.github.codeql.utils.versions.*
|
||||
import com.intellij.openapi.vfs.StandardFileSystems
|
||||
@@ -148,3 +150,4 @@ private fun getUnknownBinaryLocation(s: String): String {
|
||||
|
||||
fun getJavaEquivalentClassId(c: IrClass) =
|
||||
c.fqNameWhenAvailable?.toUnsafe()?.let { JavaToKotlinClassMap.mapKotlinToJava(it) }
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
@@ -54,3 +56,4 @@ fun isExternalFileClassMember(d: IrDeclaration): Boolean {
|
||||
}
|
||||
return false
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
@@ -24,3 +26,4 @@ fun getPropertiesByFqName(
|
||||
): Collection<IrPropertySymbol> {
|
||||
return getPropertiesByFqName(pluginContext, FqName(pkgName), Name.identifier(name))
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.descriptors.ClassKind
|
||||
import org.jetbrains.kotlin.descriptors.DescriptorVisibilities
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
@@ -11,3 +13,4 @@ fun IrFunction.isLocalFunction(): Boolean {
|
||||
|
||||
val IrClass.isInterfaceLike
|
||||
get() = kind == ClassKind.INTERFACE || kind == ClassKind.ANNOTATION_CLASS
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
@@ -38,3 +40,4 @@ class IrVisitorLookup(
|
||||
element.acceptChildren(this, data)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
|
||||
/**
|
||||
@@ -11,3 +13,4 @@ inline fun <reified S : IrDeclaration> Iterable<IrDeclaration>.findSubType(
|
||||
): S? {
|
||||
return this.find { it is S && predicate(it) } as S?
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.versions.allOverriddenIncludingSelf
|
||||
import org.jetbrains.kotlin.builtins.StandardNames
|
||||
import org.jetbrains.kotlin.ir.declarations.IrAnnotationContainer
|
||||
@@ -93,3 +95,4 @@ fun getJvmName(container: IrAnnotationContainer): String? {
|
||||
}
|
||||
return (container as? IrFunction)?.let { getSpecialJvmName(container) }
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
/**
|
||||
* Turns this list of nullable elements into a list of non-nullable elements if they are all
|
||||
* non-null, or returns null otherwise.
|
||||
@@ -11,3 +13,4 @@ public fun <T : Any> List<T?>.requireNoNullsOrNull(): List<T>? {
|
||||
return null
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.psi.psiUtil.endOffset
|
||||
@@ -22,3 +24,4 @@ fun IrElement.getLocation(): Location {
|
||||
fun PsiElement.getLocation(): Location {
|
||||
return Location(this.startOffset, this.endOffset)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import java.io.File
|
||||
import java.io.FileWriter
|
||||
import java.io.OutputStreamWriter
|
||||
@@ -354,3 +356,4 @@ class FileLogger(loggerBase: LoggerBase, val ftw: FileTrapWriter) :
|
||||
)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.IrElement
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFile
|
||||
@@ -10,3 +12,4 @@ interface Psi2IrFacade {
|
||||
|
||||
fun findPsiElement(irElement: IrElement, irFile: IrFile): PsiElement?
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
/**
|
||||
* A triple of a type's database label, its signature for use in callable signatures, and its short
|
||||
* name for use in all tables that provide a user-facing type name.
|
||||
@@ -38,3 +40,4 @@ typealias TypeResultsWithoutSignatures = TypeResultsGeneric<Unit>
|
||||
fun <T : AnyDbType> TypeResult<T>.forgetSignature(): TypeResultWithoutSignature<T> {
|
||||
return TypeResultWithoutSignature(this.id, Unit, this.shortName)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.KotlinUsesExtractor
|
||||
import com.github.codeql.Logger
|
||||
import com.github.codeql.getJavaEquivalentClassId
|
||||
@@ -281,3 +283,4 @@ private fun isUnspecialised(
|
||||
fun isUnspecialised(type: IrSimpleType, logger: Logger) =
|
||||
(type.classifier.owner as? IrClass)?.let { isUnspecialised(it, type.arguments, logger) }
|
||||
?: false
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.comments
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.*
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
|
||||
@@ -13,3 +15,4 @@ class CommentExtractorLighterAST(
|
||||
return false
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
package org.jetbrains.kotlin.compiler.plugin
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
@RequiresOptIn("This API is experimental. There are no stability guarantees for it")
|
||||
annotation class ExperimentalCompilerApi
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.SourceManager
|
||||
|
||||
typealias FileEntry = SourceManager.FileEntry
|
||||
*/
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
// Nothing to do
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
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,3 +1,6 @@
|
||||
package org.jetbrains.kotlin.ir.symbols
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING) annotation class IrSymbolInternals
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.psi.KtParameter
|
||||
@@ -19,3 +21,4 @@ fun isUnderscoreParameter(vp: IrValueParameter) =
|
||||
// be applied to synthetic functions.
|
||||
false
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.jetbrains.kotlin.fir.java
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.descriptors.SourceElement
|
||||
import org.jetbrains.kotlin.load.java.structure.impl.classFiles.BinaryJavaClass
|
||||
|
||||
@@ -9,3 +11,4 @@ instance of it.
|
||||
*/
|
||||
abstract class JavaBinarySourceElement private constructor(val javaClass: BinaryJavaClass) :
|
||||
SourceElement {}
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.config.JvmDefaultMode
|
||||
|
||||
fun jvmDefaultModeEnabledIsEnabled(jdm: JvmDefaultMode): Boolean {
|
||||
return jdm.forAllMethodsWithBody
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
|
||||
|
||||
@@ -10,3 +12,4 @@ import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
|
||||
abstract class Kotlin2ComponentRegistrar : ComponentRegistrar {
|
||||
/* Nothing to do; supportsK2 doesn't exist yet. */
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
|
||||
class LinesOfCodeLighterAST(val logger: FileLogger, val tw: FileTrapWriter, val file: IrFile) {
|
||||
@@ -16,3 +18,4 @@ class LinesOfCodeLighterAST(val logger: FileLogger, val tw: FileTrapWriter, val
|
||||
return false
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
|
||||
fun getPsi2Ir(): Psi2IrFacade? = null
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.name.ClassId
|
||||
@@ -31,3 +33,4 @@ fun getPropertiesByFqName(
|
||||
val fqName = pkgName.child(name)
|
||||
return pluginContext.referenceProperties(fqName)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.expressions.IrSyntheticBodyKind
|
||||
|
||||
val kind_ENUM_ENTRIES: IrSyntheticBodyKind? = null
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.jvm.codegen.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
|
||||
fun usesK2(@Suppress("UNUSED_PARAMETER") pluginContext: IrPluginContext): Boolean {
|
||||
return false
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.ir.allOverridden
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||
|
||||
fun IrSimpleFunction.allOverriddenIncludingSelf() = this.allOverridden(includeSelf = true)
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI
|
||||
|
||||
@OptIn(ObsoleteDescriptorBasedAPI::class)
|
||||
fun getAnnotationType(context: IrPluginContext) =
|
||||
context.typeTranslator.translateType(context.builtIns.annotationType)
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.ir.copyTo
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
|
||||
fun copyParameterToFunction(p: IrValueParameter, f: IrFunction) = p.copyTo(f)
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.ir.createImplicitParameterDeclarationWithWrappedDescriptor
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
|
||||
fun IrClass.createImplicitParameterDeclarationWithWrappedDescriptor() =
|
||||
this.createImplicitParameterDeclarationWithWrappedDescriptor()
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
fun getFileClassFqName(@Suppress("UNUSED_PARAMETER") d: IrDeclaration): FqName? {
|
||||
return null
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
import org.jetbrains.kotlin.ir.types.impl.IrTypeBase
|
||||
|
||||
fun getKotlinType(s: IrSimpleType) = (s as? IrTypeBase)?.kotlinType
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
import org.jetbrains.kotlin.name.FqName
|
||||
|
||||
@@ -8,3 +10,4 @@ val IrFile.packageFqName: FqName
|
||||
|
||||
val IrPackageFragment.packageFqName: FqName
|
||||
get() = this.fqName
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package org.jetbrains.kotlin.ir.util
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.lower.parents as kParents
|
||||
import org.jetbrains.kotlin.backend.common.lower.parentsWithSelf as kParentsWithSelf
|
||||
import org.jetbrains.kotlin.ir.declarations.*
|
||||
@@ -9,3 +11,4 @@ val IrDeclaration.parents: Sequence<IrDeclarationParent>
|
||||
|
||||
val IrDeclaration.parentsWithSelf: Sequence<IrDeclarationParent>
|
||||
get() = this.kParentsWithSelf
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
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 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.IrFileEntry
|
||||
|
||||
typealias FileEntry = IrFileEntry
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.backend.common.psi.PsiSourceManager
|
||||
@@ -19,3 +21,4 @@ private class Psi2Ir() : Psi2IrFacade {
|
||||
return PsiSourceManager.findPsiElement(irElement, irFile)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
|
||||
fun functionN(pluginContext: IrPluginContext) = pluginContext.irBuiltIns::functionN
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
|
||||
fun getAnnotationType(context: IrPluginContext) = context.irBuiltIns.annotationType
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclarationOrigin
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
|
||||
fun isUnderscoreParameter(vp: IrValueParameter) =
|
||||
vp.origin == IrDeclarationOrigin.UNDERSCORE_PARAMETER
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.jvm.ir.isRawType
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
fun IrSimpleType.isRawType() = this.isRawType()
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrDeclaration
|
||||
import org.jetbrains.kotlin.ir.declarations.IrField
|
||||
import org.jetbrains.kotlin.ir.declarations.IrMemberWithContainerSource
|
||||
@@ -39,3 +41,4 @@ fun getFileClassFqName(d: IrDeclaration): FqName? {
|
||||
return null
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
fun getKotlinType(s: IrSimpleType) = s.kotlinType
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.types.IrType
|
||||
import org.jetbrains.kotlin.ir.types.makeNotNull
|
||||
import org.jetbrains.kotlin.ir.types.makeNullable
|
||||
@@ -11,3 +13,4 @@ fun IrType.codeQlWithHasQuestionMark(b: Boolean): IrType {
|
||||
return this.makeNotNull()
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrSimpleFunction
|
||||
import org.jetbrains.kotlin.ir.util.allOverridden
|
||||
|
||||
fun IrSimpleFunction.allOverriddenIncludingSelf() = this.allOverridden(includeSelf = true)
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrFunction
|
||||
import org.jetbrains.kotlin.ir.declarations.IrValueParameter
|
||||
import org.jetbrains.kotlin.ir.util.copyTo
|
||||
|
||||
fun copyParameterToFunction(p: IrValueParameter, f: IrFunction) = p.copyTo(f)
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.declarations.IrClass
|
||||
import org.jetbrains.kotlin.ir.util.createImplicitParameterDeclarationWithWrappedDescriptor
|
||||
|
||||
fun IrClass.createImplicitParameterDeclarationWithWrappedDescriptor() =
|
||||
this.createImplicitParameterDeclarationWithWrappedDescriptor()
|
||||
*/
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.github.codeql
|
||||
|
||||
// The compiler provides the annotation class, so we don't need to do
|
||||
// anything
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
import org.jetbrains.kotlin.ir.symbols.*
|
||||
import org.jetbrains.kotlin.name.CallableId
|
||||
@@ -33,3 +35,4 @@ fun getPropertiesByFqName(
|
||||
val id = CallableId(pkgName, name)
|
||||
return pluginContext.referenceProperties(id)
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.expressions.IrSyntheticBodyKind
|
||||
|
||||
val kind_ENUM_ENTRIES: IrSyntheticBodyKind? = IrSyntheticBodyKind.ENUM_ENTRIES
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.comments
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.*
|
||||
import com.github.codeql.utils.versions.*
|
||||
import com.intellij.lang.LighterASTNode
|
||||
@@ -129,3 +131,4 @@ class CommentExtractorLighterAST(
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.fir.backend.FirMetadataSource
|
||||
import org.jetbrains.kotlin.fir.declarations.FirFile
|
||||
|
||||
val FirMetadataSource.File.firFile: FirFile?
|
||||
get() = this.files.elementAtOrNull(0)
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
|
||||
|
||||
@@ -11,3 +13,4 @@ abstract class Kotlin2ComponentRegistrar : ComponentRegistrar {
|
||||
override val supportsK2: Boolean
|
||||
get() = true
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.versions.*
|
||||
import com.intellij.lang.LighterASTNode
|
||||
import com.intellij.util.diff.FlyweightCapableTreeStructure
|
||||
@@ -146,3 +148,4 @@ class LinesOfCodeLighterAST(val logger: FileLogger, val tw: FileTrapWriter, val
|
||||
var containsCode = false
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.backend.common.extensions.IrPluginContext
|
||||
|
||||
fun usesK2(pluginContext: IrPluginContext): Boolean {
|
||||
return pluginContext.languageVersionSettings.languageVersion.usesK2
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
package com.github.codeql
|
||||
|
||||
// The compiler provides packageFqName, so we don't need to do anything
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.fir.backend.FirMetadataSource
|
||||
import org.jetbrains.kotlin.fir.declarations.FirFile
|
||||
|
||||
val FirMetadataSource.File.firFile: FirFile?
|
||||
get() = this.fir
|
||||
*/
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.github.codeql
|
||||
|
||||
// The compiler provides the annotation class, so we don't need to do
|
||||
// anything
|
||||
@@ -1,3 +0,0 @@
|
||||
/*
|
||||
The compiler provides this class, so we don't have to do anything.
|
||||
*/
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.config.JvmDefaultMode
|
||||
|
||||
fun jvmDefaultModeEnabledIsEnabled(jdm: JvmDefaultMode): Boolean {
|
||||
return jdm.isEnabled
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import com.github.codeql.utils.Psi2IrFacade
|
||||
import com.intellij.psi.PsiElement
|
||||
import org.jetbrains.kotlin.ir.PsiSourceManager
|
||||
@@ -19,3 +21,4 @@ private class Psi2Ir() : Psi2IrFacade {
|
||||
return PsiSourceManager.findPsiElement(irElement, irFile)
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
// Nothing to do
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.github.codeql.utils.versions
|
||||
|
||||
/*
|
||||
OLD: KE1
|
||||
import org.jetbrains.kotlin.ir.types.IrSimpleType
|
||||
|
||||
fun getKotlinType(s: IrSimpleType) = s.originalKotlinType
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user