diff options
Diffstat (limited to 'lib/compilers/ldc.js')
-rw-r--r-- | lib/compilers/ldc.js | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/lib/compilers/ldc.js b/lib/compilers/ldc.js index 1d2933f7a..eba7f6622 100644 --- a/lib/compilers/ldc.js +++ b/lib/compilers/ldc.js @@ -22,25 +22,29 @@ // 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; + } + + 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; |