Files
compiler-explorer/lib/compilers/swift.js
T
Matt Godbolt db8bf4e520 Early support for swift. test with make EXTRA_ARGS="--language Swift"
Huge thanks to @adamnemecek for his help: this is mostly a
merge of his branch.
2017-06-19 19:40:46 -05:00

20 lines
648 B
JavaScript

const Compile = require('../base-compiler'),
logger = require('../logger').logger;
function compileSwift(info, env) {
const compiler = new Compile(info, env);
compiler.handlePostProcessResult = function (result, postResult) {
result.asm = postResult.stdout;
// Seems swift-demangle like to exit with error 1
if (postResult.code !== 0 && !result.asm) {
result.asm = "<Error during post processing: " + postResult.code + ">";
logger.error("Error during post-processing", result);
}
return result;
};
return compiler.initialise();
}
module.exports = compileSwift;