More TODOs done; some rust ones added (until I get that working again)

dev/git-series/gccdum
Matt Godbolt 7 years ago
parent 48fadf738e
commit af280a82cb

@ -8,8 +8,6 @@ clientSharingEnabled=false
#compiler.r100.name=rustc 1.0.0
#compiler.r100.intelAsm=-Cllvm-args=--x86-asm-syntax=intel
#compileFilename=example.rs
#compileToAsm=--emit asm --crate-type staticlib
#cacheMb=100
#language=C++
#options=-O --crate-type staticlib
#clientGoogleAnalyticsEnabled=true

@ -1,7 +1,5 @@
compilers=/usr/local/bin/rustc
options=--crate-type staticlib
compileFilename=example.rs
compileToAsm=--emit asm --crate-type staticlib
supportsBinary=false
stubRe=\bmain\b
stubText=pub fn main() {/*stub provided by Compiler Explorer*/}

@ -128,29 +128,10 @@ Compile.prototype.optionsForFilter = function (filters, outputFilename) {
if (this.compiler.intelAsm && filters.intel && !filters.binary) {
options = options.concat(this.compiler.intelAsm.split(" "));
}
if (!filters.binary) {
options = options.concat('-S');
}
// TODO: compileToAsm and compileToBinary compilerProps need folding into
// compiler types. info.asmFlag and info.outputFlag also
/*
var asmFlag = this.compiler.asmFlag ? this.compiler.asmFlag : "-S";
var outputFlag = this.compiler.outputFlag ? this.compiler.outputFlag : "-o";
var compileToAsm;
if (!filters.binary) {
compileToAsm = compilerProps("compileToAsm", asmFlag).split(" ");
} else {
compileToAsm = compilerProps("compileToBinary", "").split(" ");
}
*/
if (!filters.binary) options = options.concat('-S');
return options;
};
// TODO: where to draw the line between configuration and program behaviour?
// Per-compiler type stuff? probably things like asmFlag/outputFlag etc should be
// part of the compiler configuration in the compiler itself. intelAsm?
// options -- not options; this is reasonably per-compiler instance (e.g. cl include paths)
// clang gcc toolchain options? per compiler instance again?
Compile.prototype.prepareArguments = function (userOptions, filters, inputFilename, outputFilename) {
var options = this.optionsForFilter(filters, outputFilename);
if (this.compiler.options) {
@ -459,13 +440,26 @@ function compile6g(info, env) {
return compiler;
}
function compileRust(info, env) {
var compiler = new Compile(info, env);
// TODO this needs testing!
compiler.optionsForFilter = function (filters, outputFilename) {
var options = ['-g', '-o', this.filename(outputFilename)];
// TODO: binary not supported(?)
if (filters.binary) options = options.concat('--emit', 'asm');
options = options.concat(['--crate-type', 'staticlib']);
return options;
};
}
var compileFactories = {
"": function (info, env) {
var comp = new Compile(info, env);
return comp.initialise();
},
"CL": compileCl,
"6g": compile6g
"6g": compile6g,
"rust": compileRust
};
function CompileHandler() {

Loading…
Cancel
Save