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

Method findCompiler

lib/handlers/compile.ts:350–376  ·  view source on GitHub ↗
(langId: LanguageKey, compilerId: string)

Source from the content-addressed store, hash-verified

348 }
349
350 findCompiler(langId: LanguageKey, compilerId: string): BaseCompiler | undefined {
351 if (!compilerId) return;
352
353 const langCompilers: Record<string, BaseCompiler> | undefined = this.compilersById[langId];
354 if (langCompilers) {
355 if (langCompilers[compilerId]) {
356 return langCompilers[compilerId];
357 }
358 const compiler = _.find(langCompilers, (compiler: BaseCompiler) => {
359 return this.compilerAliasMatch(compiler, compilerId);
360 });
361
362 if (compiler) return compiler;
363 }
364
365 // If the lang is bad, try to find it in every language
366 let response: BaseCompiler | undefined;
367 _.each(this.compilersById, (compilerInLang: Record<string, BaseCompiler>) => {
368 if (!response) {
369 response = _.find(compilerInLang, (compiler: BaseCompiler) => {
370 return this.compilerIdOrAliasMatch(compiler, compilerId);
371 });
372 }
373 });
374
375 return response;
376 }
377
378 compilerFor(req): BaseCompiler | undefined {
379 if (req.is('json')) {

Callers 11

createMethod · 0.95
compilerForMethod · 0.95
doOneCompilationFunction · 0.45
handleDiscoveryOnlyModeFunction · 0.45
registerCompileToolFunction · 0.45
runCompilerMethod · 0.45
runCompilerMethod · 0.45
generateSmaliMethod · 0.45
runCompilerMethod · 0.45
getGccMethod · 0.45
mcp-tests.tsFile · 0.45

Calls 3

compilerAliasMatchMethod · 0.95
findMethod · 0.80

Tested by

no test coverage detected