aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compilers')
-rw-r--r--lib/compilers/ada.js13
-rw-r--r--lib/compilers/fake-for-test.js2
-rw-r--r--lib/compilers/kotlin.js41
-rw-r--r--lib/compilers/rust.js13
4 files changed, 56 insertions, 13 deletions
diff --git a/lib/compilers/ada.js b/lib/compilers/ada.js
index 6a93249de..daa6d538e 100644
--- a/lib/compilers/ada.js
+++ b/lib/compilers/ada.js
@@ -35,7 +35,9 @@ export class AdaCompiler extends BaseCompiler {
this.compiler.supportsGccDump = true;
this.compiler.removeEmptyGccDump = true;
this.compiler.supportsIntel = true;
- this.compiler.supportsGnatDebugView = true;
+
+ // used for all GNAT related panes (Expanded code, Tree)
+ this.compiler.supportsGnatDebugViews = true;
}
getExecutableFilename(dirPath) {
@@ -50,8 +52,13 @@ export class AdaCompiler extends BaseCompiler {
// super is needed as it handles the GCC Dump files.
const opts = super.optionsForBackend (backendOptions, outputFilename);
- if (backendOptions.produceGnatDebug && this.compiler.supportsGnatDebugView)
- opts.push('-gnatDGL');
+ if (backendOptions.produceGnatDebug && this.compiler.supportsGnatDebugViews)
+ // This is using stdout
+ opts.push('-gnatGL');
+
+ if (backendOptions.produceGnatDebugTree && this.compiler.supportsGnatDebugViews)
+ // This is also using stdout
+ opts.push('-gnatdt');
return opts;
}
diff --git a/lib/compilers/fake-for-test.js b/lib/compilers/fake-for-test.js
index a6ec6b46d..1aaf027f5 100644
--- a/lib/compilers/fake-for-test.js
+++ b/lib/compilers/fake-for-test.js
@@ -44,7 +44,7 @@ export class FakeCompiler {
}
getDefaultFilters() {
- return [];
+ return {};
}
getRemote() {
diff --git a/lib/compilers/kotlin.js b/lib/compilers/kotlin.js
index 6b95a4c7d..0871dfcab 100644
--- a/lib/compilers/kotlin.js
+++ b/lib/compilers/kotlin.js
@@ -54,9 +54,6 @@ export class KotlinCompiler extends JavaCompiler {
option !== '-script' && option !== '-progressive' && !option.startsWith('-Xjavac'));
const oneArgForbiddenList = new Set([
- // -d directory
- // Destination for generated class files
- '-d',
// -jdk-home path
// Include a custom JDK from the specified location
// into the classpath instead of the default JAVA_HOME
@@ -80,6 +77,44 @@ export class KotlinCompiler extends JavaCompiler {
];
}
+ /**
+ * Handle Kotlin execution.
+ *
+ * Kotlin execution differs in the way that Kotlin requires its standard
+ * standard library because that's where the runtime libraries such as
+ * kotlin.jvm.internal.Intrinsics is.
+ *
+ * Therefore, we append the -include-runtime and -d flags to specify where
+ * to output the jarfile which we will run using `java -jar`
+ *
+ * TODO(supergrecko): Find a better fix than this bandaid for execution
+ */
+ async handleInterpreting(key, executeParameters) {
+ const alteredKey = {
+ ...key,
+ options: ['-include-runtime', '-d', 'example.jar'],
+ };
+ const compileResult = await this.getOrBuildExecutable(alteredKey);
+ executeParameters.args = [
+ '-Xss136K', // Reduce thread stack size
+ '-XX:CICompilerCount=2', // Reduce JIT compilation threads. 2 is minimum
+ '-XX:-UseDynamicNumberOfCompilerThreads',
+ '-XX:-UseDynamicNumberOfGCThreads',
+ '-XX:+UseSerialGC', // Disable parallell/concurrent garbage collector
+ '-cp',
+ compileResult.dirPath,
+ '-jar',
+ 'example.jar',
+ // -jar <jar> has to be the last java parameter, otherwise it will use
+ // our java parameters as program parameters
+ ...executeParameters.args,
+ ];
+ const result = await this.runExecutable(this.javaRuntime, executeParameters, compileResult.dirPath);
+ result.didExecute = true;
+ result.buildResult = compileResult;
+ return result;
+ }
+
getArgumentParser() {
return KotlinParser;
}
diff --git a/lib/compilers/rust.js b/lib/compilers/rust.js
index 622d914b0..84d0b156c 100644
--- a/lib/compilers/rust.js
+++ b/lib/compilers/rust.js
@@ -39,16 +39,17 @@ export class RustCompiler extends BaseCompiler {
this.compiler.supportsIntel = true;
this.compiler.supportsIrView = true;
this.compiler.supportsRustMirView = true;
- // Macro expansion through -Zunpretty=expanded is only available for Nightly
- this.compiler.supportsRustMacroExpView = info.name === 'nightly' || info.semver === 'nightly';
+
+ const isNightly = info.name === 'nightly' || info.semver === 'nightly';
+ // Macro expansion (-Zunpretty=expanded) and HIR (-Zunpretty=hir-tree)
+ // are only available for Nightly
+ this.compiler.supportsRustMacroExpView = isNightly;
+ this.compiler.supportsRustHirView = isNightly;
+
this.compiler.irArg = ['--emit', 'llvm-ir'];
this.linker = this.compilerProps('linker');
}
- getRustMirOutputFilename(outputFilename) {
- return outputFilename.replace(path.extname(outputFilename), '.mir');
- }
-
getSharedLibraryPathsAsArguments() {
return [];
}