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

Class CoccinelleCCompiler

lib/compilers/coccinelle.ts:38–259  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36import * as utils from '../utils.js';
37
38export class CoccinelleCCompiler extends BaseCompiler {
39 protected spatchBaseFilename: string; // if true, doTempfolderCleanup won't clean up
40 protected joinSpatchStdinAndStderr: boolean; // dirty hopefullytemporary hack, as coccinelle dumps diagnostics on both streams
41 protected verbose: boolean; // for maintenance/development
42 protected permittedOptions: string[];
43
44 static get key() {
45 return 'coccinelle_for_c';
46 }
47
48 constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) {
49 super(
50 {
51 disabledFilters: ['labels', 'directives', 'commentOnly', 'trim', 'debugCalls'],
52 ...info,
53 },
54 env,
55 );
56 this.compiler.supportsIntel = false;
57 this.delayCleanupTemp = false;
58 this.spatchBaseFilename = 'patch.cocci';
59 this.outputFilebase = 'output';
60 this.joinSpatchStdinAndStderr = true;
61 this.verbose = false;
62 this.permittedOptions = ['--debug', '--help', '--iso-limit=0', '--quiet', '--verbose', '--very-quiet.'];
63 // ...
64 }
65
66 override getDefaultFilters() {
67 // We want to keep the entire output of Coccinelle (so, no filter)
68 return {
69 intel: false,
70 commentOnly: false,
71 directives: false,
72 labels: false,
73 optOutput: false,
74 binary: false,
75 execute: false,
76 demangle: false,
77 libraryCode: false,
78 trim: false,
79 binaryObject: false,
80 debugCalls: false,
81 };
82 }
83
84 override async populatePossibleOverrides() {
85 await super.populatePossibleOverrides();
86 }
87
88 override getSharedLibraryPathsAsArguments(libraries: SelectedLibraryVersion[], libDownloadPath?: string) {
89 return [];
90 }
91
92 override getSharedLibraryLinks(libraries: any[]): string[] {
93 return [];
94 }
95

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected