diff options
author | Matt Godbolt <matt@godbolt.org> | 2017-06-19 19:40:37 -0500 |
---|---|---|
committer | Matt Godbolt <matt@godbolt.org> | 2017-06-19 19:40:46 -0500 |
commit | db8bf4e5205a33c2c9bd3d254c6431ba241bdb7d (patch) | |
tree | 2b5d3677c5a450c219b623a13b6579c67b6936dd /lib/compilers/swift.js | |
parent | 7d02a333d98bf08b9f165e919806cea5d414f9c4 (diff) | |
download | compiler-explorer-db8bf4e5205a33c2c9bd3d254c6431ba241bdb7d.tar.gz compiler-explorer-db8bf4e5205a33c2c9bd3d254c6431ba241bdb7d.zip |
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.
Diffstat (limited to 'lib/compilers/swift.js')
-rw-r--r-- | lib/compilers/swift.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/compilers/swift.js b/lib/compilers/swift.js new file mode 100644 index 000000000..884828852 --- /dev/null +++ b/lib/compilers/swift.js @@ -0,0 +1,19 @@ +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; |