diff options
author | Jeremy Rifkin <51220084+jeremy-rifkin@users.noreply.github.com> | 2023-12-03 11:34:25 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-03 11:34:25 -0500 |
commit | 7680595a887ebaf4c23c6abfe47dd5ae73b9b6ed (patch) | |
tree | 4e5c88d26f88c97ebb0eb3ee314e49caa38d27ee /lib/compilers | |
parent | c3e1b04c310729d713a8fa7d4a40c1bcd752b384 (diff) | |
download | compiler-explorer-7680595a887ebaf4c23c6abfe47dd5ae73b9b6ed.tar.gz compiler-explorer-7680595a887ebaf4c23c6abfe47dd5ae73b9b6ed.zip |
Add GIMPLE (#5817)gh-9795
This PR adds GIMPLE as a language

---------
Co-authored-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'lib/compilers')
-rw-r--r-- | lib/compilers/_all.ts | 1 | ||||
-rw-r--r-- | lib/compilers/gimple.ts | 48 |
2 files changed, 49 insertions, 0 deletions
diff --git a/lib/compilers/_all.ts b/lib/compilers/_all.ts index 245cb21eb..36e5ac8d1 100644 --- a/lib/compilers/_all.ts +++ b/lib/compilers/_all.ts @@ -62,6 +62,7 @@ export {FPCCompiler} from './pascal.js'; export {FSharpCompiler} from './dotnet.js'; export {GCCCompiler} from './gcc.js'; export {GCCRSCompiler} from './gccrs.js'; +export {GCCGimpleCompiler} from './gimple.js'; export {GCCCobolCompiler} from './gcccobol.js'; export {GnuCobolCompiler} from './gnucobol.js'; export {GolangCompiler} from './golang.js'; diff --git a/lib/compilers/gimple.ts b/lib/compilers/gimple.ts new file mode 100644 index 000000000..aaaf1746d --- /dev/null +++ b/lib/compilers/gimple.ts @@ -0,0 +1,48 @@ +// Copyright (c) 2023, Compiler Explorer Authors +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are met: +// +// * Redistributions of source code must retain the above copyright notice, +// this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +// POSSIBILITY OF SUCH DAMAGE. +import path from 'path'; + +import {ExecutionOptions} from '../../types/compilation/compilation.interfaces.js'; +import {BaseCompiler} from '../base-compiler.js'; + +export class GCCGimpleCompiler extends BaseCompiler { + static get key() { + return 'gimple'; + } + + override async runCompiler( + compiler: string, + options: string[], + inputFilename: string, + execOptions: ExecutionOptions & {env: Record<string, string>}, + ) { + if (!execOptions) { + execOptions = this.getDefaultExecOptions(); + } + + execOptions.customCwd = path.dirname(inputFilename); + + return await super.runCompiler(compiler, options.concat('-fgimple'), inputFilename, execOptions); + } +} |