aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/rust.js
diff options
context:
space:
mode:
authorMarc Poulhiès <dkm@kataplop.net>2021-11-22 00:08:02 +0100
committerGitHub <noreply@github.com>2021-11-22 00:08:02 +0100
commit8a6701f3a132aec773e1d7f2d2f686481ff66996 (patch)
tree54eb9b0490c85b430507dbabdbbbd99a8e99a338 /lib/compilers/rust.js
parentcdf295665bee0162df9ab345a6472b7659a8bc35 (diff)
downloadcompiler-explorer-8a6701f3a132aec773e1d7f2d2f686481ff66996.tar.gz
compiler-explorer-8a6701f3a132aec773e1d7f2d2f686481ff66996.zip
Fix and refactor rustc-cg-gcc GCC dump (#3128)gh-1302
Conflicting changes in #3109 and #3064 left the GCC dump of rustc broken. Reapplied the changes and refactored how the -fdump-foo-pass= option is crafted. Instead of using stdout, use an explicit file. Beware that this won't work with older GCC version. Regular GCC is still using the 'dump all files' instead of the targeted option, so it's not impacted by this limitation. Only rustc-cg-gcc is currently using this mecanism and it's using a recent libgccjit. Really fixes #2868 Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'lib/compilers/rust.js')
-rw-r--r--lib/compilers/rust.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/compilers/rust.js b/lib/compilers/rust.js
index 7043b2b00..622d914b0 100644
--- a/lib/compilers/rust.js
+++ b/lib/compilers/rust.js
@@ -54,11 +54,15 @@ export class RustCompiler extends BaseCompiler {
}
optionsForBackend(backendOptions, outputFilename) {
+ // The super class handles the GCC dump files that may be needed by
+ // rustc-cg-gcc subclass.
+ const opts = super.optionsForBackend (backendOptions, outputFilename);
+
if (backendOptions.produceRustMir && this.compiler.supportsRustMirView) {
const of = this.getRustMirOutputFilename(outputFilename);
- return ['--emit', `mir=${of}`];
+ opts.push('--emit', `mir=${of}`);
}
- return [];
+ return opts;
}
optionsForFilter(filters, outputFilename, userOptions) {