Fix compiler warnings in new wasm modules

Also don't output v8ExecutablePath in js.tests on each project
configuration.
This commit is contained in:
Alexander Udalov
2020-11-09 19:43:59 +01:00
committed by Alexander Udalov
parent 84d1393711
commit d96223a2ff
8 changed files with 18 additions and 14 deletions
@@ -90,6 +90,7 @@ class CheckIrElementVisitor(
override fun <T> visitConst(expression: IrConst<T>) {
super.visitConst(expression)
@Suppress("UNUSED_VARIABLE")
val naturalType = when (expression.kind) {
IrConstKind.Null -> {
expression.ensureNullable()
@@ -106,9 +107,9 @@ class CheckIrElementVisitor(
IrConstKind.Double -> irBuiltIns.doubleType
}
var type = expression.type
/*
TODO: This check used to have JS inline class helpers. Rewrite it in a common way.
var type = expression.type
while (true) {
val inlinedClass = type.getInlinedClass() ?: break
if (getInlineClassUnderlyingType(inlinedClass) == type)
@@ -272,10 +272,9 @@ class InlineClassLowering(val context: CommonBackendContext) {
}
private fun IrFunction.toInlineClassImplementationName(): Name {
val klass = this.parentAsClass!!
val newName = klass.name.asString() + "__" + name.asString() + INLINE_CLASS_IMPL_SUFFIX
val newName = parentAsClass.name.asString() + "__" + name.asString() + INLINE_CLASS_IMPL_SUFFIX
return when {
name.isSpecial -> Name.special("<" + newName + ">")
name.isSpecial -> Name.special("<$newName>")
else -> Name.identifier(newName)
}
}
@@ -41,12 +41,12 @@ class EnumUsageLowering(val context: JsCommonBackendContext) : BodyLoweringPass
val enumEntry = expression.symbol.owner
val klass = enumEntry.parent as IrClass
if (klass.isExternal) return expression
return lowerEnumEntry(enumEntry, klass)
return lowerEnumEntry(enumEntry)
}
})
}
private fun lowerEnumEntry(enumEntry: IrEnumEntry, klass: IrClass) =
private fun lowerEnumEntry(enumEntry: IrEnumEntry) =
enumEntry.getInstanceFun!!.run { JsIrBuilder.buildCall(symbol) }
}
@@ -48,8 +48,8 @@ import org.jetbrains.kotlin.ir.visitors.transformChildrenVoid
* Related issue: [https://github.com/WebAssembly/gc/issues/29]
*/
class EraseVirtualDispatchReceiverParametersTypes(val context: CommonBackendContext) : FileLoweringPass {
override fun lower(file: IrFile) {
file.acceptChildrenVoid(object : IrElementVisitorVoid {
override fun lower(irFile: IrFile) {
irFile.acceptChildrenVoid(object : IrElementVisitorVoid {
override fun visitElement(element: IrElement) {
element.acceptChildrenVoid(this)
}
@@ -88,4 +88,4 @@ class EraseVirtualDispatchReceiverParametersTypes(val context: CommonBackendCont
}
})
}
}
}
@@ -185,15 +185,15 @@ class WasmBaseTypeOperatorTransformer(val context: WasmBackendContext) : IrEleme
// Handling null manually
if (toType.isNullable() && fromType.isNullable()) {
return builder.irComposite {
val value = cacheValue(value)
val cachedValue = cacheValue(value)
+builder.irIfNull(
type = toType,
subject = value() as IrExpression,
subject = cachedValue() as IrExpression,
thenPart = builder.irNull(toType),
elsePart = builder.irCall(symbols.wasmRefCast, type = toType).apply {
putTypeArgument(0, fromType)
putTypeArgument(1, toType)
putValueArgument(0, value() as IrExpression)
putValueArgument(0, cachedValue() as IrExpression)
}
)
}