Review fixes
This commit is contained in:
committed by
Sergey Bogolepov
parent
a3c7dc8919
commit
cff142a617
+2
-3
@@ -386,8 +386,7 @@ internal class Context(config: KonanConfig) : KonanBackendContext(config) {
|
||||
config.configuration.get(KonanConfigKeys.PRODUCE) == CompilerOutputKind.DYNAMIC
|
||||
}
|
||||
|
||||
val isWasmTarget: Boolean by lazy {
|
||||
config.targetManager.target == KonanTarget.WASM32
|
||||
}
|
||||
fun shouldPreserveRuntimeSymbols(): Boolean =
|
||||
config.targetManager.target == KonanTarget.WASM32
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -659,7 +659,7 @@ internal class CodeGeneratorVisitor(val context: Context, val lifetimes: Map<IrE
|
||||
|
||||
// Preserve symbol from deletion if needed
|
||||
if (descriptor.usedAnnotation
|
||||
|| (context.isWasmTarget && descriptor.isExportedForCppRuntime())) {
|
||||
|| (context.shouldPreserveRuntimeSymbols() && descriptor.isExportedForCppRuntime())) {
|
||||
context.llvm.usedFunctions += codegen.llvmFunction(descriptor)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -90,7 +90,7 @@ internal class RTTIGenerator(override val context: Context) : ContextUtils {
|
||||
// TODO: use LLVMAddAlias?
|
||||
val global = addGlobal(nameValue.value, pointerType(runtime.typeInfoType), isExported = true)
|
||||
|
||||
if (context.isWasmTarget) {
|
||||
if (context.shouldPreserveRuntimeSymbols()) {
|
||||
context.llvm.usedGlobals += global
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user