| 31 | import {CompilationEnvironment} from '../compilation-env.js'; |
| 32 | |
| 33 | export class RazorForgeCompiler extends BaseCompiler { |
| 34 | static get key() { |
| 35 | return 'razorforge'; |
| 36 | } |
| 37 | |
| 38 | constructor(info: PreliminaryCompilerInfo, env: CompilationEnvironment) { |
| 39 | super(info, env); |
| 40 | this.outputFilebase = 'example'; |
| 41 | this.compiler.supportsIrView = true; |
| 42 | this.compiler.irArg = []; |
| 43 | this.compiler.supportsIntel = false; |
| 44 | } |
| 45 | |
| 46 | // RazorForge's CLI takes verbs and positional arguments only — all build |
| 47 | // configuration lives in razorforge.toml, not flags. The `build` verb runs |
| 48 | // semantic analysis and code generation, writing LLVM IR next to the source |
| 49 | // file (example.rf -> example.ll) without invoking opt/clang. |
| 50 | override optionsForFilter(filters: ParseFiltersAndOutputOptions, outputFilename: string): string[] { |
| 51 | return []; |
| 52 | } |
| 53 | |
| 54 | override orderArguments( |
| 55 | options: string[], |
| 56 | inputFilename: string, |
| 57 | libIncludes: string[], |
| 58 | libOptions: string[], |
| 59 | libPaths: string[], |
| 60 | libLinks: string[], |
| 61 | userOptions: string[], |
| 62 | staticLibLinks: string[], |
| 63 | ) { |
| 64 | return ['build', this.filename(inputFilename)].concat(options, userOptions); |
| 65 | } |
| 66 | |
| 67 | // The primary output is the emitted LLVM IR itself. |
| 68 | override getOutputFilename(dirPath: string, outputFilebase: string, key?: CacheKey | CompilationCacheKey): string { |
| 69 | return path.join(dirPath, `${outputFilebase}.ll`); |
| 70 | } |
| 71 | |
| 72 | override getCompilerResultLanguageId(filters?: ParseFiltersAndOutputOptions): string | undefined { |
| 73 | return 'llvm-ir'; |
| 74 | } |
| 75 | |
| 76 | override getSharedLibraryPathsAsArguments(): string[] { |
| 77 | return []; |
| 78 | } |
| 79 | } |
nothing calls this directly
no outgoing calls
no test coverage detected