diff options
author | RabsRincon <rubrinbla@gmail.com> | 2018-01-18 19:43:10 +0100 |
---|---|---|
committer | RabsRincon <rubrinbla@gmail.com> | 2018-01-18 19:43:10 +0100 |
commit | a54faefb4c8668d9c9f93c78bd6bc639d1f0c219 (patch) | |
tree | 6465bf3e1d8e270cc53e67c04277c5773b16f7d6 /lib/compilers/ldc.js | |
parent | 7bd30b4c4b10f93f26db81fbbe492149b8d487eb (diff) | |
download | compiler-explorer-a54faefb4c8668d9c9f93c78bd6bc639d1f0c219.tar.gz compiler-explorer-a54faefb4c8668d9c9f93c78bd6bc639d1f0c219.zip |
ES6fy compilers inheritance
Diffstat (limited to 'lib/compilers/ldc.js')
-rw-r--r-- | lib/compilers/ldc.js | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/lib/compilers/ldc.js b/lib/compilers/ldc.js index 1d2933f7a..5d540a8e8 100644 --- a/lib/compilers/ldc.js +++ b/lib/compilers/ldc.js @@ -22,25 +22,30 @@ // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // POSSIBILITY OF SUCH DAMAGE. -const Compile = require('../base-compiler'), +const BaseCompiler = require('../base-compiler'), argumentParsers = require("./argument-parsers"); -function compileLdc(info, env) { - const compiler = new Compile(info, env); - compiler.compiler.supportsIntel = true; - compiler.optionsForFilter = function (filters, outputFilename, userOptions) { +class LDCCompiler extends BaseCompiler { + constructor(info, env) { + super(info, env); + this.compiler.supportsIntel = true; + return this.initialise(); + } + + optionsForFilter(filters, outputFilename, userOptions) { let options = ['-g', '-of', this.filename(outputFilename)]; if (filters.intel && !filters.binary) options = options.concat('-x86-asm-syntax=intel'); if (!filters.binary) options = options.concat('-output-s'); return options; - }; - compiler.getArgumentParser = function () { - return argumentParsers.clang; - }; - compiler.filterUserOptions = function (userOptions) { + } + + getArgumentParser() { + return argumentParsers.Clang; + } + + filterUserOptions(userOptions) { return userOptions.filter(option => option !== '-run'); - }; - return compiler.initialise(); + } } -module.exports = compileLdc; +module.exports = LDCCompiler; |