MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / runCompiler

Method runCompiler

lib/compilers/v.ts:97–121  ·  view source on GitHub ↗
(
        compiler: string,
        options: string[],
        inputFilename: string,
        execOptions: ExecutionOptionsWithEnv,
        filters?: ParseFiltersAndOutputOptions,
    )

Source from the content-addressed store, hash-verified

95 }
96
97 override async runCompiler(
98 compiler: string,
99 options: string[],
100 inputFilename: string,
101 execOptions: ExecutionOptionsWithEnv,
102 filters?: ParseFiltersAndOutputOptions,
103 ): Promise<CompilationResult> {
104 if (!execOptions) {
105 execOptions = super.getDefaultExecOptions();
106 }
107
108 const tmpDir = path.dirname(inputFilename);
109 execOptions.env['VMODULES'] = path.join(tmpDir, '.vmodules');
110 execOptions.env['VTMP'] = tmpDir;
111
112 if (!execOptions.customCwd) {
113 execOptions.customCwd = tmpDir;
114 }
115
116 const result = await this.exec(compiler, options, execOptions);
117 return {
118 ...this.transformToCompilationResult(result, inputFilename),
119 languageId: this.getCompilerResultLanguageId(filters),
120 };
121 }
122
123 getBackendFromOptions(options: string[]): string {
124 const backendOpt = options.indexOf('-b');

Callers 8

generateIRMethod · 0.45
buildExecutableMethod · 0.45
generateASTMethod · 0.45
generateIRMethod · 0.45
generateASTMethod · 0.45
generateOptPipelineMethod · 0.45
buildExecutableMethod · 0.45
win-path-tests.tsFile · 0.45

Calls 4

getDefaultExecOptionsMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected