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

Method processIrOutput

lib/base-compiler.ts:1488–1505  ·  view source on GitHub ↗
(
        output: CompilationResult,
        irOptions: LLVMIrBackendOptions,
        filters: ParseFiltersAndOutputOptions,
    )

Source from the content-addressed store, hash-verified

1486 }
1487
1488 async processIrOutput(
1489 output: CompilationResult,
1490 irOptions: LLVMIrBackendOptions,
1491 filters: ParseFiltersAndOutputOptions,
1492 ): Promise<{
1493 asm: ParsedAsmResultLine[];
1494 languageId: string;
1495 }> {
1496 const irPath = this.getIrOutputFilename(output.inputFilename!, filters, irOptions);
1497 if (await utils.fileExists(irPath)) {
1498 const output = await fs.readFile(irPath, 'utf8');
1499 return await this.llvmIr.process(output, irOptions);
1500 }
1501 return {
1502 asm: [{text: 'Internal error; unable to open output path'}],
1503 languageId: 'llvm-ir',
1504 };
1505 }
1506
1507 getClangirOutputFilename(inputFilename: string) {
1508 return utils.changeExtension(inputFilename, '.cir');

Callers 1

generateIRMethod · 0.95

Calls 4

getIrOutputFilenameMethod · 0.95
fileExistsMethod · 0.80
readFileMethod · 0.80
processMethod · 0.65

Tested by

no test coverage detected