mirror of
https://github.com/compiler-explorer/compiler-explorer.git
synced 2025-12-27 09:23:52 -05:00
29 lines
1.1 KiB
TypeScript
29 lines
1.1 KiB
TypeScript
import {BaseCompiler} from '../base-compiler.js';
|
|
import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js';
|
|
|
|
// TODO: remove this comment
|
|
// For reference, the basic behaviour of BaseCompiler is:
|
|
// - make a random temporary folder
|
|
// - save example.extension to the new folder, the full path to this is the inputFilename
|
|
// - the outputFilename is determined by the getOutputFilename() method
|
|
// - execute the compiler.exe with the arguments from OptionsForFilter() and adding inputFilename
|
|
// - be aware that the language class is only instanced once, so storing state is not possible
|
|
|
|
export class HyloCompiler extends BaseCompiler {
|
|
static get key() {
|
|
return 'hylo';
|
|
}
|
|
|
|
override optionsForFilter(
|
|
filters: ParseFiltersAndOutputOptions,
|
|
outputFilename: string,
|
|
userOptions?: string[],
|
|
): string[] {
|
|
if (filters.intel) {
|
|
return ['--emit', 'ir', '-o', this.filename(outputFilename)];
|
|
} else {
|
|
return ['-o', this.filename(outputFilename)];
|
|
}
|
|
}
|
|
}
|