diff options
Diffstat (limited to 'lib/compilers/c3c.ts')
-rw-r--r-- | lib/compilers/c3c.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/compilers/c3c.ts b/lib/compilers/c3c.ts new file mode 100644 index 000000000..a812583ae --- /dev/null +++ b/lib/compilers/c3c.ts @@ -0,0 +1,33 @@ +import path from 'path'; +import type {PreliminaryCompilerInfo} from '../../types/compiler.interfaces.js'; +import type {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces.js'; +import {BaseCompiler} from '../base-compiler.js'; + +export class C3Compiler extends BaseCompiler { + static get key() { + return 'c3c'; + } + + constructor(info: PreliminaryCompilerInfo, env) { + super(info, env); + this.compiler.supportsIrView = true; + this.compiler.irArg = ['--emit-llvm']; + } + + override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string) { + return [ + 'compile-only', + '-g', + '-l', + 'pthread', + '--no-strip-unused', + '--no-obj', + '--no-emit-stdlib', + '--emit-asm', + ]; + } + + override getIrOutputFilename(inputFilename: string): string { + return this.filename(path.dirname(inputFilename) + '/output.ll'); + } +} |