aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compilers')
-rw-r--r--lib/compilers/ada.js4
-rw-r--r--lib/compilers/rust.js12
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/compilers/ada.js b/lib/compilers/ada.js
index 9a6fea6f8..6a93249de 100644
--- a/lib/compilers/ada.js
+++ b/lib/compilers/ada.js
@@ -46,9 +46,9 @@ export class AdaCompiler extends BaseCompiler {
return path.join(dirPath, 'example.o');
}
- optionsForBackend(backendOptions){
+ optionsForBackend(backendOptions, outputFilename){
// super is needed as it handles the GCC Dump files.
- const opts = super.optionsForBackend (backendOptions);
+ const opts = super.optionsForBackend (backendOptions, outputFilename);
if (backendOptions.produceGnatDebug && this.compiler.supportsGnatDebugView)
opts.push('-gnatDGL');
diff --git a/lib/compilers/rust.js b/lib/compilers/rust.js
index 3072e8db4..7043b2b00 100644
--- a/lib/compilers/rust.js
+++ b/lib/compilers/rust.js
@@ -45,10 +45,22 @@ export class RustCompiler extends BaseCompiler {
this.linker = this.compilerProps('linker');
}
+ getRustMirOutputFilename(outputFilename) {
+ return outputFilename.replace(path.extname(outputFilename), '.mir');
+ }
+
getSharedLibraryPathsAsArguments() {
return [];
}
+ optionsForBackend(backendOptions, outputFilename) {
+ if (backendOptions.produceRustMir && this.compiler.supportsRustMirView) {
+ const of = this.getRustMirOutputFilename(outputFilename);
+ return ['--emit', `mir=${of}`];
+ }
+ return [];
+ }
+
optionsForFilter(filters, outputFilename, userOptions) {
let options = ['-C', 'debuginfo=1', '-o', this.filename(outputFilename)];