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

Method runCompiler

lib/compilers/ca65.ts:60–89  ·  view source on GitHub ↗
(
        compiler: string,
        options: string[],
        inputFilename: string,
        execOptions: ExecutionOptionsWithEnv,
    )

Source from the content-addressed store, hash-verified

58 }
59
60 override async runCompiler(
61 compiler: string,
62 options: string[],
63 inputFilename: string,
64 execOptions: ExecutionOptionsWithEnv,
65 ) {
66 if (!execOptions) {
67 execOptions = this.getDefaultExecOptions();
68 }
69
70 const dirPath = path.dirname(inputFilename);
71 if (!execOptions.customCwd) {
72 execOptions.customCwd = dirPath;
73 }
74
75 const outputFilename = this.getOutputFilename(dirPath, this.outputFilebase);
76
77 // Always generate a listing with full macro expansion, writing directly to the output file
78 const hasListingOpt = options.some(opt => opt === '-l' || opt === '--listing');
79 if (!hasListingOpt) {
80 options = ['-l', outputFilename, '-x', '-x', '--list-bytes', '0', ...options];
81 }
82
83 const compilerExecResult = await this.exec(compiler, options, execOptions);
84 const result = this.transformToCompilationResult(compilerExecResult, inputFilename);
85
86 result.forceBinaryView = true;
87
88 return result;
89 }
90
91 override isCfgCompiler(): boolean {
92 return true;

Callers

nothing calls this directly

Calls 4

getOutputFilenameMethod · 0.65
getDefaultExecOptionsMethod · 0.45
execMethod · 0.45

Tested by

no test coverage detected