[JS IR] Add CLI flag and configuration key about partial linkage

- make possible to turn on/off linkage if klib contains unbound symbols
 - update jsExtraHelp test data
This commit is contained in:
Roman Artemev
2021-11-16 13:28:28 +03:00
committed by TeamCityServer
parent 8381badcc4
commit 7d8f71d107
4 changed files with 9 additions and 0 deletions
@@ -235,6 +235,9 @@ class K2JSCompilerArguments : CommonCompilerArguments() {
@Argument(value = "-Xerror-tolerance-policy", description = "Set up error tolerance policy (NONE, SEMANTIC, SYNTAX, ALL)")
var errorTolerancePolicy: String? by NullableStringFreezableVar(null)
@Argument(value = "-Xpartial-linkage", description = "Allow unlinked symbols")
var partialLinkage: Boolean by FreezableVar(false)
@Argument(value = "-Xwasm", description = "Use experimental WebAssembly compiler backend")
var wasm: Boolean by FreezableVar(false)
@@ -136,6 +136,8 @@ class K2JsIrCompiler : CLICompiler<K2JSCompilerArguments>() {
configuration.put(JSConfigurationKeys.TRANSITIVE_LIBRARIES, libraries)
configuration.put(JSConfigurationKeys.REPOSITORIES, repositories)
configuration.put(JSConfigurationKeys.PARTIAL_LINKAGE, arguments.partialLinkage)
val commonSourcesArray = arguments.commonSources
val commonSources = commonSourcesArray?.toSet() ?: emptySet()
for (arg in arguments.freeArgs) {
+1
View File
@@ -34,6 +34,7 @@ where advanced options include:
-Xir-safe-external-boolean-diagnostic={log|exception}
Enable runtime diagnostics when access safely to boolean in external declarations
-Xmetadata-only Generate *.meta.js and *.kjsm files only
-Xpartial-linkage Allow unlinked symbols
-Xrepositories=<path> Paths to additional places where libraries could be found
-Xtyped-arrays Translate primitive arrays to JS typed arrays
-Xwasm Use experimental WebAssembly compiler backend
@@ -93,4 +93,7 @@ public class JSConfigurationKeys {
public static final CompilerConfigurationKey<Collection<String>> REPOSITORIES =
CompilerConfigurationKey.create("set up additional repository paths");
public static final CompilerConfigurationKey<Boolean> PARTIAL_LINKAGE =
CompilerConfigurationKey.create("allows some symbols in klibs be missed");
}