Skip to content

Commit

Permalink
Merge branch 'jonathangjertsen-main'
Browse files Browse the repository at this point in the history
  • Loading branch information
mattgodbolt committed Jan 4, 2023
2 parents e12aa5f + b7672f7 commit 4487ed3
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 2 deletions.
18 changes: 17 additions & 1 deletion etc/config/c++.amazon.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1416,6 +1416,22 @@ compiler.msp430g530.semver=5.3.0
compiler.msp430g621.exe=/opt/compiler-explorer/msp430-gcc-6.2.1.16_linux64/bin/msp430-elf-g++
compiler.msp430g621.semver=6.2.1

################################
# 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
group.avr.compilers=avrg454:avrg464:avrg540:avrg920:avrg930:avrg1030:avrg1100:avrg1210:avrg1220
Expand Down
18 changes: 17 additions & 1 deletion etc/config/c.amazon.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/compilers/_all.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export {CarbonCompiler} from './carbon';
export {Cc65Compiler} from './cc65';
export {CircleCompiler} from './circle';
export {CIRCTCompiler} from './circt';
export {CL430Compiler} from './cl430';
export {ClangCompiler} from './clang';
export {ClangCLCompiler} from './clangcl';
export {ClangCudaCompiler} from './clang';
Expand Down
58 changes: 58 additions & 0 deletions lib/compilers/cl430.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright (c) 2022, Jonathan Reichelt Gjertsen & 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 {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[] {
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', '')),
];
}
}

0 comments on commit 4487ed3

Please sign in to comment.