diff --git a/src/BUILD.gn b/src/BUILD.gn index d3151eceb1b1fdc8f3c9dbb1bbb94c4e81bd7b3c..c2406b6ae40c166d8b0ab9de67160593e3c0da34 100644 --- a/src/BUILD.gn +++ b/src/BUILD.gn @@ -6,12 +6,8 @@ config("mapleallcompilecfg") { ] if (GN_BUILD_TYPE == "DEBUG") { - cflags_c += [ - "-DDEBUG", - ] - cflags_cc += [ - "-DDEBUG", - ] + cflags_c += [ "-DDEBUG" ] + cflags_cc += [ "-DDEBUG" ] } if (HOST_ARCH == 64) { diff --git a/src/bin/jbc2mpl b/src/bin/jbc2mpl index a37f7269b4fa9d9a5e6ed47458b08456d3be3dd5..17dc2c32c6d4d65483c9d09f5de5231a67de1e21 100755 Binary files a/src/bin/jbc2mpl and b/src/bin/jbc2mpl differ diff --git a/src/bin/maple b/src/bin/maple index ca7759adca8fa036566c5f6814098959c016e248..a93ce9804a9290c9a5eafef1f5ae8660bb5ca8b8 100755 Binary files a/src/bin/maple and b/src/bin/maple differ diff --git a/src/bin/mplcg b/src/bin/mplcg index 74860e0b7cc4c0af80e6aca6fc5dd41746d5f6fd..d82b7ed62a8d37899a5b5d00f9921b1f7d75ee3a 100755 Binary files a/src/bin/mplcg and b/src/bin/mplcg differ diff --git a/src/deplibs/libmplutil.a b/src/deplibs/libmplutil.a index 29f99e06dfe6faaf4fe06be748d87fc64ed32c99..1295f6e06da54aece2c4a83a0ee32569dfa11f17 100644 Binary files a/src/deplibs/libmplutil.a and b/src/deplibs/libmplutil.a differ diff --git a/src/maple_driver/include/compiler.h b/src/maple_driver/include/compiler.h index 2881f4f9a882ad4fea4ef642b82e3180860337a7..e2cefeafe3c2a4042db181f630c041ac43df81eb 100644 --- a/src/maple_driver/include/compiler.h +++ b/src/maple_driver/include/compiler.h @@ -130,14 +130,11 @@ class MplcgCompiler : public Compiler { explicit MplcgCompiler(const std::string &name) : Compiler(name) {} ~MplcgCompiler() = default; - - 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; }; - } // namespace maple #endif // MAPLE_DRIVER_INCLUDE_COMPILER_H diff --git a/src/maple_driver/include/driver_runner.h b/src/maple_driver/include/driver_runner.h index 7ca19e26c7dee24ed02e31c29432cbc865d0484c..e48f9c4edf540b866f4f70f2fd098523d492f609 100644 --- a/src/maple_driver/include/driver_runner.h +++ b/src/maple_driver/include/driver_runner.h @@ -20,10 +20,7 @@ #include "me_option.h" #include "interleaved_manager.h" #include "error_code.h" - - namespace maple { - extern const std::string mpl2Mpl; extern const std::string mplME; @@ -32,7 +29,7 @@ class DriverRunner final { DriverRunner(MIRModule *theModule, const std::vector &exeNames, Options *mpl2mplOptions, std::string mpl2mplInput, MeOption *meOptions, const std::string &meInput, std::string actualInput, MemPool *optMp, bool timePhases = false, - bool genMeMpl = false) + bool genVtableImpl = false, bool genMeMpl = false) : theModule(theModule), exeNames(exeNames), mpl2mplOptions(mpl2mplOptions), @@ -42,17 +39,17 @@ class DriverRunner final { actualInput(actualInput), optMp(optMp), timePhases(timePhases), + genVtableImpl(genVtableImpl), genMeMpl(genMeMpl) {} DriverRunner(MIRModule *theModule, const std::vector &exeNames, std::string actualInput, MemPool *optMp, bool timePhases = false, bool genVtableImpl = false, bool genMeMpl = false) - : DriverRunner(theModule, exeNames, nullptr, "", nullptr, "", actualInput, optMp, timePhases, genMeMpl) {} + : DriverRunner(theModule, exeNames, nullptr, "", nullptr, "", actualInput, optMp, timePhases, genVtableImpl, + genMeMpl) {} ~DriverRunner() = default; ErrorCode Run(); - - private: static bool FuncOrderLessThan(const MIRFunction *left, const MIRFunction *right); @@ -64,8 +61,6 @@ class DriverRunner final { const PhaseManager &phaseManager) const; void AddPhase(std::vector &phases, const std::string phase, const PhaseManager &phaseManager) const; void ProcessMpl2mplAndMePhases(const std::string &outputFile, const std::string &vtableImplFile) const; - - MIRModule *theModule; std::vector exeNames; Options *mpl2mplOptions = nullptr; @@ -75,6 +70,7 @@ class DriverRunner final { std::string actualInput; MemPool *optMp; bool timePhases = false; + bool genVtableImpl = false; bool genMeMpl = false; std::string printOutExe; }; diff --git a/src/maple_driver/include/option_parser.h b/src/maple_driver/include/option_parser.h index f228412da855bbb834ab01fe295a6a52b567ccfe..3ef522dee9453213fb72f254e69be9ae3b9b3f6a 100644 --- a/src/maple_driver/include/option_parser.h +++ b/src/maple_driver/include/option_parser.h @@ -31,7 +31,8 @@ enum ArgCheckPolicy { kArgCheckPolicyNone, kArgCheckPolicyOptional, kArgCheckPolicyRequired, - kArgCheckPolicyNumeric + kArgCheckPolicyNumeric, + kArgCheckPolicyBool }; struct ExtraOption { @@ -90,7 +91,7 @@ struct Descriptor { const char * const exeName; // option key mapping to target tool - const ExtraOption extras[kMaxExtraOptions]; + const std::vector extras; #endif bool IsEnabledForCurrentBuild() const { @@ -203,6 +204,12 @@ class OptionParser { return nonOptionsArgs.size(); } +#ifdef OPTION_PARSER_EXTRAOPT + void InsertExtraUsage(const Descriptor &usage); +#endif + + void CreateNoOption(const Descriptor &usage); + void PrintUsage() const; #ifdef OPTION_PARSER_EXTRAOPT @@ -223,11 +230,15 @@ class OptionParser { } } bool CheckSpecialOption(const std::string &option, std::string &key, std::string &value); - const Descriptor *rawUsages; + std::vector rawUsages; std::multimap usages; std::vector