Working CL430 compiler

This commit is contained in:
Jonathan Reichelt Gjertsen
2023-01-23 20:25:19 -06:00
committed by Matt Godbolt
parent d28821950e
commit 11c36808a4
3 changed files with 54 additions and 17 deletions
+16 -8
View File
@@ -1,4 +1,4 @@
compilers=&gcc86:&icc:&icx:&clang:&clangx86trunk:&clang-rocm:&mosclang-trunk:&rvclang:&wasmclang:&cl:&cross:&ellcc:&zapcc:&djggp:www.godbolt.ms@443:&armclang32:&armclang64:&zigcxx:&cxx6502:&nvcxx_arm_cxx:godbolt.org@443/gpu:cl430
compilers=&gcc86:&icc:&icx:&clang:&clangx86trunk:&clang-rocm:&mosclang-trunk:&rvclang:&wasmclang:&cl:&cross:&ellcc:&zapcc:&djggp:www.godbolt.ms@443:&armclang32:&armclang64:&zigcxx:&cxx6502:&nvcxx_arm_cxx:godbolt.org@443/gpu
# Disabled: nvcxx_x86_cxx
# The disabled groups are actually used in the c++.gpu.properties. One day these might exist on both servers, so I want
# to keep them in the same place.
@@ -1365,7 +1365,7 @@ compiler.k1cg750.hidden=true
###############################
# Platform Specific Cross Compilers
group.platspec.compilers=frc2019:frc2020:raspbian9:raspbian10:arduinouno189:arduinomega189
group.platspec.compilers=frc2019:frc2020:raspbian9:raspbian10:arduinouno189:arduinomega189:&cl430
group.platspec.groupName=Platform Specific Compilers
group.platspec.isSemVer=true
group.platspec.includeFlag=-I
@@ -1417,12 +1417,20 @@ compiler.msp430g621.exe=/opt/compiler-explorer/msp430-gcc-6.2.1.16_linux64/bin/m
compiler.msp430g621.semver=6.2.1
################################
# TI CL430
compiler.cl430.name=TI CL430 21.6.1
compiler.cl430.exe=/opt/compiler-explorer/ti/ti-cgt-msp430_21.6.1.LTS/bin/cl430
compiler.cl430.options=--keep_asm --asm_extension=.s -Iti-cgt-msp430_21.6.1.LTS/include --c99
compiler.cl430.version=-version
compiler.cl430.class=cl430
# CL430 (Texas Instruments MSP430 compiler)
group.cl430.compilers=cl4302161
group.cl430.baseName=TI CL430
group.cl430.groupName=TI CL430
group.cl430.instructionSet=msp430
group.cl430.isSemVer=true
group.cl430.supportsBinary=false
compiler.cl4302161.class=cl430
compiler.cl4302161.compilerType=cl430
compiler.cl4302161.exe=/opt/compiler-explorer/ti-cgt-msp430_21.6.1.LTS/bin/cl430
compiler.cl4302161.options='-I/opt/compiler-explorer/ti-cgt-msp430_21.6.1.LTS/include'
compiler.cl4302161.semver= 21.6.1
compiler.cl4302161.versionFlag=-version
################################
# GCC for AVR
+17 -1
View File
@@ -1316,7 +1316,7 @@ compiler.ck1cg750.objdumper=/opt/compiler-explorer/k1/gcc-7.5.0/k1-unknown-elf/b
###############################
# Platform Specific Cross Compilers
group.cplatspec.compilers=cfrc2019:cfrc2020:craspbian9:craspbian10:carduinouno189:carduinomega189
group.cplatspec.compilers=cfrc2019:cfrc2020:craspbian9:craspbian10:carduinouno189:carduinomega189:&ccl430
group.cplatspec.groupName=Platform Specific Compilers
group.cplatspec.isSemVer=true
group.cplatspec.includeFlag=-I
@@ -1375,6 +1375,22 @@ compiler.cmsp430g1220.semver=12.2.0
compiler.cmsp430g1220.objdumper=/opt/compiler-explorer/msp430/gcc-12.2.0/msp430-unknown-elf/bin/msp430-unknown-elf-objdump
compiler.cmsp430g1220.demangler=/opt/compiler-explorer/msp430/gcc-12.2.0/msp430-unknown-elf/bin/msp430-unknown-elf-c++filt
################################
# CL430 (Texas Instruments MSP430 compiler)
group.ccl430.compilers=ccl4302161
group.ccl430.baseName=TI CL430
group.ccl430.groupName=TI CL430
group.ccl430.instructionSet=msp430
group.ccl430.isSemVer=true
group.ccl430.supportsBinary=false
compiler.ccl4302161.class=cl430
compiler.ccl4302161.compilerType=cl430
compiler.ccl4302161.exe=/opt/compiler-explorer/ti-cgt-msp430_21.6.1.LTS/bin/cl430
compiler.ccl4302161.options='-I/opt/compiler-explorer/ti-cgt-msp430_21.6.1.LTS/include'
compiler.ccl4302161.semver=21.6.1
compiler.ccl4302161.versionFlag=-version
################################
# GCC for AVR
group.cavr.compilers=cavrg454:cavrg464:cavrg540:cavrg920:cavrg930:cavrg1030:cavrg1100:cavrg1210:cavrg1220
+21 -8
View File
@@ -1,4 +1,4 @@
// Copyright (c) 2022, Jonathan Reichelt Gjertsen
// Copyright (c) 2022, Jonathan Reichelt Gjertsen & Compiler Explorer Authors
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -22,24 +22,37 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
import {BaseCompiler} from '../base-compiler';
import {CompilerInfo} from '../../types/compiler.interfaces';
import {ParseFiltersAndOutputOptions} from '../../types/features/filters.interfaces';
import {BaseCompiler} from '../base-compiler';
export class CL430Compiler extends BaseCompiler {
static get key() {
return 'cl430';
}
constructor(compilerInfo: CompilerInfo & Record<string, any>, env) {
super(compilerInfo, env);
// We need to have the same name for the C/C++ file as we expect for the output file
this.compileFilename = `output${this.lang.extensions[0]}`;
}
override optionsForFilter(
filters: ParseFiltersAndOutputOptions,
outputFilename: string,
userOptions?: string[],
): string[] {
let options = ['-g', '--output_file', this.filename(outputFilename)];
if (this.compiler.intelAsm && filters.intel && !filters.binary) {
options = options.concat(this.compiler.intelAsm.split(' '));
}
if (!filters.binary) options = options.concat('-s');
return options;
return [
// -g AKA --symdebug:dwarf generates too much noise for the default parser to deal with
'--symdebug:none',
// Generate an object file called output (no extension) and request to keep the ASM
// This will generate a corresponding assembly file called output.s
'--keep_asm',
'--asm_extension=.s',
'--output_file',
this.filename(outputFilename.replace('.s', '')),
];
}
}