diff --git a/src/bin/jbc2mpl b/src/bin/jbc2mpl index cda7ba6d4877991ece9166593edc8e5aaeafbf5e..ed11e3a0b6ea16dcd537ab18b3256e8ef71fdda8 100755 Binary files a/src/bin/jbc2mpl and b/src/bin/jbc2mpl differ diff --git a/src/bin/maple b/src/bin/maple index 7c64c05eacea21dce23efacac0cfb0482a9afc63..146010e30c1c80f697f8c7ad8c5797742d7b2e55 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/maple_driver/defs/supported_compilers.def b/src/maple_driver/defs/supported_compilers.def deleted file mode 100644 index a224fe6500dde8884a05e592ab013a7aef805299..0000000000000000000000000000000000000000 --- a/src/maple_driver/defs/supported_compilers.def +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright (c) [2019] Huawei Technologies Co.,Ltd.All rights reserved. - * - * OpenArkCompiler is licensed under the Mulan PSL v1. - * You can use this software according to the terms and conditions of the Mulan PSL v1. - * You may obtain a copy of Mulan PSL v1 at: - * - * http://license.coscl.org.cn/MulanPSL - * - * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR - * FIT FOR A PARTICULAR PURPOSE. - * See the Mulan PSL v1 for more details. - */ -ADD_COMPILER("jbc2mpl" ,Jbc2MplCompiler) -ADD_COMPILER("me" ,MapleCombCompiler) -ADD_COMPILER("mpl2mpl" ,MapleCombCompiler) -ADD_COMPILER("mplcg" ,MplcgCompiler) diff --git a/src/maple_driver/include/compiler.h b/src/maple_driver/include/compiler.h index e2cefeafe3c2a4042db181f630c041ac43df81eb..3e392f5587112a9d0867f42e73aa5a0f7ad7de2c 100644 --- a/src/maple_driver/include/compiler.h +++ b/src/maple_driver/include/compiler.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under the Mulan PSL v1. * You can use this software according to the terms and conditions of the Mulan PSL v1. @@ -24,11 +24,12 @@ #include "mir_parser.h" namespace maple { -extern const std::string kBinNameJbc2mpl; -extern const std::string kBinNameMe; -extern const std::string kBinNameMpl2mpl; -extern const std::string kBinNameMplcg; -extern const std::string kBinNameMapleComb; +const std::string kBinNameNone = ""; +const std::string kBinNameJbc2mpl = "jbc2mpl"; +const std::string kBinNameMe = "me"; +const std::string kBinNameMpl2mpl = "mpl2mpl"; +const std::string kBinNameMplcg = "mplcg"; +const std::string kBinNameMapleComb = "maplecomb"; class Compiler { public: @@ -48,8 +49,8 @@ class Compiler { protected: virtual std::string GetBinPath(const MplOptions &mplOptions) const; - virtual std::string GetBinName() const { - return ""; + virtual const std::string &GetBinName() const { + return kBinNameNone; } virtual std::string GetInputFileName(const MplOptions &options) const { @@ -70,10 +71,6 @@ class Compiler { virtual std::string AppendOptimization(const MplOptions &options, const std::string &optionStr) const; - virtual std::vector GetBinNames() const { - return std::vector(); - } - bool CanAppendOptimization() const; private: @@ -101,11 +98,10 @@ class Jbc2MplCompiler : public Compiler { ~Jbc2MplCompiler() = default; private: - std::string GetBinName() const override; + const std::string &GetBinName() const override; DefaultOption GetDefaultOptions(const MplOptions &options) const override; void GetTmpFilesToDelete(const MplOptions &mplOptions, std::vector &tempFiles) const override; std::unordered_set GetFinalOutputs(const MplOptions &mplOptions) const override; - std::vector GetBinNames() const override; }; class MapleCombCompiler : public Compiler { @@ -133,8 +129,7 @@ class MplcgCompiler : public Compiler { private: std::string GetInputFileName(const MplOptions &options) const override; DefaultOption GetDefaultOptions(const MplOptions &options) const override; - std::string GetBinName() const override; - std::vector GetBinNames() const override; + const std::string &GetBinName() const override; }; } // namespace maple #endif // MAPLE_DRIVER_INCLUDE_COMPILER_H diff --git a/src/maple_driver/include/option_parser.h b/src/maple_driver/include/option_parser.h index f228412da855bbb834ab01fe295a6a52b567ccfe..03dece32e57e03317a018073140b6d8bd08e9f5f 100644 --- a/src/maple_driver/include/option_parser.h +++ b/src/maple_driver/include/option_parser.h @@ -1,5 +1,5 @@ /* - * Copyright (c) [2019-2020] Huawei Technologies Co.,Ltd.All rights reserved. + * Copyright (c) [2020] Huawei Technologies Co.,Ltd.All rights reserved. * * OpenArkCompiler is licensed under the Mulan PSL v1. * You can use this software according to the terms and conditions of the Mulan PSL v1. @@ -228,6 +228,11 @@ class OptionParser { std::vector