MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / constructor

Method constructor

lib/compilers/rust.ts:53–79  ·  view source on GitHub ↗
(info: PreliminaryCompilerInfo, env: CompilationEnvironment)

Source from the content-addressed store, hash-verified

51 }
52
53 constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
54 super(info, env);
55 this.compiler.supportsIntel = true;
56 this.compiler.supportsIrView = true;
57 this.compiler.supportsRustMirView = true;
58 this.compiler.supportsVerboseDemangling = true;
59
60 const isNightly = this.isNightly();
61 // Macro expansion (-Zunpretty=expanded) and HIR (-Zunpretty=hir-tree)
62 // are only available for Nightly
63 this.compiler.supportsRustMacroExpView = isNightly;
64 this.compiler.supportsRustHirView = isNightly;
65 if (this.compiler.name === 'rustc nightly') {
66 this.compiler.supportsOptOutput = true;
67 // not setting compiler.optArg, overriding prepareOptRemarksArgs instead (2 args needed)
68 }
69
70 this.compiler.irArg = ['--emit', 'llvm-ir'];
71 this.compiler.minIrArgs = ['--emit=llvm-ir'];
72 this.compiler.optPipeline = {
73 arg: ['-C', 'llvm-args=-print-after-all -print-before-all', '-C', 'extra-filename=llvm-opt-pipeline'],
74 moduleScopeArg: ['-C', 'llvm-args=-print-module-scope'],
75 noDiscardValueNamesArg: isNightly ? ['-Z', 'fewer-names=no'] : [],
76 };
77 this.amd64linker = this.compilerProps<string>('linker');
78 this.aarch64linker = this.compilerProps<string>('aarch64linker');
79 }
80
81 override async generateIR(
82 inputFilename: string,

Callers

nothing calls this directly

Calls 1

isNightlyMethod · 0.95

Tested by

no test coverage detected