diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2021-12-05 19:04:12 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-05 19:04:12 +0100 |
commit | 24693766d039b93fd93348bf3f98a58a822ba27f (patch) | |
tree | e29509f2baa91a64afa81905e62136acc250d8c3 /lib/compilers/rust.js | |
parent | 8155634c110b92372a74e892bc7488d530e6c8f1 (diff) | |
download | compiler-explorer-24693766d039b93fd93348bf3f98a58a822ba27f.tar.gz compiler-explorer-24693766d039b93fd93348bf3f98a58a822ba27f.zip |
rust: HIR dump and small refactor with macro expansion (#3147)gh-1338
Small refactoring for handling -Zunpretty calls:
- reuse options from main compiler invocation instead of crafting new ones.
- factor out common part.
Now also handles HIR output in a dedicated pane.
Still a lot of copy/pasting from the macro expansion.
fixes #2567
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'lib/compilers/rust.js')
-rw-r--r-- | lib/compilers/rust.js | 13 |
1 files changed, 7 insertions, 6 deletions
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 []; } |