diff --git a/src/hir2mpl/common/include/hir2mpl_option.h b/src/hir2mpl/common/include/hir2mpl_option.h index 8751d1ec23b411fe64858264aac4004a71d2d8a5..fb8eb8251d6c602e2b15032f348a2980a843998b 100644 --- a/src/hir2mpl/common/include/hir2mpl_option.h +++ b/src/hir2mpl/common/include/hir2mpl_option.h @@ -22,50 +22,50 @@ #include namespace opts::hir2mpl { -extern cl::Option help; -extern cl::Option version; -extern cl::Option mpltSys; -extern cl::Option mpltApk; -extern cl::Option mplt; -extern cl::Option inClass; -extern cl::Option inJar; -extern cl::Option inDex; -extern cl::Option inAst; -extern cl::Option inMast; -extern cl::Option output; -extern cl::Option outputName; -extern cl::Option mpltOnly; -extern cl::Option asciimplt; -extern cl::Option dumpInstComment; -extern cl::Option noMplFile; -extern cl::Option dumpLevel; -extern cl::Option dumpTime; -extern cl::Option dumpComment; -extern cl::Option dumpLOC; -extern cl::Option dbgFriendly; -extern cl::Option dumpPhaseTime; -extern cl::Option dumpPhaseTimeDetail; -extern cl::Option rc; -extern cl::Option nobarrier; -extern cl::Option usesignedchar; -extern cl::Option be; -extern cl::Option o2; -extern cl::Option simplifyShortCircuit; -extern cl::Option enableVariableArray; -extern cl::Option funcInliceSize; -extern cl::Option np; -extern cl::Option dumpThreadTime; -extern cl::Option xbootclasspath; -extern cl::Option classloadercontext; -extern cl::Option dep; -extern cl::Option depsamename; -extern cl::Option npeCheckDynamic; -extern cl::Option boundaryCheckDynamic; -extern cl::Option safeRegion; -extern cl::Option dumpFEIRBB; -extern cl::Option dumpFEIRCFGGraph; -extern cl::Option wpaa; -extern cl::Option debug; +extern maplecl::Option help; +extern maplecl::Option version; +extern maplecl::Option mpltSys; +extern maplecl::Option mpltApk; +extern maplecl::Option mplt; +extern maplecl::Option inClass; +extern maplecl::Option inJar; +extern maplecl::Option inDex; +extern maplecl::Option inAst; +extern maplecl::Option inMast; +extern maplecl::Option output; +extern maplecl::Option outputName; +extern maplecl::Option mpltOnly; +extern maplecl::Option asciimplt; +extern maplecl::Option dumpInstComment; +extern maplecl::Option noMplFile; +extern maplecl::Option dumpLevel; +extern maplecl::Option dumpTime; +extern maplecl::Option dumpComment; +extern maplecl::Option dumpLOC; +extern maplecl::Option dbgFriendly; +extern maplecl::Option dumpPhaseTime; +extern maplecl::Option dumpPhaseTimeDetail; +extern maplecl::Option rc; +extern maplecl::Option nobarrier; +extern maplecl::Option usesignedchar; +extern maplecl::Option be; +extern maplecl::Option o2; +extern maplecl::Option simplifyShortCircuit; +extern maplecl::Option enableVariableArray; +extern maplecl::Option funcInliceSize; +extern maplecl::Option np; +extern maplecl::Option dumpThreadTime; +extern maplecl::Option xbootclasspath; +extern maplecl::Option classloadercontext; +extern maplecl::Option dep; +extern maplecl::Option depsamename; +extern maplecl::Option npeCheckDynamic; +extern maplecl::Option boundaryCheckDynamic; +extern maplecl::Option safeRegion; +extern maplecl::Option dumpFEIRBB; +extern maplecl::Option dumpFEIRCFGGraph; +extern maplecl::Option wpaa; +extern maplecl::Option debug; } diff --git a/src/hir2mpl/common/include/hir2mpl_options.h b/src/hir2mpl/common/include/hir2mpl_options.h index 37c467f5389ea2f04a13d26b17875b4f57b88680..9c0761e07710f3f953d2881ca5ac6f38e767bc46 100644 --- a/src/hir2mpl/common/include/hir2mpl_options.h +++ b/src/hir2mpl/common/include/hir2mpl_options.h @@ -43,86 +43,86 @@ class HIR2MPLOptions { private: template - using OptionProcessFactory = FunctionFactory; - using OptionFactory = OptionProcessFactory; + using OptionProcessFactory = FunctionFactory; + using OptionFactory = OptionProcessFactory; HIR2MPLOptions(); ~HIR2MPLOptions() = default; // option process - bool ProcessHelp(const cl::OptionInterface &opt); - bool ProcessVersion(const cl::OptionInterface &opt); + bool ProcessHelp(const maplecl::OptionInterface &opt); + bool ProcessVersion(const maplecl::OptionInterface &opt); // input control options - bool ProcessInClass(const cl::OptionInterface &mpltSys); - bool ProcessInJar(const cl::OptionInterface &mpltApk); - bool ProcessInDex(const cl::OptionInterface &inDex); - bool ProcessInAST(const cl::OptionInterface &inAst); - bool ProcessInMAST(const cl::OptionInterface &inMast); - bool ProcessInputMplt(const cl::OptionInterface &mplt); - bool ProcessInputMpltFromSys(const cl::OptionInterface &mpltSys); - bool ProcessInputMpltFromApk(const cl::OptionInterface &mpltApk); + bool ProcessInClass(const maplecl::OptionInterface &mpltSys); + bool ProcessInJar(const maplecl::OptionInterface &mpltApk); + bool ProcessInDex(const maplecl::OptionInterface &inDex); + bool ProcessInAST(const maplecl::OptionInterface &inAst); + bool ProcessInMAST(const maplecl::OptionInterface &inMast); + bool ProcessInputMplt(const maplecl::OptionInterface &mplt); + bool ProcessInputMpltFromSys(const maplecl::OptionInterface &mpltSys); + bool ProcessInputMpltFromApk(const maplecl::OptionInterface &mpltApk); // output control options - bool ProcessOutputPath(const cl::OptionInterface &output); - bool ProcessOutputName(const cl::OptionInterface &outputName); - bool ProcessGenMpltOnly(const cl::OptionInterface &opt); - bool ProcessGenAsciiMplt(const cl::OptionInterface &opt); - bool ProcessDumpInstComment(const cl::OptionInterface &opt); - bool ProcessNoMplFile(const cl::OptionInterface &opt); + bool ProcessOutputPath(const maplecl::OptionInterface &output); + bool ProcessOutputName(const maplecl::OptionInterface &outputName); + bool ProcessGenMpltOnly(const maplecl::OptionInterface &opt); + bool ProcessGenAsciiMplt(const maplecl::OptionInterface &opt); + bool ProcessDumpInstComment(const maplecl::OptionInterface &opt); + bool ProcessNoMplFile(const maplecl::OptionInterface &opt); // debug info control options - bool ProcessDumpLevel(const cl::OptionInterface &outputName); - bool ProcessDumpTime(const cl::OptionInterface &opt); - bool ProcessDumpComment(const cl::OptionInterface &opt); - bool ProcessDumpLOC(const cl::OptionInterface &opt); - bool ProcessDbgFriendly(const cl::OptionInterface &); - bool ProcessDumpPhaseTime(const cl::OptionInterface &opt); - bool ProcessDumpPhaseTimeDetail(const cl::OptionInterface &opt); + bool ProcessDumpLevel(const maplecl::OptionInterface &outputName); + bool ProcessDumpTime(const maplecl::OptionInterface &opt); + bool ProcessDumpComment(const maplecl::OptionInterface &opt); + bool ProcessDumpLOC(const maplecl::OptionInterface &opt); + bool ProcessDbgFriendly(const maplecl::OptionInterface &); + bool ProcessDumpPhaseTime(const maplecl::OptionInterface &opt); + bool ProcessDumpPhaseTimeDetail(const maplecl::OptionInterface &opt); // java compiler options - bool ProcessModeForJavaStaticFieldName(const cl::OptionInterface &opt); - bool ProcessJBCInfoUsePathName(const cl::OptionInterface &opt); - bool ProcessDumpJBCStmt(const cl::OptionInterface &opt); - bool ProcessDumpJBCAll(const cl::OptionInterface &opt); - bool ProcessDumpJBCErrorOnly(const cl::OptionInterface &opt); - bool ProcessDumpJBCFuncName(const cl::OptionInterface &opt); - bool ProcessEmitJBCLocalVarInfo(const cl::OptionInterface &opt); + bool ProcessModeForJavaStaticFieldName(const maplecl::OptionInterface &opt); + bool ProcessJBCInfoUsePathName(const maplecl::OptionInterface &opt); + bool ProcessDumpJBCStmt(const maplecl::OptionInterface &opt); + bool ProcessDumpJBCAll(const maplecl::OptionInterface &opt); + bool ProcessDumpJBCErrorOnly(const maplecl::OptionInterface &opt); + bool ProcessDumpJBCFuncName(const maplecl::OptionInterface &opt); + bool ProcessEmitJBCLocalVarInfo(const maplecl::OptionInterface &opt); // bc compiler options - bool ProcessRC(const cl::OptionInterface &opt); - bool ProcessNoBarrier(const cl::OptionInterface &opt); - bool ProcessO2(const cl::OptionInterface &opt); - bool ProcessSimplifyShortCircuit(const cl::OptionInterface &opt); - bool ProcessEnableVariableArray(const cl::OptionInterface &opt); - bool ProcessFuncInlineSize(const cl::OptionInterface &funcInliceSize); - bool ProcessWPAA(const cl::OptionInterface &opt); + bool ProcessRC(const maplecl::OptionInterface &opt); + bool ProcessNoBarrier(const maplecl::OptionInterface &opt); + bool ProcessO2(const maplecl::OptionInterface &opt); + bool ProcessSimplifyShortCircuit(const maplecl::OptionInterface &opt); + bool ProcessEnableVariableArray(const maplecl::OptionInterface &opt); + bool ProcessFuncInlineSize(const maplecl::OptionInterface &funcInliceSize); + bool ProcessWPAA(const maplecl::OptionInterface &opt); // ast compiler options - bool ProcessUseSignedChar(const cl::OptionInterface &opt); - bool ProcessBigEndian(const cl::OptionInterface &opt); + bool ProcessUseSignedChar(const maplecl::OptionInterface &opt); + bool ProcessBigEndian(const maplecl::OptionInterface &opt); // general stmt/bb/cfg options - bool ProcessDumpFEIRBB(const cl::OptionInterface &opt); - bool ProcessDumpFEIRCFGGraph(const cl::OptionInterface &opt); + bool ProcessDumpFEIRBB(const maplecl::OptionInterface &opt); + bool ProcessDumpFEIRCFGGraph(const maplecl::OptionInterface &opt); // multi-thread control options - bool ProcessNThreads(const cl::OptionInterface &numThreads); - bool ProcessDumpThreadTime(const cl::OptionInterface &opt); + bool ProcessNThreads(const maplecl::OptionInterface &numThreads); + bool ProcessDumpThreadTime(const maplecl::OptionInterface &opt); // On Demand Type Creation - bool ProcessXbootclasspath(const cl::OptionInterface &xbootclasspath); - bool ProcessClassLoaderContext(const cl::OptionInterface &classloadercontext); - bool ProcessCollectDepTypes(const cl::OptionInterface &dep); - bool ProcessDepSameNamePolicy(const cl::OptionInterface &depsamename); + bool ProcessXbootclasspath(const maplecl::OptionInterface &xbootclasspath); + bool ProcessClassLoaderContext(const maplecl::OptionInterface &classloadercontext); + bool ProcessCollectDepTypes(const maplecl::OptionInterface &dep); + bool ProcessDepSameNamePolicy(const maplecl::OptionInterface &depsamename); // EnhanceC - bool ProcessNpeCheckDynamic(const cl::OptionInterface &opt); - bool ProcessBoundaryCheckDynamic(const cl::OptionInterface &opt); - bool ProcessSafeRegion(const cl::OptionInterface &opt); + bool ProcessNpeCheckDynamic(const maplecl::OptionInterface &opt); + bool ProcessBoundaryCheckDynamic(const maplecl::OptionInterface &opt); + bool ProcessSafeRegion(const maplecl::OptionInterface &opt); // symbol resolve - bool ProcessAOT(const cl::OptionInterface &opt); + bool ProcessAOT(const maplecl::OptionInterface &opt); }; // class HIR2MPLOptions } // namespace maple #endif // HIR2MPL_INCLUDE_COMMON_HIR2MPL_OPTIONS_H diff --git a/src/hir2mpl/common/src/hir2mpl_option.cpp b/src/hir2mpl/common/src/hir2mpl_option.cpp index 01adc838efd90ee5fdb1abd86f8685973b1283dd..659386767611027e4d9519cce4b63128aea00c6b 100644 --- a/src/hir2mpl/common/src/hir2mpl_option.cpp +++ b/src/hir2mpl/common/src/hir2mpl_option.cpp @@ -20,79 +20,79 @@ namespace opts::hir2mpl { -cl::Option help({"--help", "-h"}, +maplecl::Option help({"--help", "-h"}, " -h, -help : print usage and exit", {hir2mplCategory}); -cl::Option version({"--version", "-v"}, +maplecl::Option version({"--version", "-v"}, " -v, -version : print version and exit", {hir2mplCategory}); -cl::Option mpltSys({"--mplt-sys", "-mplt-sys"}, +maplecl::Option mpltSys({"--mplt-sys", "-mplt-sys"}, " -mplt-sys sys1.mplt,sys2.mplt\n" " : input sys mplt files", {hir2mplCategory}); -cl::Option mpltApk({"--mplt-apk", "-mplt-apk"}, +maplecl::Option mpltApk({"--mplt-apk", "-mplt-apk"}, " -mplt-apk apk1.mplt,apk2.mplt\n" " : input apk mplt files", {hir2mplCategory}); -cl::Option mplt({"--mplt", "-mplt"}, +maplecl::Option mplt({"--mplt", "-mplt"}, " -mplt lib1.mplt,lib2.mplt\n" " : input mplt files", {hir2mplCategory}); -cl::Option inClass({"--in-class", "-in-class"}, +maplecl::Option inClass({"--in-class", "-in-class"}, " -in-class file1.jar,file2.jar\n" " : input class files", {hir2mplCategory}); -cl::Option inJar({"--in-jar", "-in-jar"}, +maplecl::Option inJar({"--in-jar", "-in-jar"}, " -in-jar file1.jar,file2.jar\n" " : input jar files", {hir2mplCategory}); -cl::Option inDex({"--in-dex", "-in-dex"}, +maplecl::Option inDex({"--in-dex", "-in-dex"}, " -in-dex file1.dex,file2.dex\n" " : input dex files", {hir2mplCategory}); -cl::Option inAst({"--in-ast", "-in-ast"}, +maplecl::Option inAst({"--in-ast", "-in-ast"}, " -in-ast file1.ast,file2.ast\n" " : input ast files", {hir2mplCategory}); -cl::Option inMast({"--in-mast", "-in-mast"}, +maplecl::Option inMast({"--in-mast", "-in-mast"}, " -in-mast file1.mast,file2.mast\n" " : input mast files", {hir2mplCategory}); -cl::Option output({"--output", "-p"}, +maplecl::Option output({"--output", "-p"}, " -p, -output : output path", {hir2mplCategory}); -cl::Option outputName({"--output-name", "-o"}, +maplecl::Option outputName({"--output-name", "-o"}, " -o, -output-name : output name", {hir2mplCategory}); -cl::Option mpltOnly({"--t", "-t"}, +maplecl::Option mpltOnly({"--t", "-t"}, " -t : generate mplt only", {hir2mplCategory}); -cl::Option asciimplt({"--asciimplt", "-asciimplt"}, +maplecl::Option asciimplt({"--asciimplt", "-asciimplt"}, " -asciimplt : generate mplt in ascii format", {hir2mplCategory}); -cl::Option dumpInstComment({"--dump-inst-comment", "-dump-inst-comment"}, +maplecl::Option dumpInstComment({"--dump-inst-comment", "-dump-inst-comment"}, " -dump-inst-comment : dump instruction comment", {hir2mplCategory}); -cl::Option noMplFile({"--no-mpl-file", "-no-mpl-file"}, +maplecl::Option noMplFile({"--no-mpl-file", "-no-mpl-file"}, " -no-mpl-file : disable dump mpl file", {hir2mplCategory}); -cl::Option dumpLevel({"--dump-level", "-d"}, +maplecl::Option dumpLevel({"--dump-level", "-d"}, " -d, -dump-level xx : debug info dump level\n" " [0] disable\n" " [1] dump simple info\n" @@ -100,127 +100,127 @@ cl::Option dumpLevel({"--dump-level", "-d"}, " [3] dump debug info", {hir2mplCategory}); -cl::Option dumpTime({"--dump-time", "-dump-time"}, +maplecl::Option dumpTime({"--dump-time", "-dump-time"}, " -dump-time : dump time", {hir2mplCategory}); -cl::Option dumpComment({"--dump-comment", "-dump-comment"}, +maplecl::Option dumpComment({"--dump-comment", "-dump-comment"}, " -dump-comment : gen comment stmt", {hir2mplCategory}); -cl::Option dumpLOC({"--dump-LOC", "-dump-LOC"}, +maplecl::Option dumpLOC({"--dump-LOC", "-dump-LOC"}, " -dump-LOC : gen LOC", {hir2mplCategory}); -cl::Option dbgFriendly({"--g", "-g"}, +maplecl::Option dbgFriendly({"--g", "-g"}, " -g : emit debug friendly mpl, including\n" " no variable renaming\n" " gen LOC", {hir2mplCategory}); -cl::Option dumpPhaseTime({"--dump-phase-time", "-dump-phase-time"}, +maplecl::Option dumpPhaseTime({"--dump-phase-time", "-dump-phase-time"}, " -dump-phase-time : dump total phase time", {hir2mplCategory}); -cl::Option dumpPhaseTimeDetail({"-dump-phase-time-detail", "--dump-phase-time-detail"}, +maplecl::Option dumpPhaseTimeDetail({"-dump-phase-time-detail", "--dump-phase-time-detail"}, " -dump-phase-time-detail\n" \ " : dump phase time for each method", {hir2mplCategory}); -cl::Option rc({"-rc", "--rc"}, +maplecl::Option rc({"-rc", "--rc"}, " -rc : enable rc", {hir2mplCategory}); -cl::Option nobarrier({"-nobarrier", "--nobarrier"}, +maplecl::Option nobarrier({"-nobarrier", "--nobarrier"}, " -nobarrier : no barrier", {hir2mplCategory}); -cl::Option usesignedchar({"-usesignedchar", "--usesignedchar"}, +maplecl::Option usesignedchar({"-usesignedchar", "--usesignedchar"}, " -usesignedchar : use signed char", {hir2mplCategory}); -cl::Option be({"-be", "--be"}, +maplecl::Option be({"-be", "--be"}, " -be : enable big endian", {hir2mplCategory}); -cl::Option o2({"-O2", "--O2"}, +maplecl::Option o2({"-O2", "--O2"}, " -O2 : enable hir2mpl O2 optimize", {hir2mplCategory}); -cl::Option simplifyShortCircuit({"-simplify-short-circuit", "--simplify-short-circuit"}, +maplecl::Option simplifyShortCircuit({"-simplify-short-circuit", "--simplify-short-circuit"}, " -simplify-short-circuit\n" \ " : enable simplify short circuit", {hir2mplCategory}); -cl::Option enableVariableArray({"-enable-variable-array", "--enable-variable-array"}, +maplecl::Option enableVariableArray({"-enable-variable-array", "--enable-variable-array"}, " -enable-variable-array\n" \ " : enable variable array", {hir2mplCategory}); -cl::Option funcInliceSize({"-func-inline-size", "--func-inline-size"}, +maplecl::Option funcInliceSize({"-func-inline-size", "--func-inline-size"}, " -func-inline-size : set func inline size", {hir2mplCategory}); -cl::Option np({"-np", "--np"}, +maplecl::Option np({"-np", "--np"}, " -np num : number of threads", {hir2mplCategory}); -cl::Option dumpThreadTime({"-dump-thread-time", "--dump-thread-time"}, +maplecl::Option dumpThreadTime({"-dump-thread-time", "--dump-thread-time"}, " -dump-thread-time : dump thread time in mpl schedular", {hir2mplCategory}); -cl::Option xbootclasspath({"-Xbootclasspath", "--Xbootclasspath"}, +maplecl::Option xbootclasspath({"-Xbootclasspath", "--Xbootclasspath"}, " -Xbootclasspath=bootclasspath\n" \ " : boot class path list", {hir2mplCategory}); -cl::Option classloadercontext({"-classloadercontext", "--classloadercontext"}, +maplecl::Option classloadercontext({"-classloadercontext", "--classloadercontext"}, " -classloadercontext=pcl\n" \ " : class loader context \n" \ " : path class loader", {hir2mplCategory}); -cl::Option dep({"-dep", "--dep"}, +maplecl::Option dep({"-dep", "--dep"}, " -dep=all or func\n" \ " : [all] collect all dependent types\n" \ " : [func] collect dependent types in function", {hir2mplCategory}); -cl::Option depsamename({"-depsamename", "--depsamename"}, +maplecl::Option depsamename({"-depsamename", "--depsamename"}, " -DepSameNamePolicy=sys or src\n" \ " : [sys] load type from sys when on-demand load same name type\n" \ " : [src] load type from src when on-demand load same name type", {hir2mplCategory}); -cl::Option npeCheckDynamic({"-npe-check-dynamic", "--npe-check-dynamic"}, +maplecl::Option npeCheckDynamic({"-npe-check-dynamic", "--npe-check-dynamic"}, " -npe-check-dynamic : Nonnull pointr dynamic checking", {hir2mplCategory}); -cl::Option boundaryCheckDynamic({"-boundary-check-dynamic", "--boundary-check-dynamic"}, +maplecl::Option boundaryCheckDynamic({"-boundary-check-dynamic", "--boundary-check-dynamic"}, " -boundary-check-dynamic\n" \ " : Boundary dynamic checking", {hir2mplCategory}); -cl::Option safeRegion({"-safe-region", "--safe-region"}, +maplecl::Option safeRegion({"-safe-region", "--safe-region"}, " -boundary-check-dynamic\n" \ " -safe-region : Enable safe region", {hir2mplCategory}); -cl::Option dumpFEIRBB({"-dump-bb", "--dump-bb"}, +maplecl::Option dumpFEIRBB({"-dump-bb", "--dump-bb"}, " -dump-bb : dump basic blocks info", {hir2mplCategory}); -cl::Option dumpFEIRCFGGraph({"-dump-cfg", "--dump-cfg"}, +maplecl::Option dumpFEIRCFGGraph({"-dump-cfg", "--dump-cfg"}, " -dump-cfg funcname1,funcname2\n" \ " : dump cfg graph to dot file", {hir2mplCategory}); -cl::Option wpaa({"-wpaa", "--wpaa"}, +maplecl::Option wpaa({"-wpaa", "--wpaa"}, " -dump-cfg funcname1,funcname2\n" \ " -wpaa : enable whole program ailas analysis", {hir2mplCategory}); -cl::Option debug({"-debug", "--debug"}, +maplecl::Option debug({"-debug", "--debug"}, " -debug : dump enabled options", {hir2mplCategory}); diff --git a/src/hir2mpl/common/src/hir2mpl_options.cpp b/src/hir2mpl/common/src/hir2mpl_options.cpp index e4f0c76ee609b2909ea8f5e28725c04dbd31dd43..9bc5f0050af494849d1dbba2d975500dab17fccc 100644 --- a/src/hir2mpl/common/src/hir2mpl_options.cpp +++ b/src/hir2mpl/common/src/hir2mpl_options.cpp @@ -176,14 +176,14 @@ bool HIR2MPLOptions::SolveOptions(bool isDebug) { bool HIR2MPLOptions::SolveArgs(int argc, char **argv) { - cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, hir2mplCategory); + maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, hir2mplCategory); bool result = SolveOptions(opts::hir2mpl::debug); if (!result) { return result; } std::vector inputs; - for (auto &arg : cl::CommandLine::GetCommandLine().badCLArgs) { + for (auto &arg : maplecl::CommandLine::GetCommandLine().badCLArgs) { if (FileUtils::IsFileExists(arg.first)) { inputs.push_back(arg.first); } else { @@ -207,24 +207,24 @@ bool HIR2MPLOptions::SolveArgs(int argc, char **argv) { void HIR2MPLOptions::DumpUsage() const { std::cout << "\n====== Usage: hir2mpl [options] input1 input2 input3 ======\n"; - cl::CommandLine::GetCommandLine().HelpPrinter(hir2mplCategory); + maplecl::CommandLine::GetCommandLine().HelpPrinter(hir2mplCategory); } void HIR2MPLOptions::DumpVersion() const { std::cout << "Maple FE Version : " << Version::GetVersionStr() << std::endl; } -bool HIR2MPLOptions::ProcessHelp(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessHelp(const maplecl::OptionInterface &) { DumpUsage(); return false; } -bool HIR2MPLOptions::ProcessVersion(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessVersion(const maplecl::OptionInterface &) { DumpVersion(); return false; } -bool HIR2MPLOptions::ProcessInClass(const cl::OptionInterface &inClass) { +bool HIR2MPLOptions::ProcessInClass(const maplecl::OptionInterface &inClass) { std::string arg = inClass.GetCommonValue(); std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -233,7 +233,7 @@ bool HIR2MPLOptions::ProcessInClass(const cl::OptionInterface &inClass) { return true; } -bool HIR2MPLOptions::ProcessInJar(const cl::OptionInterface &inJar) { +bool HIR2MPLOptions::ProcessInJar(const maplecl::OptionInterface &inJar) { std::string arg = inJar.GetCommonValue(); std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -242,7 +242,7 @@ bool HIR2MPLOptions::ProcessInJar(const cl::OptionInterface &inJar) { return true; } -bool HIR2MPLOptions::ProcessInDex(const cl::OptionInterface &inDex) { +bool HIR2MPLOptions::ProcessInDex(const maplecl::OptionInterface &inDex) { std::string arg = inDex.GetCommonValue(); std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -251,7 +251,7 @@ bool HIR2MPLOptions::ProcessInDex(const cl::OptionInterface &inDex) { return true; } -bool HIR2MPLOptions::ProcessInAST(const cl::OptionInterface &inAst) { +bool HIR2MPLOptions::ProcessInAST(const maplecl::OptionInterface &inAst) { std::string arg = inAst.GetCommonValue(); std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -260,7 +260,7 @@ bool HIR2MPLOptions::ProcessInAST(const cl::OptionInterface &inAst) { return true; } -bool HIR2MPLOptions::ProcessInMAST(const cl::OptionInterface &inMast) { +bool HIR2MPLOptions::ProcessInMAST(const maplecl::OptionInterface &inMast) { std::string arg = inMast.GetCommonValue(); std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -269,7 +269,7 @@ bool HIR2MPLOptions::ProcessInMAST(const cl::OptionInterface &inMast) { return true; } -bool HIR2MPLOptions::ProcessInputMplt(const cl::OptionInterface &mplt) { +bool HIR2MPLOptions::ProcessInputMplt(const maplecl::OptionInterface &mplt) { std::string arg = mplt.GetCommonValue(); std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -278,7 +278,7 @@ bool HIR2MPLOptions::ProcessInputMplt(const cl::OptionInterface &mplt) { return true; } -bool HIR2MPLOptions::ProcessInputMpltFromSys(const cl::OptionInterface &mpltSys) { +bool HIR2MPLOptions::ProcessInputMpltFromSys(const maplecl::OptionInterface &mpltSys) { std::string arg = mpltSys.GetCommonValue(); std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -287,7 +287,7 @@ bool HIR2MPLOptions::ProcessInputMpltFromSys(const cl::OptionInterface &mpltSys) return true; } -bool HIR2MPLOptions::ProcessInputMpltFromApk(const cl::OptionInterface &mpltApk) { +bool HIR2MPLOptions::ProcessInputMpltFromApk(const maplecl::OptionInterface &mpltApk) { std::string arg = mpltApk.GetCommonValue();; std::list listFiles = SplitByComma(arg); for (const std::string &fileName : listFiles) { @@ -296,76 +296,76 @@ bool HIR2MPLOptions::ProcessInputMpltFromApk(const cl::OptionInterface &mpltApk) return true; } -bool HIR2MPLOptions::ProcessOutputPath(const cl::OptionInterface &output) { +bool HIR2MPLOptions::ProcessOutputPath(const maplecl::OptionInterface &output) { std::string arg = output.GetCommonValue(); FEOptions::GetInstance().SetOutputPath(arg); return true; } -bool HIR2MPLOptions::ProcessOutputName(const cl::OptionInterface &outputName) { +bool HIR2MPLOptions::ProcessOutputName(const maplecl::OptionInterface &outputName) { std::string arg = outputName.GetCommonValue(); FEOptions::GetInstance().SetOutputName(arg); return true; } -bool HIR2MPLOptions::ProcessGenMpltOnly(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessGenMpltOnly(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsGenMpltOnly(true); return true; } -bool HIR2MPLOptions::ProcessGenAsciiMplt(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessGenAsciiMplt(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsGenAsciiMplt(true); return true; } -bool HIR2MPLOptions::ProcessDumpInstComment(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpInstComment(const maplecl::OptionInterface &) { FEOptions::GetInstance().EnableDumpInstComment(); return true; } -bool HIR2MPLOptions::ProcessNoMplFile(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessNoMplFile(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetNoMplFile(); return true; } -bool HIR2MPLOptions::ProcessDumpLevel(const cl::OptionInterface &outputName) { +bool HIR2MPLOptions::ProcessDumpLevel(const maplecl::OptionInterface &outputName) { uint32_t arg = outputName.GetCommonValue(); FEOptions::GetInstance().SetDumpLevel(arg); return true; } -bool HIR2MPLOptions::ProcessDumpTime(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpTime(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpTime(true); return true; } -bool HIR2MPLOptions::ProcessDumpComment(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpComment(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpComment(true); return true; } -bool HIR2MPLOptions::ProcessDumpLOC(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpLOC(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpLOC(true); return true; } -bool HIR2MPLOptions::ProcessDbgFriendly(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDbgFriendly(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetDbgFriendly(true); return true; } -bool HIR2MPLOptions::ProcessDumpPhaseTime(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpPhaseTime(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpPhaseTime(true); return true; } -bool HIR2MPLOptions::ProcessDumpPhaseTimeDetail(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpPhaseTimeDetail(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpPhaseTimeDetail(true); return true; } // java compiler options -bool HIR2MPLOptions::ProcessModeForJavaStaticFieldName(const cl::OptionInterface &opt) { +bool HIR2MPLOptions::ProcessModeForJavaStaticFieldName(const maplecl::OptionInterface &opt) { const std::string &arg = opt.GetCommonValue(); if (arg.compare("notype") == 0) { FEOptions::GetInstance().SetModeJavaStaticFieldName(FEOptions::ModeJavaStaticFieldName::kNoType); @@ -380,27 +380,27 @@ bool HIR2MPLOptions::ProcessModeForJavaStaticFieldName(const cl::OptionInterface return true; } -bool HIR2MPLOptions::ProcessJBCInfoUsePathName(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessJBCInfoUsePathName(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsJBCInfoUsePathName(true); return true; } -bool HIR2MPLOptions::ProcessDumpJBCStmt(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpJBCStmt(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpJBCStmt(true); return true; } -bool HIR2MPLOptions::ProcessDumpJBCAll(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpJBCAll(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpJBCAll(true); return true; } -bool HIR2MPLOptions::ProcessDumpJBCErrorOnly(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpJBCErrorOnly(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpJBCErrorOnly(true); return true; } -bool HIR2MPLOptions::ProcessDumpJBCFuncName(const cl::OptionInterface &opt) { +bool HIR2MPLOptions::ProcessDumpJBCFuncName(const maplecl::OptionInterface &opt) { std::string arg = opt.GetCommonValue(); while (!arg.empty()) { size_t pos = arg.find(","); @@ -415,40 +415,40 @@ bool HIR2MPLOptions::ProcessDumpJBCFuncName(const cl::OptionInterface &opt) { return true; } -bool HIR2MPLOptions::ProcessEmitJBCLocalVarInfo(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessEmitJBCLocalVarInfo(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsEmitJBCLocalVarInfo(true); return true; } // bc compiler options -bool HIR2MPLOptions::ProcessRC(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessRC(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetRC(true); return true; } -bool HIR2MPLOptions::ProcessNoBarrier(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessNoBarrier(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetNoBarrier(true); return true; } // ast compiler options -bool HIR2MPLOptions::ProcessUseSignedChar(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessUseSignedChar(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetUseSignedChar(true); return true; } -bool HIR2MPLOptions::ProcessBigEndian(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessBigEndian(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetBigEndian(true); return true; } // general stmt/bb/cfg debug options -bool HIR2MPLOptions::ProcessDumpFEIRBB(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpFEIRBB(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsDumpFEIRBB(true); return true; } -bool HIR2MPLOptions::ProcessDumpFEIRCFGGraph(const cl::OptionInterface &opt) { +bool HIR2MPLOptions::ProcessDumpFEIRCFGGraph(const maplecl::OptionInterface &opt) { std::string arg = opt.GetCommonValue(); std::list funcNameList = SplitByComma(arg); for (const std::string &funcName : funcNameList) { @@ -458,13 +458,13 @@ bool HIR2MPLOptions::ProcessDumpFEIRCFGGraph(const cl::OptionInterface &opt) { } // multi-thread control options -bool HIR2MPLOptions::ProcessNThreads(const cl::OptionInterface &numThreads) { +bool HIR2MPLOptions::ProcessNThreads(const maplecl::OptionInterface &numThreads) { uint32_t num = numThreads.GetCommonValue(); FEOptions::GetInstance().SetNThreads(num); return true; } -bool HIR2MPLOptions::ProcessDumpThreadTime(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessDumpThreadTime(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetDumpThreadTime(true); return true; } @@ -502,21 +502,21 @@ void HIR2MPLOptions::ProcessInputFiles(const std::vector &inputs) { } // Xbootclasspath -bool HIR2MPLOptions::ProcessXbootclasspath(const cl::OptionInterface &xbootclasspath) { +bool HIR2MPLOptions::ProcessXbootclasspath(const maplecl::OptionInterface &xbootclasspath) { std::string arg = xbootclasspath.GetCommonValue(); FEOptions::GetInstance().SetXBootClassPath(arg); return true; } // PCL -bool HIR2MPLOptions::ProcessClassLoaderContext(const cl::OptionInterface &classloadercontext) { +bool HIR2MPLOptions::ProcessClassLoaderContext(const maplecl::OptionInterface &classloadercontext) { std::string arg = classloadercontext.GetCommonValue(); FEOptions::GetInstance().SetClassLoaderContext(arg); return true; } // Dep -bool HIR2MPLOptions::ProcessCollectDepTypes(const cl::OptionInterface &dep) { +bool HIR2MPLOptions::ProcessCollectDepTypes(const maplecl::OptionInterface &dep) { const std::string arg = dep.GetCommonValue(); if (arg.compare("all") == 0) { FEOptions::GetInstance().SetModeCollectDepTypes(FEOptions::ModeCollectDepTypes::kAll); @@ -530,7 +530,7 @@ bool HIR2MPLOptions::ProcessCollectDepTypes(const cl::OptionInterface &dep) { } // SameNamePolicy -bool HIR2MPLOptions::ProcessDepSameNamePolicy(const cl::OptionInterface &depsamename) { +bool HIR2MPLOptions::ProcessDepSameNamePolicy(const maplecl::OptionInterface &depsamename) { const std::string arg = depsamename.GetCommonValue(); if (arg.compare("sys") == 0) { FEOptions::GetInstance().SetModeDepSameNamePolicy(FEOptions::ModeDepSameNamePolicy::kSys); @@ -544,17 +544,17 @@ bool HIR2MPLOptions::ProcessDepSameNamePolicy(const cl::OptionInterface &depsame } // EnhanceC -bool HIR2MPLOptions::ProcessNpeCheckDynamic(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessNpeCheckDynamic(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetNpeCheckDynamic(true); return true; } -bool HIR2MPLOptions::ProcessBoundaryCheckDynamic(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessBoundaryCheckDynamic(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetBoundaryCheckDynamic(true); return true; } -bool HIR2MPLOptions::ProcessSafeRegion(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessSafeRegion(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetSafeRegion(true); // boundary and npe checking options will be opened, if safe region option is opened FEOptions::GetInstance().SetNpeCheckDynamic(true); @@ -562,35 +562,35 @@ bool HIR2MPLOptions::ProcessSafeRegion(const cl::OptionInterface &) { return true; } -bool HIR2MPLOptions::ProcessO2(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessO2(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetO2(true); return true; } -bool HIR2MPLOptions::ProcessSimplifyShortCircuit(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessSimplifyShortCircuit(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetSimplifyShortCircuit(true); return true; } -bool HIR2MPLOptions::ProcessEnableVariableArray(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessEnableVariableArray(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetEnableVariableArray(true); return true; } -bool HIR2MPLOptions::ProcessFuncInlineSize(const cl::OptionInterface &funcInliceSize) { +bool HIR2MPLOptions::ProcessFuncInlineSize(const maplecl::OptionInterface &funcInliceSize) { uint32_t size = funcInliceSize.GetCommonValue(); FEOptions::GetInstance().SetFuncInlineSize(size); return true; } -bool HIR2MPLOptions::ProcessWPAA(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessWPAA(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetWPAA(true); FEOptions::GetInstance().SetFuncInlineSize(UINT32_MAX); return true; } // AOT -bool HIR2MPLOptions::ProcessAOT(const cl::OptionInterface &) { +bool HIR2MPLOptions::ProcessAOT(const maplecl::OptionInterface &) { FEOptions::GetInstance().SetIsAOT(true); return true; } diff --git a/src/hir2mpl/test/common/hir2mpl_ut_options.cpp b/src/hir2mpl/test/common/hir2mpl_ut_options.cpp index 78d844667fc406aa11b0a1ca1bc9ad8e76ed208e..2ce63e80b8f71d64e5679b4285fc09e75113ef92 100644 --- a/src/hir2mpl/test/common/hir2mpl_ut_options.cpp +++ b/src/hir2mpl/test/common/hir2mpl_ut_options.cpp @@ -22,25 +22,25 @@ namespace maple { namespace opts::hir2mplut { -static cl::OptionCategory hir2mplUTCategory; +static maplecl::OptionCategory hir2mplUTCategory; -cl::Option help({"--help", "-h"}, +maplecl::Option help({"--help", "-h"}, " -h, -help : print usage and exit", {hir2mplUTCategory}); -cl::Option genBase64({"--gen-base64", "-gen-base64"}, +maplecl::Option genBase64({"--gen-base64", "-gen-base64"}, " -gen-base64 file.xx : generate base64 string for file.xx", {hir2mplUTCategory}); -cl::Option mplt({"--mplt", "-mplt"}, +maplecl::Option mplt({"--mplt", "-mplt"}, " -mplt lib1.mplt,lib2.mplt\n" " : input mplt files", {hir2mplUTCategory}); -cl::Option inClass({"--in-class", "-in-class"}, +maplecl::Option inClass({"--in-class", "-in-class"}, " -in-class file1.jar,file2.jar\n" " : input class files", {hir2mplUTCategory}); -cl::Option inJar({"--in-jar", "-in-jar"}, +maplecl::Option inJar({"--in-jar", "-in-jar"}, " -in-jar file1.jar,file2.jar\n" " : input jar files", {hir2mplUTCategory}); @@ -59,7 +59,7 @@ void HIR2MPLUTOptions::DumpUsage() const { << " Run gtest: hir2mplUT test [ options for gtest ]\n" << " Run ext mode: hir2mplUT ext [ options ]\n" << "========= options for ext mode =========\n"; - cl::CommandLine::GetCommandLine().HelpPrinter(opts::hir2mplut::hir2mplUTCategory); + maplecl::CommandLine::GetCommandLine().HelpPrinter(opts::hir2mplut::hir2mplUTCategory); exit(1); } @@ -84,7 +84,7 @@ bool HIR2MPLUTOptions::SolveArgs(int argc, char **argv) { } runAll = false; - cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, + maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, opts::hir2mplut::hir2mplUTCategory); if (opts::hir2mplut::help) { DumpUsage(); diff --git a/src/mapleall/maple_be/include/cg/cg_options.h b/src/mapleall/maple_be/include/cg/cg_options.h index 9565aa4f7b14ba707b4d909670af7dd71bad00b5..bcad06a21596c083bf61f1ff39ab756bb92ab79a 100644 --- a/src/mapleall/maple_be/include/cg/cg_options.h +++ b/src/mapleall/maple_be/include/cg/cg_options.h @@ -25,113 +25,113 @@ namespace opts::cg { -extern cl::Option pie; -extern cl::Option fpic; -extern cl::Option verboseAsm; -extern cl::Option verboseCg; -extern cl::Option maplelinker; -extern cl::Option quiet; -extern cl::Option cg; -extern cl::Option replaceAsm; -extern cl::Option generalRegOnly; -extern cl::Option lazyBinding; -extern cl::Option hotFix; -extern cl::Option ebo; -extern cl::Option cfgo; -extern cl::Option ico; -extern cl::Option storeloadopt; -extern cl::Option globalopt; -extern cl::Option hotcoldsplit; -extern cl::Option prelsra; -extern cl::Option lsraLvarspill; -extern cl::Option lsraOptcallee; -extern cl::Option calleeregsPlacement; -extern cl::Option ssapreSave; -extern cl::Option ssupreRestore; -extern cl::Option prepeep; -extern cl::Option peep; -extern cl::Option preschedule; -extern cl::Option schedule; -extern cl::Option retMerge; -extern cl::Option vregRename; -extern cl::Option fullcolor; -extern cl::Option writefieldopt; -extern cl::Option dumpOlog; -extern cl::Option nativeopt; -extern cl::Option objmap; -extern cl::Option yieldpoint; -extern cl::Option proepilogue; -extern cl::Option localRc; -extern cl::Option insertCall; -extern cl::Option addDebugTrace; -extern cl::Option addFuncProfile; -extern cl::Option classListFile; -extern cl::Option genCMacroDef; -extern cl::Option genGctibFile; -extern cl::Option stackProtectorStrong; -extern cl::Option stackProtectorAll; -extern cl::Option debug; -extern cl::Option gdwarf; -extern cl::Option gsrc; -extern cl::Option gmixedsrc; -extern cl::Option gmixedasm; -extern cl::Option profile; -extern cl::Option withRaLinearScan; -extern cl::Option withRaGraphColor; -extern cl::Option patchLongBranch; -extern cl::Option constFold; -extern cl::Option ehExclusiveList; -extern cl::Option o0; -extern cl::Option o1; -extern cl::Option o2; -extern cl::Option os; -extern cl::Option lsraBb; -extern cl::Option lsraInsn; -extern cl::Option lsraOverlap; -extern cl::Option remat; -extern cl::Option suppressFileinfo; -extern cl::Option dumpCfg; -extern cl::Option target; -extern cl::Option dumpPhases; -extern cl::Option skipPhases; -extern cl::Option skipFrom; -extern cl::Option skipAfter; -extern cl::Option dumpFunc; -extern cl::Option timePhases; -extern cl::Option useBarriersForVolatile; -extern cl::Option range; -extern cl::Option fastAlloc; -extern cl::Option spillRange; -extern cl::Option dupBb; -extern cl::Option calleeCfi; -extern cl::Option printFunc; -extern cl::Option cyclePatternList; -extern cl::Option duplicateAsmList; -extern cl::Option duplicateAsmList2; -extern cl::Option blockMarker; -extern cl::Option soeCheck; -extern cl::Option checkArraystore; -extern cl::Option debugSchedule; -extern cl::Option bruteforceSchedule; -extern cl::Option simulateSchedule; -extern cl::Option crossLoc; -extern cl::Option floatAbi; -extern cl::Option filetype; -extern cl::Option longCalls; -extern cl::Option functionSections; -extern cl::Option omitFramePointer; -extern cl::Option fastMath; -extern cl::Option tailcall; -extern cl::Option alignAnalysis; -extern cl::Option cgSsa; -extern cl::Option common; -extern cl::Option arm64Ilp32; -extern cl::Option condbrAlign; -extern cl::Option alignMinBbSize; -extern cl::Option alignMaxBbSize; -extern cl::Option loopAlignPow; -extern cl::Option jumpAlignPow; -extern cl::Option funcAlignPow; +extern maplecl::Option pie; +extern maplecl::Option fpic; +extern maplecl::Option verboseAsm; +extern maplecl::Option verboseCg; +extern maplecl::Option maplelinker; +extern maplecl::Option quiet; +extern maplecl::Option cg; +extern maplecl::Option replaceAsm; +extern maplecl::Option generalRegOnly; +extern maplecl::Option lazyBinding; +extern maplecl::Option hotFix; +extern maplecl::Option ebo; +extern maplecl::Option cfgo; +extern maplecl::Option ico; +extern maplecl::Option storeloadopt; +extern maplecl::Option globalopt; +extern maplecl::Option hotcoldsplit; +extern maplecl::Option prelsra; +extern maplecl::Option lsraLvarspill; +extern maplecl::Option lsraOptcallee; +extern maplecl::Option calleeregsPlacement; +extern maplecl::Option ssapreSave; +extern maplecl::Option ssupreRestore; +extern maplecl::Option prepeep; +extern maplecl::Option peep; +extern maplecl::Option preschedule; +extern maplecl::Option schedule; +extern maplecl::Option retMerge; +extern maplecl::Option vregRename; +extern maplecl::Option fullcolor; +extern maplecl::Option writefieldopt; +extern maplecl::Option dumpOlog; +extern maplecl::Option nativeopt; +extern maplecl::Option objmap; +extern maplecl::Option yieldpoint; +extern maplecl::Option proepilogue; +extern maplecl::Option localRc; +extern maplecl::Option insertCall; +extern maplecl::Option addDebugTrace; +extern maplecl::Option addFuncProfile; +extern maplecl::Option classListFile; +extern maplecl::Option genCMacroDef; +extern maplecl::Option genGctibFile; +extern maplecl::Option stackProtectorStrong; +extern maplecl::Option stackProtectorAll; +extern maplecl::Option debug; +extern maplecl::Option gdwarf; +extern maplecl::Option gsrc; +extern maplecl::Option gmixedsrc; +extern maplecl::Option gmixedasm; +extern maplecl::Option profile; +extern maplecl::Option withRaLinearScan; +extern maplecl::Option withRaGraphColor; +extern maplecl::Option patchLongBranch; +extern maplecl::Option constFold; +extern maplecl::Option ehExclusiveList; +extern maplecl::Option o0; +extern maplecl::Option o1; +extern maplecl::Option o2; +extern maplecl::Option os; +extern maplecl::Option lsraBb; +extern maplecl::Option lsraInsn; +extern maplecl::Option lsraOverlap; +extern maplecl::Option remat; +extern maplecl::Option suppressFileinfo; +extern maplecl::Option dumpCfg; +extern maplecl::Option target; +extern maplecl::Option dumpPhases; +extern maplecl::Option skipPhases; +extern maplecl::Option skipFrom; +extern maplecl::Option skipAfter; +extern maplecl::Option dumpFunc; +extern maplecl::Option timePhases; +extern maplecl::Option useBarriersForVolatile; +extern maplecl::Option range; +extern maplecl::Option fastAlloc; +extern maplecl::Option spillRange; +extern maplecl::Option dupBb; +extern maplecl::Option calleeCfi; +extern maplecl::Option printFunc; +extern maplecl::Option cyclePatternList; +extern maplecl::Option duplicateAsmList; +extern maplecl::Option duplicateAsmList2; +extern maplecl::Option blockMarker; +extern maplecl::Option soeCheck; +extern maplecl::Option checkArraystore; +extern maplecl::Option debugSchedule; +extern maplecl::Option bruteforceSchedule; +extern maplecl::Option simulateSchedule; +extern maplecl::Option crossLoc; +extern maplecl::Option floatAbi; +extern maplecl::Option filetype; +extern maplecl::Option longCalls; +extern maplecl::Option functionSections; +extern maplecl::Option omitFramePointer; +extern maplecl::Option fastMath; +extern maplecl::Option tailcall; +extern maplecl::Option alignAnalysis; +extern maplecl::Option cgSsa; +extern maplecl::Option common; +extern maplecl::Option arm64Ilp32; +extern maplecl::Option condbrAlign; +extern maplecl::Option alignMinBbSize; +extern maplecl::Option alignMaxBbSize; +extern maplecl::Option loopAlignPow; +extern maplecl::Option jumpAlignPow; +extern maplecl::Option funcAlignPow; } diff --git a/src/mapleall/maple_be/src/cg/cg_options.cpp b/src/mapleall/maple_be/src/cg/cg_options.cpp index a596557f32cd4ee3b1fc27ecc44b903fbcd6ea45..a18336bc46a9f2557e47dc9af4c7610262738431 100644 --- a/src/mapleall/maple_be/src/cg/cg_options.cpp +++ b/src/mapleall/maple_be/src/cg/cg_options.cpp @@ -21,247 +21,247 @@ namespace opts::cg { -cl::Option pie({"--pie"}, +maplecl::Option pie({"--pie"}, " --pie \tGenerate position-independent executable\n" " --no-pie\n", {cgCategory}, - cl::DisableWith("--no-pie")); + maplecl::DisableWith("--no-pie")); -cl::Option fpic({"--fpic"}, +maplecl::Option fpic({"--fpic"}, " --fpic \tGenerate position-independent shared library\n" " --no-fpic\n", {cgCategory}, - cl::DisableWith("--no-fpic")); + maplecl::DisableWith("--no-fpic")); -cl::Option verboseAsm({"--verbose-asm"}, +maplecl::Option verboseAsm({"--verbose-asm"}, " --verbose-asm \tAdd comments to asm output\n" " --no-verbose-asm\n", {cgCategory}, - cl::DisableWith("--no-verbose-asm")); + maplecl::DisableWith("--no-verbose-asm")); -cl::Option verboseCg({"--verbose-cg"}, +maplecl::Option verboseCg({"--verbose-cg"}, " --verbose-cg \tAdd comments to cg output\n" " --no-verbose-cg\n", {cgCategory}, - cl::DisableWith("--no-verbose-cg")); + maplecl::DisableWith("--no-verbose-cg")); -cl::Option maplelinker({"--maplelinker"}, +maplecl::Option maplelinker({"--maplelinker"}, " --maplelinker \tGenerate the MapleLinker .s format\n" " --no-maplelinker\n", {cgCategory}, - cl::DisableWith("--no-maplelinker")); + maplecl::DisableWith("--no-maplelinker")); -cl::Option quiet({"--quiet"}, +maplecl::Option quiet({"--quiet"}, " --quiet \tBe quiet (don't output debug messages)\n" " --no-quiet\n", {cgCategory}, - cl::DisableWith("--no-quiet")); + maplecl::DisableWith("--no-quiet")); -cl::Option cg({"--cg"}, +maplecl::Option cg({"--cg"}, " --cg \tGenerate the output .s file\n" " --no-cg\n", {cgCategory}, - cl::DisableWith("--no-cg")); + maplecl::DisableWith("--no-cg")); -cl::Option replaceAsm({"--replaceasm"}, +maplecl::Option replaceAsm({"--replaceasm"}, " --replaceasm \tReplace the the assembly code\n" " --no-replaceasm\n", {cgCategory}, - cl::DisableWith("--no-replaceasm")); + maplecl::DisableWith("--no-replaceasm")); -cl::Option generalRegOnly({"--general-reg-only"}, +maplecl::Option generalRegOnly({"--general-reg-only"}, " --general-reg-only \tdisable floating-point or Advanced SIMD registers\n" " --no-general-reg-only\n", {cgCategory}, - cl::DisableWith("--no-general-reg-only")); + maplecl::DisableWith("--no-general-reg-only")); -cl::Option lazyBinding({"--lazy-binding"}, +maplecl::Option lazyBinding({"--lazy-binding"}, " --lazy-binding \tBind class symbols lazily[default off]\n", {cgCategory}, - cl::DisableWith("--no-lazy-binding")); + maplecl::DisableWith("--no-lazy-binding")); -cl::Option hotFix({"--hot-fix"}, +maplecl::Option hotFix({"--hot-fix"}, " --hot-fix \tOpen for App hot fix[default off]\n" " --no-hot-fix\n", {cgCategory}, - cl::DisableWith("--no-hot-fix")); + maplecl::DisableWith("--no-hot-fix")); -cl::Option ebo({"--ebo"}, +maplecl::Option ebo({"--ebo"}, " --ebo \tPerform Extend block optimization\n" " --no-ebo\n", {cgCategory}, - cl::DisableWith("--no-ebo")); + maplecl::DisableWith("--no-ebo")); -cl::Option cfgo({"--cfgo"}, +maplecl::Option cfgo({"--cfgo"}, " --cfgo \tPerform control flow optimization\n" " --no-cfgo\n", {cgCategory}, - cl::DisableWith("--no-cfgo")); + maplecl::DisableWith("--no-cfgo")); -cl::Option ico({"--ico"}, +maplecl::Option ico({"--ico"}, " --ico \tPerform if-conversion optimization\n" " --no-ico\n", {cgCategory}, - cl::DisableWith("--no-ico")); + maplecl::DisableWith("--no-ico")); -cl::Option storeloadopt({"--storeloadopt"}, +maplecl::Option storeloadopt({"--storeloadopt"}, " --storeloadopt \tPerform global store-load optimization\n" " --no-storeloadopt\n", {cgCategory}, - cl::DisableWith("--no-storeloadopt")); + maplecl::DisableWith("--no-storeloadopt")); -cl::Option globalopt({"--globalopt"}, +maplecl::Option globalopt({"--globalopt"}, " --globalopt \tPerform global optimization\n" " --no-globalopt\n", {cgCategory}, - cl::DisableWith("--no-globalopt")); + maplecl::DisableWith("--no-globalopt")); -cl::Option hotcoldsplit({"--hotcoldsplit"}, +maplecl::Option hotcoldsplit({"--hotcoldsplit"}, " --hotcoldsplit \tPerform HotColdSplit optimization\n" " --no-hotcoldsplit\n", {cgCategory}, - cl::DisableWith("--no-hotcoldsplit")); + maplecl::DisableWith("--no-hotcoldsplit")); -cl::Option prelsra({"--prelsra"}, +maplecl::Option prelsra({"--prelsra"}, " --prelsra \tPerform live interval simplification in LSRA\n" " --no-prelsra\n", {cgCategory}, - cl::DisableWith("--no-prelsra")); + maplecl::DisableWith("--no-prelsra")); -cl::Option lsraLvarspill({"--lsra-lvarspill"}, +maplecl::Option lsraLvarspill({"--lsra-lvarspill"}, " --lsra-lvarspill" " \tPerform LSRA spill using local ref var stack locations\n" " --no-lsra-lvarspill\n", {cgCategory}, - cl::DisableWith("--no-lsra-lvarspill")); + maplecl::DisableWith("--no-lsra-lvarspill")); -cl::Option lsraOptcallee({"--lsra-optcallee"}, +maplecl::Option lsraOptcallee({"--lsra-optcallee"}, " --lsra-optcallee \tSpill callee if only one def to use\n" " --no-lsra-optcallee\n", {cgCategory}, - cl::DisableWith("--no-lsra-optcallee")); + maplecl::DisableWith("--no-lsra-optcallee")); -cl::Option calleeregsPlacement({"--calleeregs-placement"}, +maplecl::Option calleeregsPlacement({"--calleeregs-placement"}, " --calleeregs-placement \tOptimize placement of callee-save registers\n" " --no-calleeregs-placement\n", {cgCategory}, - cl::DisableWith("--no-calleeregs-placement")); + maplecl::DisableWith("--no-calleeregs-placement")); -cl::Option ssapreSave({"--ssapre-save"}, +maplecl::Option ssapreSave({"--ssapre-save"}, " --ssapre-save \tUse ssapre algorithm to save callee-save registers\n" " --no-ssapre-save\n", {cgCategory}, - cl::DisableWith("--no-ssapre-save")); + maplecl::DisableWith("--no-ssapre-save")); -cl::Option ssupreRestore({"--ssupre-restore"}, +maplecl::Option ssupreRestore({"--ssupre-restore"}, " --ssupre-restore" " \tUse ssupre algorithm to restore callee-save registers\n" " --no-ssupre-restore\n", {cgCategory}, - cl::DisableWith("--no-ssupre-restore")); + maplecl::DisableWith("--no-ssupre-restore")); -cl::Option prepeep({"--prepeep"}, +maplecl::Option prepeep({"--prepeep"}, " --prepeep \tPerform peephole optimization before RA\n" " --no-prepeep\n", {cgCategory}, - cl::DisableWith("--no-prepeep")); + maplecl::DisableWith("--no-prepeep")); -cl::Option peep({"--peep"}, +maplecl::Option peep({"--peep"}, " --peep \tPerform peephole optimization after RA\n" " --no-peep\n", {cgCategory}, - cl::DisableWith("--no-peep")); + maplecl::DisableWith("--no-peep")); -cl::Option preschedule({"--preschedule"}, +maplecl::Option preschedule({"--preschedule"}, " --preschedule \tPerform prescheduling\n" " --no-preschedule\n", {cgCategory}, - cl::DisableWith("--no-preschedule")); + maplecl::DisableWith("--no-preschedule")); -cl::Option schedule({"--schedule"}, +maplecl::Option schedule({"--schedule"}, " --schedule \tPerform scheduling\n" " --no-schedule\n", {cgCategory}, - cl::DisableWith("--no-schedule")); + maplecl::DisableWith("--no-schedule")); -cl::Option retMerge({"--ret-merge"}, +maplecl::Option retMerge({"--ret-merge"}, " --ret-merge \tMerge return bb into a single destination\n" " --no-ret-merge \tallows for multiple return bb\n", {cgCategory}, - cl::DisableWith("--no-ret-merge")); + maplecl::DisableWith("--no-ret-merge")); -cl::Option vregRename({"--vreg-rename"}, +maplecl::Option vregRename({"--vreg-rename"}, " --vreg-rename" " \tPerform rename of long live range around loops in coloring RA\n" " --no-vreg-rename\n", {cgCategory}, - cl::DisableWith("--no-vreg-rename")); + maplecl::DisableWith("--no-vreg-rename")); -cl::Option fullcolor({"--fullcolor"}, +maplecl::Option fullcolor({"--fullcolor"}, " --fullcolor \tPerform multi-pass coloring RA\n" " --no-fullcolor\n", {cgCategory}, - cl::DisableWith("--no-fullcolor")); + maplecl::DisableWith("--no-fullcolor")); -cl::Option writefieldopt({"--writefieldopt"}, +maplecl::Option writefieldopt({"--writefieldopt"}, " --writefieldopt \tPerform WriteRefFieldOpt\n" " --no-writefieldopt\n", {cgCategory}, - cl::DisableWith("--no-writefieldopt")); + maplecl::DisableWith("--no-writefieldopt")); -cl::Option dumpOlog({"--dump-olog"}, +maplecl::Option dumpOlog({"--dump-olog"}, " --dump-olog \tDump CFGO and ICO debug information\n" " --no-dump-olog\n", {cgCategory}, - cl::DisableWith("--no-dump-olog")); + maplecl::DisableWith("--no-dump-olog")); -cl::Option nativeopt({"--nativeopt"}, +maplecl::Option nativeopt({"--nativeopt"}, " --nativeopt \tEnable native opt\n" " --no-nativeopt\n", {cgCategory}, - cl::DisableWith("--no-nativeopt")); + maplecl::DisableWith("--no-nativeopt")); -cl::Option objmap({"--objmap"}, +maplecl::Option objmap({"--objmap"}, " --objmap" " \tCreate object maps (GCTIBs) inside the main output (.s) file\n" " --no-objmap\n", {cgCategory}, - cl::DisableWith("--no-objmap")); + maplecl::DisableWith("--no-objmap")); -cl::Option yieldpoint({"--yieldpoint"}, +maplecl::Option yieldpoint({"--yieldpoint"}, " --yieldpoint \tGenerate yieldpoints [default]\n" " --no-yieldpoint\n", {cgCategory}, - cl::DisableWith("--no-yieldpoint")); + maplecl::DisableWith("--no-yieldpoint")); -cl::Option proepilogue({"--proepilogue"}, +maplecl::Option proepilogue({"--proepilogue"}, " --proepilogue \tDo tail call optimization and" " eliminate unnecessary prologue and epilogue.\n" " --no-proepilogue\n", {cgCategory}, - cl::DisableWith("--no-proepilogue")); + maplecl::DisableWith("--no-proepilogue")); -cl::Option localRc({"--local-rc"}, +maplecl::Option localRc({"--local-rc"}, " --local-rc \tHandle Local Stack RC [default]\n" " --no-local-rc\n", {cgCategory}, - cl::DisableWith("--no-local-rc")); + maplecl::DisableWith("--no-local-rc")); -cl::Option insertCall({"--insert-call"}, +maplecl::Option insertCall({"--insert-call"}, " --insert-call=name \tInsert a call to the named function\n", {cgCategory}); -cl::Option addDebugTrace({"--add-debug-trace"}, +maplecl::Option addDebugTrace({"--add-debug-trace"}, " --add-debug-trace" " \tInstrument the output .s file to print call traces at runtime\n", {cgCategory}); -cl::Option addFuncProfile({"--add-func-profile"}, +maplecl::Option addFuncProfile({"--add-func-profile"}, " --add-func-profile" " \tInstrument the output .s file to record func at runtime\n", {cgCategory}); -cl::Option classListFile({"--class-list-file"}, +maplecl::Option classListFile({"--class-list-file"}, " --class-list-file" " \tSet the class list file for the following generation options,\n" " \tif not given, " @@ -269,115 +269,115 @@ cl::Option classListFile({"--class-list-file"}, " \t--class-list-file=class_list_file\n", {cgCategory}); -cl::Option genCMacroDef({"--gen-c-macro-def"}, +maplecl::Option genCMacroDef({"--gen-c-macro-def"}, " --gen-c-macro-def" " \tGenerate a .def file that contains extra type metadata, including the\n" " \tclass instance sizes and field offsets (default)\n" " --no-gen-c-macro-def\n", {cgCategory}, - cl::DisableWith("--no-gen-c-macro-def")); + maplecl::DisableWith("--no-gen-c-macro-def")); -cl::Option genGctibFile({"--gen-gctib-file"}, +maplecl::Option genGctibFile({"--gen-gctib-file"}, " --gen-gctib-file" " \tGenerate a separate .s file for GCTIBs. Usually used together with\n" " \t--no-objmap (not implemented yet)\n" " --no-gen-gctib-file\n", {cgCategory}, - cl::DisableWith("--no-gen-gctib-file")); + maplecl::DisableWith("--no-gen-gctib-file")); -cl::Option stackProtectorStrong({"--stack-protector-strong"}, +maplecl::Option stackProtectorStrong({"--stack-protector-strong"}, " --stack-protector-strong \tadd stack guard for some function \n" " --no-stack-protector-strong \n", {cgCategory}, - cl::DisableWith("--no-stack-protector-strong")); + maplecl::DisableWith("--no-stack-protector-strong")); -cl::Option stackProtectorAll({"--stack-protector-all"}, +maplecl::Option stackProtectorAll({"--stack-protector-all"}, " --stack-protector-all \tadd stack guard for all functions \n" " --no-stack-protector-all\n", {cgCategory}, - cl::DisableWith("--no-stack-protector-all")); + maplecl::DisableWith("--no-stack-protector-all")); -cl::Option debug({"-g", "--g"}, +maplecl::Option debug({"-g", "--g"}, " -g \tGenerate debug information\n", {cgCategory}); -cl::Option gdwarf({"--gdwarf"}, +maplecl::Option gdwarf({"--gdwarf"}, " --gdwarf \tGenerate dwarf infomation\n", {cgCategory}); -cl::Option gsrc({"--gsrc"}, +maplecl::Option gsrc({"--gsrc"}, " --gsrc \tUse original source file instead of mpl file for debugging\n", {cgCategory}); -cl::Option gmixedsrc({"--gmixedsrc"}, +maplecl::Option gmixedsrc({"--gmixedsrc"}, " --gmixedsrc" " \tUse both original source file and mpl file for debugging\n", {cgCategory}); -cl::Option gmixedasm({"--gmixedasm"}, +maplecl::Option gmixedasm({"--gmixedasm"}, " --gmixedasm" " \tComment out both original source file and mpl file for debugging\n", {cgCategory}); -cl::Option profile({"--p", "-p"}, +maplecl::Option profile({"--p", "-p"}, " -p \tGenerate profiling infomation\n", {cgCategory}); -cl::Option withRaLinearScan({"--with-ra-linear-scan"}, +maplecl::Option withRaLinearScan({"--with-ra-linear-scan"}, " --with-ra-linear-scan \tDo linear-scan register allocation\n", {cgCategory}); -cl::Option withRaGraphColor({"--with-ra-graph-color"}, +maplecl::Option withRaGraphColor({"--with-ra-graph-color"}, " --with-ra-graph-color \tDo coloring-based register allocation\n", {cgCategory}); -cl::Option patchLongBranch({"--patch-long-branch"}, +maplecl::Option patchLongBranch({"--patch-long-branch"}, " --patch-long-branch" " \tEnable patching long distance branch with jumping pad\n", {cgCategory}); -cl::Option constFold({"--const-fold"}, +maplecl::Option constFold({"--const-fold"}, " --const-fold \tEnable constant folding\n" " --no-const-fold\n", {cgCategory}, - cl::DisableWith("--no-const-fold")); + maplecl::DisableWith("--no-const-fold")); -cl::Option ehExclusiveList({"--eh-exclusive-list"}, +maplecl::Option ehExclusiveList({"--eh-exclusive-list"}, " --eh-exclusive-list \tFor generating gold files in unit testing\n" " \t--eh-exclusive-list=list_file\n", {cgCategory}); -cl::Option o0({"-O0", "--O0"}, +maplecl::Option o0({"-O0", "--O0"}, " -O0 \tNo optimization.\n", {cgCategory}); -cl::Option o1({"-O1", "--O1"}, +maplecl::Option o1({"-O1", "--O1"}, " -O1 \tDo some optimization.\n", {cgCategory}); -cl::Option o2({"-O2", "--O2"}, +maplecl::Option o2({"-O2", "--O2"}, " -O2 \tDo some optimization.\n", {cgCategory}); -cl::Option os({"-Os", "--Os"}, +maplecl::Option os({"-Os", "--Os"}, " -Os \tOptimize for size, based on O2.\n", {cgCategory}); -cl::Option lsraBb({"--lsra-bb"}, +maplecl::Option lsraBb({"--lsra-bb"}, " --lsra-bb=NUM" " \tSwitch to spill mode if number of bb in function exceeds NUM\n", {cgCategory}); -cl::Option lsraInsn({"--lsra-insn"}, +maplecl::Option lsraInsn({"--lsra-insn"}, " --lsra-insn=NUM" " \tSwitch to spill mode if number of instructons in function exceeds NUM\n", {cgCategory}); -cl::Option lsraOverlap({"--lsra-overlap"}, +maplecl::Option lsraOverlap({"--lsra-overlap"}, " --lsra-overlap=NUM \toverlap NUM to decide pre spill in lsra\n", {cgCategory}); -cl::Option remat({"--remat"}, +maplecl::Option remat({"--remat"}, " --remat \tEnable rematerialization during register allocation\n" " \t 0: no rematerialization (default)\n" " \t >= 1: rematerialize constants\n" @@ -386,233 +386,233 @@ cl::Option remat({"--remat"}, " \t >= 4: rematerialize global dreads\n", {cgCategory}); -cl::Option suppressFileinfo({"--suppress-fileinfo"}, +maplecl::Option suppressFileinfo({"--suppress-fileinfo"}, " --suppress-fileinfo \tFor generating gold files in unit testing\n", {cgCategory}); -cl::Option dumpCfg({"--dump-cfg"}, +maplecl::Option dumpCfg({"--dump-cfg"}, " --dump-cfg\n", {cgCategory}); -cl::Option target({"--target"}, +maplecl::Option target({"--target"}, " --target=TARGETMACHINE \t generate code for TARGETMACHINE\n", {cgCategory}, - cl::optionalValue); + maplecl::optionalValue); -cl::Option dumpPhases({"--dump-phases"}, +maplecl::Option dumpPhases({"--dump-phases"}, " --dump-phases=PHASENAME,..." " \tEnable debug trace for specified phases in the comma separated list\n", {cgCategory}); -cl::Option skipPhases({"--skip-phases"}, +maplecl::Option skipPhases({"--skip-phases"}, " --skip-phases=PHASENAME,..." " \tSkip the phases specified in the comma separated list\n", {cgCategory}); -cl::Option skipFrom({"--skip-from"}, +maplecl::Option skipFrom({"--skip-from"}, " --skip-from=PHASENAME \tSkip the rest phases from PHASENAME(included)\n", {cgCategory}); -cl::Option skipAfter({"--skip-after"}, +maplecl::Option skipAfter({"--skip-after"}, " --skip-after=PHASENAME \tSkip the rest phases after PHASENAME(excluded)\n", {cgCategory}); -cl::Option dumpFunc({"--dump-func"}, +maplecl::Option dumpFunc({"--dump-func"}, " --dump-func=FUNCNAME" " \tDump/trace only for functions whose names contain FUNCNAME as substring\n" " \t(can only specify once)\n", {cgCategory}); -cl::Option timePhases({"--time-phases"}, +maplecl::Option timePhases({"--time-phases"}, " --time-phases \tCollect compilation time stats for each phase\n" " --no-time-phases \tDon't Collect compilation time stats for each phase\n", {cgCategory}, - cl::DisableWith("--no-time-phases")); + maplecl::DisableWith("--no-time-phases")); -cl::Option useBarriersForVolatile({"--use-barriers-for-volatile"}, +maplecl::Option useBarriersForVolatile({"--use-barriers-for-volatile"}, " --use-barriers-for-volatile \tOptimize volatile load/str\n" " --no-use-barriers-for-volatile\n", {cgCategory}, - cl::DisableWith("--no-use-barriers-for-volatile")); + maplecl::DisableWith("--no-use-barriers-for-volatile")); -cl::Option range({"--range"}, +maplecl::Option range({"--range"}, " --range=NUM0,NUM1 \tOptimize only functions in the range [NUM0, NUM1]\n", {cgCategory}); -cl::Option fastAlloc({"--fast-alloc"}, +maplecl::Option fastAlloc({"--fast-alloc"}, " --fast-alloc=[0/1] \tO2 RA fast mode, set to 1 to spill all registers\n", {cgCategory}); -cl::Option spillRange({"--spill_range"}, +maplecl::Option spillRange({"--spill_range"}, " --spill_range=NUM0,NUM1 \tO2 RA spill registers in the range [NUM0, NUM1]\n", {cgCategory}); -cl::Option dupBb({"--dup-bb"}, +maplecl::Option dupBb({"--dup-bb"}, " --dup-bb \tAllow cfg optimizer to duplicate bb\n" " --no-dup-bb \tDon't allow cfg optimizer to duplicate bb\n", {cgCategory}, - cl::DisableWith("--no-dup-bb")); + maplecl::DisableWith("--no-dup-bb")); -cl::Option calleeCfi({"--callee-cfi"}, +maplecl::Option calleeCfi({"--callee-cfi"}, " --callee-cfi \tcallee cfi message will be generated\n" " --no-callee-cfi \tcallee cfi message will not be generated\n", {cgCategory}, - cl::DisableWith("--no-callee-cfi")); + maplecl::DisableWith("--no-callee-cfi")); -cl::Option printFunc({"--print-func"}, +maplecl::Option printFunc({"--print-func"}, " --print-func\n" " --no-print-func\n", {cgCategory}, - cl::DisableWith("--no-print-func")); + maplecl::DisableWith("--no-print-func")); -cl::Option cyclePatternList({"--cycle-pattern-list"}, +maplecl::Option cyclePatternList({"--cycle-pattern-list"}, " --cycle-pattern-list \tFor generating cycle pattern meta\n" " \t--cycle-pattern-list=list_file\n", {cgCategory}); -cl::Option duplicateAsmList({"--duplicate_asm_list"}, +maplecl::Option duplicateAsmList({"--duplicate_asm_list"}, " --duplicate_asm_list \tDuplicate asm functions to delete plt call\n" " \t--duplicate_asm_list=list_file\n", {cgCategory}); -cl::Option duplicateAsmList2({"--duplicate_asm_list2"}, +maplecl::Option duplicateAsmList2({"--duplicate_asm_list2"}, " --duplicate_asm_list2" " \tDuplicate more asm functions to delete plt call\n" " \t--duplicate_asm_list2=list_file\n", {cgCategory}); -cl::Option blockMarker({"--block-marker"}, +maplecl::Option blockMarker({"--block-marker"}, " --block-marker" " \tEmit block marker symbols in emitted assembly files\n", {cgCategory}); -cl::Option soeCheck({"--soe-check"}, +maplecl::Option soeCheck({"--soe-check"}, " --soe-check \tInsert a soe check instruction[default off]\n", {cgCategory}); -cl::Option checkArraystore({"--check-arraystore"}, +maplecl::Option checkArraystore({"--check-arraystore"}, " --check-arraystore \tcheck arraystore exception[default off]\n" " --no-check-arraystore\n", {cgCategory}, - cl::DisableWith("--no-check-arraystore")); + maplecl::DisableWith("--no-check-arraystore")); -cl::Option debugSchedule({"--debug-schedule"}, +maplecl::Option debugSchedule({"--debug-schedule"}, " --debug-schedule \tdump scheduling information\n" " --no-debug-schedule\n", {cgCategory}, - cl::DisableWith("--no-debug-schedule")); + maplecl::DisableWith("--no-debug-schedule")); -cl::Option bruteforceSchedule({"--bruteforce-schedule"}, +maplecl::Option bruteforceSchedule({"--bruteforce-schedule"}, " --bruteforce-schedule \tdo brute force schedule\n" " --no-bruteforce-schedule\n", {cgCategory}, - cl::DisableWith("--no-bruteforce-schedule")); + maplecl::DisableWith("--no-bruteforce-schedule")); -cl::Option simulateSchedule({"--simulate-schedule"}, +maplecl::Option simulateSchedule({"--simulate-schedule"}, " --simulate-schedule \tdo simulate schedule\n" " --no-simulate-schedule\n", {cgCategory}, - cl::DisableWith("--no-simulate-schedule")); + maplecl::DisableWith("--no-simulate-schedule")); -cl::Option crossLoc({"--cross-loc"}, +maplecl::Option crossLoc({"--cross-loc"}, " --cross-loc \tcross loc insn schedule\n" " --no-cross-loc\n", {cgCategory}, - cl::DisableWith("--no-cross-loc")); + maplecl::DisableWith("--no-cross-loc")); -cl::Option floatAbi({"--float-abi"}, +maplecl::Option floatAbi({"--float-abi"}, " --float-abi=name \tPrint the abi type.\n" " \tname=hard: abi-hard (Default)\n" " \tname=soft: abi-soft\n" " \tname=softfp: abi-softfp\n", {cgCategory}); -cl::Option filetype({"--filetype"}, +maplecl::Option filetype({"--filetype"}, " --filetype=name \tChoose a file type.\n" " \tname=asm: Emit an assembly file (Default)\n" " \tname=obj: Emit an object file\n" " \tname=null: not support yet\n", {cgCategory}); -cl::Option longCalls({"--long-calls"}, +maplecl::Option longCalls({"--long-calls"}, " --long-calls \tgenerate long call\n" " --no-long-calls\n", {cgCategory}, - cl::DisableWith("--no-long-calls")); + maplecl::DisableWith("--no-long-calls")); -cl::Option functionSections({"--function-sections"}, +maplecl::Option functionSections({"--function-sections"}, " --function-sections \t \n" " --no-function-sections\n", {cgCategory}, - cl::DisableWith("--no-function-sections")); + maplecl::DisableWith("--no-function-sections")); -cl::Option omitFramePointer({"--omit-frame-pointer"}, +maplecl::Option omitFramePointer({"--omit-frame-pointer"}, " --omit-frame-pointer \t do not use frame pointer \n" " --no-omit-frame-pointer\n", {cgCategory}, - cl::DisableWith("--no-omit-frame-pointer")); + maplecl::DisableWith("--no-omit-frame-pointer")); -cl::Option fastMath({"--fast-math"}, +maplecl::Option fastMath({"--fast-math"}, " --fast-math \tPerform fast math\n" " --no-fast-math\n", {cgCategory}, - cl::DisableWith("--no-fast-math")); + maplecl::DisableWith("--no-fast-math")); -cl::Option tailcall({"--tailcall"}, +maplecl::Option tailcall({"--tailcall"}, " --tailcall \tDo tail call optimization\n" " --no-tailcall\n", {cgCategory}, - cl::DisableWith("--no-tailcall")); + maplecl::DisableWith("--no-tailcall")); -cl::Option alignAnalysis({"--align-analysis"}, +maplecl::Option alignAnalysis({"--align-analysis"}, " --align-analysis \tPerform alignanalysis\n" " --no-align-analysis\n", {cgCategory}, - cl::DisableWith("--no-align-analysis")); + maplecl::DisableWith("--no-align-analysis")); -cl::Option cgSsa({"--cg-ssa"}, +maplecl::Option cgSsa({"--cg-ssa"}, " --cg-ssa \tPerform cg ssa\n" " --no-cg-ssa\n", {cgCategory}, - cl::DisableWith("--no-cg-ssa")); + maplecl::DisableWith("--no-cg-ssa")); -cl::Option common({"--common"}, +maplecl::Option common({"--common"}, " --common \t \n" " --no-common\n", {cgCategory}, - cl::DisableWith("--no-common")); + maplecl::DisableWith("--no-common")); -cl::Option arm64Ilp32({"--arm64-ilp32"}, +maplecl::Option arm64Ilp32({"--arm64-ilp32"}, " --arm64-ilp32 \tarm64 with a 32-bit ABI instead of a 64bit ABI\n" " --no-arm64-ilp32\n", {cgCategory}, - cl::DisableWith("--no-arm64-ilp32")); + maplecl::DisableWith("--no-arm64-ilp32")); -cl::Option condbrAlign({"--condbr-align"}, +maplecl::Option condbrAlign({"--condbr-align"}, " --condbr-align \tPerform condbr align\n" " --no-condbr-align\n", {cgCategory}, - cl::DisableWith("--no-condbr-align")); + maplecl::DisableWith("--no-condbr-align")); -cl::Option alignMinBbSize({"--align-min-bb-size"}, +maplecl::Option alignMinBbSize({"--align-min-bb-size"}, " --align-min-bb-size=NUM" " \tO2 Minimum bb size for alignment unit:byte\n", {cgCategory}); -cl::Option alignMaxBbSize({"--align-max-bb-size"}, +maplecl::Option alignMaxBbSize({"--align-max-bb-size"}, " --align-max-bb-size=NUM" " \tO2 Maximum bb size for alignment unit:byte\n", {cgCategory}); -cl::Option loopAlignPow({"--loop-align-pow"}, +maplecl::Option loopAlignPow({"--loop-align-pow"}, " --loop-align-pow=NUM \tO2 loop bb align pow (NUM == 0, no loop-align)\n", {cgCategory}); -cl::Option jumpAlignPow({"--jump-align-pow"}, +maplecl::Option jumpAlignPow({"--jump-align-pow"}, " --jump-align-pow=NUM \tO2 jump bb align pow (NUM == 0, no jump-align)\n", {cgCategory}); -cl::Option funcAlignPow({"--func-align-pow"}, +maplecl::Option funcAlignPow({"--func-align-pow"}, " --func-align-pow=NUM \tO2 func bb align pow (NUM == 0, no func-align)\n", {cgCategory}); diff --git a/src/mapleall/maple_driver/include/driver_options.h b/src/mapleall/maple_driver/include/driver_options.h index fe9708677eb1c03df93fde41217f44c16abc9f7b..3f93def8012a87d6ac63115e4c00abd316874967 100644 --- a/src/mapleall/maple_driver/include/driver_options.h +++ b/src/mapleall/maple_driver/include/driver_options.h @@ -21,90 +21,90 @@ #include -static cl::OptionCategory &driverCategory = cl::CommandLine::GetCommandLine().defaultCategory; +static maplecl::OptionCategory &driverCategory = maplecl::CommandLine::GetCommandLine().defaultCategory; -static cl::OptionCategory &clangCategory = cl::CommandLine::GetCommandLine().clangCategory; -static cl::OptionCategory &hir2mplCategory = cl::CommandLine::GetCommandLine().hir2mplCategory; -static cl::OptionCategory &mpl2mplCategory = cl::CommandLine::GetCommandLine().mpl2mplCategory; -static cl::OptionCategory &meCategory = cl::CommandLine::GetCommandLine().meCategory; -static cl::OptionCategory &cgCategory = cl::CommandLine::GetCommandLine().cgCategory; -static cl::OptionCategory &asCategory = cl::CommandLine::GetCommandLine().asCategory; -static cl::OptionCategory &ldCategory = cl::CommandLine::GetCommandLine().ldCategory; +static maplecl::OptionCategory &clangCategory = maplecl::CommandLine::GetCommandLine().clangCategory; +static maplecl::OptionCategory &hir2mplCategory = maplecl::CommandLine::GetCommandLine().hir2mplCategory; +static maplecl::OptionCategory &mpl2mplCategory = maplecl::CommandLine::GetCommandLine().mpl2mplCategory; +static maplecl::OptionCategory &meCategory = maplecl::CommandLine::GetCommandLine().meCategory; +static maplecl::OptionCategory &cgCategory = maplecl::CommandLine::GetCommandLine().cgCategory; +static maplecl::OptionCategory &asCategory = maplecl::CommandLine::GetCommandLine().asCategory; +static maplecl::OptionCategory &ldCategory = maplecl::CommandLine::GetCommandLine().ldCategory; -static cl::OptionCategory &dex2mplCategory = cl::CommandLine::GetCommandLine().dex2mplCategory; -static cl::OptionCategory &jbc2mplCategory = cl::CommandLine::GetCommandLine().jbc2mplCategory; -static cl::OptionCategory &ipaCategory = cl::CommandLine::GetCommandLine().ipaCategory; +static maplecl::OptionCategory &dex2mplCategory = maplecl::CommandLine::GetCommandLine().dex2mplCategory; +static maplecl::OptionCategory &jbc2mplCategory = maplecl::CommandLine::GetCommandLine().jbc2mplCategory; +static maplecl::OptionCategory &ipaCategory = maplecl::CommandLine::GetCommandLine().ipaCategory; namespace opts { /* ##################### BOOL Options ############################################################### */ -extern cl::Option version; -extern cl::Option o0; -extern cl::Option o1; -extern cl::Option o2; -extern cl::Option os; -extern cl::Option verify; -extern cl::Option decoupleStatic; -extern cl::Option bigendian; -extern cl::Option gconly; -extern cl::Option timePhase; -extern cl::Option genMeMpl; -extern cl::Option compileWOLink; -extern cl::Option genVtable; -extern cl::Option verbose; -extern cl::Option debug; -extern cl::Option withDwarf; -extern cl::Option withIpa; -extern cl::Option npeNoCheck; -extern cl::Option npeStaticCheck; -extern cl::Option npeDynamicCheck; -extern cl::Option npeDynamicCheckSilent; -extern cl::Option npeDynamicCheckAll; -extern cl::Option boundaryNoCheck; -extern cl::Option boundaryStaticCheck; -extern cl::Option boundaryDynamicCheck; -extern cl::Option boundaryDynamicCheckSilent; -extern cl::Option safeRegionOption; -extern cl::Option printDriverPhases; -extern cl::Option ldStatic; -extern cl::Option maplePhase; -extern cl::Option genMapleBC; -extern cl::Option genLMBC; -extern cl::Option profileGen; -extern cl::Option profileUse; +extern maplecl::Option version; +extern maplecl::Option o0; +extern maplecl::Option o1; +extern maplecl::Option o2; +extern maplecl::Option os; +extern maplecl::Option verify; +extern maplecl::Option decoupleStatic; +extern maplecl::Option bigendian; +extern maplecl::Option gconly; +extern maplecl::Option timePhase; +extern maplecl::Option genMeMpl; +extern maplecl::Option compileWOLink; +extern maplecl::Option genVtable; +extern maplecl::Option verbose; +extern maplecl::Option debug; +extern maplecl::Option withDwarf; +extern maplecl::Option withIpa; +extern maplecl::Option npeNoCheck; +extern maplecl::Option npeStaticCheck; +extern maplecl::Option npeDynamicCheck; +extern maplecl::Option npeDynamicCheckSilent; +extern maplecl::Option npeDynamicCheckAll; +extern maplecl::Option boundaryNoCheck; +extern maplecl::Option boundaryStaticCheck; +extern maplecl::Option boundaryDynamicCheck; +extern maplecl::Option boundaryDynamicCheckSilent; +extern maplecl::Option safeRegionOption; +extern maplecl::Option printDriverPhases; +extern maplecl::Option ldStatic; +extern maplecl::Option maplePhase; +extern maplecl::Option genMapleBC; +extern maplecl::Option genLMBC; +extern maplecl::Option profileGen; +extern maplecl::Option profileUse; /* ##################### STRING Options ############################################################### */ -extern cl::Option help; -extern cl::Option infile; -extern cl::Option mplt; -extern cl::Option partO2; -extern cl::List jbc2mplOpt; -extern cl::List hir2mplOpt; -extern cl::List clangOpt; -extern cl::List asOpt; -extern cl::List ldOpt; -extern cl::List dex2mplOpt; -extern cl::List mplipaOpt; -extern cl::List mplcgOpt; -extern cl::List meOpt; -extern cl::List mpl2mplOpt; -extern cl::Option profile; -extern cl::Option run; -extern cl::Option optionOpt; -extern cl::List ldLib; -extern cl::List ldLibPath; -extern cl::List enableMacro; -extern cl::List disableMacro; -extern cl::List includeDir; -extern cl::List includeSystem; -extern cl::Option output; -extern cl::Option saveTempOpt; +extern maplecl::Option help; +extern maplecl::Option infile; +extern maplecl::Option mplt; +extern maplecl::Option partO2; +extern maplecl::List jbc2mplOpt; +extern maplecl::List hir2mplOpt; +extern maplecl::List clangOpt; +extern maplecl::List asOpt; +extern maplecl::List ldOpt; +extern maplecl::List dex2mplOpt; +extern maplecl::List mplipaOpt; +extern maplecl::List mplcgOpt; +extern maplecl::List meOpt; +extern maplecl::List mpl2mplOpt; +extern maplecl::Option profile; +extern maplecl::Option run; +extern maplecl::Option optionOpt; +extern maplecl::List ldLib; +extern maplecl::List ldLibPath; +extern maplecl::List enableMacro; +extern maplecl::List disableMacro; +extern maplecl::List includeDir; +extern maplecl::List includeSystem; +extern maplecl::Option output; +extern maplecl::Option saveTempOpt; /* ##################### DIGITAL Options ############################################################### */ -extern cl::Option helpLevel; +extern maplecl::Option helpLevel; /* #################################################################################################### */ diff --git a/src/mapleall/maple_driver/include/mpl_options.h b/src/mapleall/maple_driver/include/mpl_options.h index 63b46e6c6f4476553a8c214925e4713acb0625b2..908e3f944dde2076557ae98f991dd28685cbd483 100644 --- a/src/mapleall/maple_driver/include/mpl_options.h +++ b/src/mapleall/maple_driver/include/mpl_options.h @@ -347,7 +347,7 @@ class MplOptions { return rootActions; } - cl::OptionCategory *GetCategory(const std::string &tool) const; + maplecl::OptionCategory *GetCategory(const std::string &tool) const; ErrorCode AppendCombOptions(MIRSrcLang srcLang); ErrorCode AppendMplcgOptions(MIRSrcLang srcLang); std::string GetInputFileNameForPrint(const Action * const action) const; diff --git a/src/mapleall/maple_driver/src/compiler.cpp b/src/mapleall/maple_driver/src/compiler.cpp index 6fb8de24e1ec8204d1ee83b054ef31b1ff15d944..72a34ec13462af7cbf49e548da1c3e04c42f2741 100644 --- a/src/mapleall/maple_driver/src/compiler.cpp +++ b/src/mapleall/maple_driver/src/compiler.cpp @@ -110,7 +110,7 @@ void Compiler::AppendExtraOptions(std::vector &finalOptions, const Mp } } - cl::OptionCategory *category = options.GetCategory(binName); + maplecl::OptionCategory *category = options.GetCategory(binName); ASSERT(category != nullptr, "Undefined tool: %s", binName.data()); /* Append options setting directly for special category. Example: --verbose */ diff --git a/src/mapleall/maple_driver/src/driver_options.cpp b/src/mapleall/maple_driver/src/driver_options.cpp index b51a133f81ed9b3751a281312d3a23ce6715c736..93469d3e8c34702c873851d0dba9077cdd79f202 100644 --- a/src/mapleall/maple_driver/src/driver_options.cpp +++ b/src/mapleall/maple_driver/src/driver_options.cpp @@ -23,224 +23,224 @@ namespace opts { /* ##################### BOOL Options ############################################################### */ -cl::Option version({"--version", "-v"}, +maplecl::Option version({"--version", "-v"}, " --version [command] \tPrint version and exit.\n", {driverCategory}); -cl::Option o0({"--O0", "-O0"}, +maplecl::Option o0({"--O0", "-O0"}, " -O0 \tNo optimization.\n", {driverCategory}); -cl::Option o1({"--O1", "-O1"}, +maplecl::Option o1({"--O1", "-O1"}, " -O1 \tDo some optimization.\n", {driverCategory}); -cl::Option o2({"--O2", "-O2"}, +maplecl::Option o2({"--O2", "-O2"}, " -O2 \tDo more optimization. (Default)\n", {driverCategory}); -cl::Option os({"--Os", "-Os"}, +maplecl::Option os({"--Os", "-Os"}, " -Os \tOptimize for size, based on O2.\n", {driverCategory, hir2mplCategory}); -cl::Option verify({"--verify"}, +maplecl::Option verify({"--verify"}, " --verify \tVerify mpl file\n", {driverCategory, dex2mplCategory, mpl2mplCategory}); -cl::Option decoupleStatic({"--decouple-static", "-decouple-static"}, +maplecl::Option decoupleStatic({"--decouple-static", "-decouple-static"}, " --decouple-static \tDecouple the static method and field\n" " --no-decouple-static \tDon't decouple the static method and field\n", {driverCategory, dex2mplCategory, meCategory, mpl2mplCategory}, - cl::DisableWith("--no-decouple-static")); + maplecl::DisableWith("--no-decouple-static")); -cl::Option bigendian({"-Be", "--BigEndian"}, +maplecl::Option bigendian({"-Be", "--BigEndian"}, " --BigEndian/-Be \tUsing BigEndian\n" " --no-BigEndian \tUsing LittleEndian\n", {driverCategory, meCategory, mpl2mplCategory, cgCategory}, - cl::DisableWith("--no-BigEndian")); + maplecl::DisableWith("--no-BigEndian")); -cl::Option gconly({"--gconly", "-gconly"}, +maplecl::Option gconly({"--gconly", "-gconly"}, " --gconly \tMake gconly is enable\n" " --no-gconly \tDon't make gconly is enable\n", {driverCategory, dex2mplCategory, meCategory, mpl2mplCategory, cgCategory}, - cl::DisableWith("--no-gconly")); + maplecl::DisableWith("--no-gconly")); -cl::Option timePhase({"-time-phases"}, +maplecl::Option timePhase({"-time-phases"}, " -time-phases \tTiming phases and print percentages\n", {driverCategory}); -cl::Option genMeMpl({"--genmempl"}, +maplecl::Option genMeMpl({"--genmempl"}, " --genmempl \tGenerate me.mpl file\n", {driverCategory}); -cl::Option compileWOLink({"-c"}, +maplecl::Option compileWOLink({"-c"}, " -c \tCompile the source files without linking\n", {driverCategory}); -cl::Option genVtable({"--genVtableImpl"}, +maplecl::Option genVtable({"--genVtableImpl"}, " --genVtableImpl \tGenerate VtableImpl.mpl file\n", {driverCategory}); -cl::Option verbose({"-verbose"}, +maplecl::Option verbose({"-verbose"}, " -verbose \tPrint informations\n", {driverCategory, jbc2mplCategory, hir2mplCategory, meCategory, mpl2mplCategory, cgCategory}); -cl::Option debug({"--debug"}, +maplecl::Option debug({"--debug"}, " --debug \tPrint debug info.\n", {driverCategory}); -cl::Option withDwarf({"-g"}, +maplecl::Option withDwarf({"-g"}, " --debug \tPrint debug info.\n", {driverCategory}); -cl::Option withIpa({"--with-ipa"}, +maplecl::Option withIpa({"--with-ipa"}, " --with-ipa \tRun IPA when building\n" " --no-with-ipa \n", {driverCategory}, - cl::DisableWith("--no-with-ipa")); + maplecl::DisableWith("--no-with-ipa")); -cl::Option npeNoCheck({"--no-npe-check"}, +maplecl::Option npeNoCheck({"--no-npe-check"}, " --no-npe-check \tDisable null pointer check (Default)\n", {driverCategory}); -cl::Option npeStaticCheck({"--npe-check-static"}, +maplecl::Option npeStaticCheck({"--npe-check-static"}, " --npe-check-static \tEnable null pointer static check only\n", {driverCategory}); -cl::Option npeDynamicCheck({"--npe-check-dynamic"}, +maplecl::Option npeDynamicCheck({"--npe-check-dynamic"}, " --npe-check-dynamic \tEnable null " "pointer dynamic check with static warning\n", {driverCategory}); -cl::Option npeDynamicCheckSilent({"--npe-check-dynamic-silent"}, +maplecl::Option npeDynamicCheckSilent({"--npe-check-dynamic-silent"}, " --npe-check-dynamic-silent \tEnable null pointer dynamic " "without static warning\n", {driverCategory}); -cl::Option npeDynamicCheckAll({"--npe-check-dynamic-all"}, +maplecl::Option npeDynamicCheckAll({"--npe-check-dynamic-all"}, " --npe-check-dynamic-all \tKeep dynamic check before dereference, " "used with --npe-check-dynamic* options\n", {driverCategory}); -cl::Option boundaryNoCheck({"--no-boundary-check"}, +maplecl::Option boundaryNoCheck({"--no-boundary-check"}, " --no-boundary-check \tDisable boundary check (Default)\n", {driverCategory}); -cl::Option boundaryStaticCheck({"--boundary-check-static"}, +maplecl::Option boundaryStaticCheck({"--boundary-check-static"}, " --boundary-check-static \tEnable boundary static check\n", {driverCategory}); -cl::Option boundaryDynamicCheck({"--boundary-check-dynamic"}, +maplecl::Option boundaryDynamicCheck({"--boundary-check-dynamic"}, " --boundary-check-dynamic \tEnable boundary dynamic check " "with static warning\n", {driverCategory}); -cl::Option boundaryDynamicCheckSilent({"--boundary-check-dynamic-silent"}, +maplecl::Option boundaryDynamicCheckSilent({"--boundary-check-dynamic-silent"}, " --boundary-check-dynamic-silent \tEnable boundary dynamic " "check without static warning\n", {driverCategory}); -cl::Option safeRegionOption({"--safe-region"}, +maplecl::Option safeRegionOption({"--safe-region"}, " --safe-region \tEnable safe region\n", {driverCategory}); -cl::Option printDriverPhases({"--print-driver-phases"}, +maplecl::Option printDriverPhases({"--print-driver-phases"}, " --print-driver-phases \tPrint Driver Phases\n", {driverCategory}); -cl::Option ldStatic({"-static", "--static"}, +maplecl::Option ldStatic({"-static", "--static"}, " -static \tForce the linker to link a program statically\n", {driverCategory, ldCategory}); -cl::Option maplePhase({"--maple-phase"}, +maplecl::Option maplePhase({"--maple-phase"}, " --maple-phase \tRun maple phase only\n --no-maple-phase\n", {driverCategory}, - cl::DisableWith("--no-maple-phase"), - cl::Init(true)); + maplecl::DisableWith("--no-maple-phase"), + maplecl::Init(true)); -cl::Option genMapleBC({"--genmaplebc"}, +maplecl::Option genMapleBC({"--genmaplebc"}, " --genmaplebc \tGenerate .mbc file\n", {driverCategory}); -cl::Option genLMBC({"--genlmbc"}, +maplecl::Option genLMBC({"--genlmbc"}, " --genlmbc \tGenerate .lmbc file\n", {driverCategory, mpl2mplCategory}); -cl::Option profileGen({"--profileGen"}, +maplecl::Option profileGen({"--profileGen"}, " --profileGen \tGenerate profile data for static languages\n", {driverCategory, meCategory, mpl2mplCategory, cgCategory}); -cl::Option profileUse({"--profileUse"}, +maplecl::Option profileUse({"--profileUse"}, " --profileUse \tOptimize static languages with profile data\n", {driverCategory, mpl2mplCategory}); /* ##################### STRING Options ############################################################### */ -cl::Option help({"--help", "-h"}, +maplecl::Option help({"--help", "-h"}, " --help \tPrint help\n", {driverCategory}, - cl::optionalValue); + maplecl::optionalValue); -cl::Option infile({"--infile"}, +maplecl::Option infile({"--infile"}, " --infile file1,file2,file3 \tInput files.\n", {driverCategory}); -cl::Option mplt({"--mplt", "-mplt"}, +maplecl::Option mplt({"--mplt", "-mplt"}, " --mplt=file1,file2,file3 \tImport mplt files.\n", {driverCategory, dex2mplCategory, jbc2mplCategory}); -cl::Option partO2({"--partO2"}, +maplecl::Option partO2({"--partO2"}, " --partO2 \tSet func list for O2\n", {driverCategory}); -cl::List jbc2mplOpt({"--jbc2mpl-opt"}, +maplecl::List jbc2mplOpt({"--jbc2mpl-opt"}, " --jbc2mpl-opt \tSet options for jbc2mpl\n", {driverCategory}); -cl::List hir2mplOpt({"--hir2mpl-opt"}, +maplecl::List hir2mplOpt({"--hir2mpl-opt"}, " --hir2mpl-opt \tSet options for hir2mpl\n", {driverCategory}); -cl::List clangOpt({"--clang-opt"}, +maplecl::List clangOpt({"--clang-opt"}, " --clang-opt \tSet options for clang as AST generator\n", {driverCategory}); -cl::List asOpt({"--as-opt"}, +maplecl::List asOpt({"--as-opt"}, " --as-opt \tSet options for as\n", {driverCategory}); -cl::List ldOpt({"--ld-opt"}, +maplecl::List ldOpt({"--ld-opt"}, " --ld-opt \tSet options for ld\n", {driverCategory}); -cl::List dex2mplOpt({"--dex2mpl-opt"}, +maplecl::List dex2mplOpt({"--dex2mpl-opt"}, " --dex2mpl-opt \tSet options for dex2mpl\n", {driverCategory}); -cl::List mplipaOpt({"--mplipa-opt"}, +maplecl::List mplipaOpt({"--mplipa-opt"}, " --mplipa-opt \tSet options for mplipa\n", {driverCategory}); -cl::List mplcgOpt({"--mplcg-opt"}, +maplecl::List mplcgOpt({"--mplcg-opt"}, " --mplcg-opt \tSet options for mplcg\n", {driverCategory}); -cl::List meOpt({"--me-opt"}, +maplecl::List meOpt({"--me-opt"}, " --me-opt \tSet options for me\n", {driverCategory}); -cl::List mpl2mplOpt({"--mpl2mpl-opt"}, +maplecl::List mpl2mplOpt({"--mpl2mpl-opt"}, " --mpl2mpl-opt \tSet options for mpl2mpl\n", {driverCategory}); -cl::Option profile({"--profile"}, +maplecl::Option profile({"--profile"}, " --profile \tFor PGO optimization\n" " \t--profile=list_file\n", {driverCategory, dex2mplCategory, mpl2mplCategory, cgCategory}); -cl::Option run({"--run"}, +maplecl::Option run({"--run"}, " --run=cmd1:cmd2 \tThe name of executables that are going\n" " \tto execute. IN SEQUENCE.\n" " \tSeparated by \":\".Available exe names:\n" @@ -249,60 +249,60 @@ cl::Option run({"--run"}, " \thandle\n", {driverCategory}); -cl::Option optionOpt({"--option"}, +maplecl::Option optionOpt({"--option"}, " --option=\"opt1:opt2\" \tOptions for each executable,\n" " \tseparated by \":\".\n" " \tThe sequence must match the sequence in\n" " \t--run.\n", {driverCategory}); -cl::List ldLib({"-l"}, +maplecl::List ldLib({"-l"}, " -l \tLinks with a library file\n", {driverCategory, ldCategory}, - cl::joinedValue); + maplecl::joinedValue); -cl::List ldLibPath({"-L"}, +maplecl::List ldLibPath({"-L"}, " -L \tAdd directory to library search path\n", {driverCategory, ldCategory}, - cl::joinedValue); + maplecl::joinedValue); -cl::List enableMacro({"-D"}, +maplecl::List enableMacro({"-D"}, " -D = \tDefine to " "(or 1 if omitted)\n", {driverCategory, clangCategory}, - cl::joinedValue); + maplecl::joinedValue); -cl::List disableMacro({"-U"}, +maplecl::List disableMacro({"-U"}, " -U \tUndefine macro \n", {driverCategory, clangCategory}, - cl::joinedValue); + maplecl::joinedValue); -cl::List includeDir({"-I"}, +maplecl::List includeDir({"-I"}, " -I \tAdd directory to include search path\n", {driverCategory, clangCategory}, - cl::joinedValue); + maplecl::joinedValue); -cl::List includeSystem({"--isystem"}, +maplecl::List includeSystem({"--isystem"}, " -isystem \tAdd directory to SYSTEM include search path\n", {driverCategory, clangCategory}, - cl::joinedValue); + maplecl::joinedValue); -cl::Option output({"-o"}, +maplecl::Option output({"-o"}, " -o \tPlace the output into \n", {driverCategory}, - cl::Init("a.out")); + maplecl::Init("a.out")); -cl::Option saveTempOpt({"--save-temps"}, +maplecl::Option saveTempOpt({"--save-temps"}, " --save-temps \tDo not delete intermediate files.\n" " \t--save-temps Save all intermediate files.\n" " \t--save-temps=file1,file2,file3 Save the\n" " \ttarget files.\n", {driverCategory}, - cl::optionalValue); + maplecl::optionalValue); /* ##################### DIGITAL Options ############################################################### */ -cl::Option helpLevel({"--level"}, +maplecl::Option helpLevel({"--level"}, " --level=NUM \tPrint the help info of specified level.\n" " \tNUM=0: All options (Default)\n" " \tNUM=1: Product options\n" diff --git a/src/mapleall/maple_driver/src/maple_comb_compiler.cpp b/src/mapleall/maple_driver/src/maple_comb_compiler.cpp index 28b648800b3e7f285691ce6c3f683e889e961855..fef619cfd793f7570d4b634c9566b3a324ccdd6f 100644 --- a/src/mapleall/maple_driver/src/maple_comb_compiler.cpp +++ b/src/mapleall/maple_driver/src/maple_comb_compiler.cpp @@ -145,7 +145,7 @@ ErrorCode MapleCombCompiler::MakeMeOptions(const MplOptions &options, DriverRunn if (itOpt != options.GetExeOptions().end()) { const auto &meExeOpts = itOpt->second; const std::deque strMeOptions(meExeOpts.begin(), meExeOpts.end()); - cl::CommandLine::GetCommandLine().HandleInputArgs(strMeOptions, meCategory); + maplecl::CommandLine::GetCommandLine().HandleInputArgs(strMeOptions, meCategory); } bool result = MeOption::GetInstance().SolveOptions(opts::debug); @@ -182,7 +182,7 @@ ErrorCode MapleCombCompiler::MakeMpl2MplOptions(const MplOptions &options, Drive if (itOpt != options.GetExeOptions().end()) { const auto &mpl2mplExeOpts = itOpt->second; const std::deque strMpl2mplOptions(mpl2mplExeOpts.begin(), mpl2mplExeOpts.end()); - cl::CommandLine::GetCommandLine().HandleInputArgs(strMpl2mplOptions, mpl2mplCategory); + maplecl::CommandLine::GetCommandLine().HandleInputArgs(strMpl2mplOptions, mpl2mplCategory); } auto &mpl2mplOption = Options::GetInstance(); diff --git a/src/mapleall/maple_driver/src/mpl_options.cpp b/src/mapleall/maple_driver/src/mpl_options.cpp index 014b436df5830fad956a843f0cf16906160b91ea..85d032b128e576dd966eccdb23d265ad5dca91f1 100644 --- a/src/mapleall/maple_driver/src/mpl_options.cpp +++ b/src/mapleall/maple_driver/src/mpl_options.cpp @@ -34,7 +34,7 @@ namespace maple { using namespace maplebe; /* tool -> OptionCategory map: ld -> ldCategory, me -> meCategory and etc... */ -static std::unordered_map exeCategories = +static std::unordered_map exeCategories = { {"maple", &driverCategory}, {maple::kBinNameClang, &clangCategory}, @@ -61,7 +61,7 @@ const std::vector kMapleCompilers = { "jbc2mpl", "hir2mpl", "me", "mpl2mpl", "mplcg", "clang"}; ErrorCode MplOptions::Parse(int argc, char **argv) { - cl::CommandLine::GetCommandLine().Parse(argc, argv); + maplecl::CommandLine::GetCommandLine().Parse(argc, argv); exeFolder = FileUtils::GetFileFolder(FileUtils::GetExecutable()); // We should recognize O0, O2 and run options firstly to decide the real options @@ -169,7 +169,7 @@ ErrorCode MplOptions::HandleEarlyOptions() { if (opts::help.IsEnabledByUser()) { if (auto it = exeCategories.find(opts::help.GetValue()); it != exeCategories.end()) { - cl::CommandLine::GetCommandLine().HelpPrinter(*it->second); + maplecl::CommandLine::GetCommandLine().HelpPrinter(*it->second); } else { maple::LogInfo::MapleLogger() << "USAGE: maple [options]\n\n" " Example 1: /maple --run=me:mpl2mpl:mplcg " @@ -178,7 +178,7 @@ ErrorCode MplOptions::HandleEarlyOptions() { " Example 2: /maple -O2 --mplt=mpltPath inputFile.dex\n\n" "==============================\n" " Options:\n"; - cl::CommandLine::GetCommandLine().HelpPrinter(); + maplecl::CommandLine::GetCommandLine().HelpPrinter(); } return kErrorExitHelp; } @@ -516,7 +516,7 @@ void MplOptions::DumpActionTree(const Action &action, int indents) const { std::string MplOptions::GetCommonOptionsStr() const { std::string driverOptions; - static const std::vector extraExclude = { &opts::run, + static const std::vector extraExclude = { &opts::run, &opts::optionOpt, &opts::infile, &opts::mpl2mplOpt, @@ -549,7 +549,7 @@ InputInfo *MplOptions::AllocateInputInfo(const std::string &inputFile) { } ErrorCode MplOptions::CheckInputFiles() { - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; /* Set input files with --infile="file1 file2" option */ if (opts::infile.IsEnabledByUser()) { @@ -764,7 +764,7 @@ ErrorCode MplOptions::UpdateExeOptions(const std::string &args) { return kErrorNoError; } -cl::OptionCategory *MplOptions::GetCategory(const std::string &tool) const { +maplecl::OptionCategory *MplOptions::GetCategory(const std::string &tool) const { auto it = exeCategories.find(tool); if (it == exeCategories.end()) { return nullptr; diff --git a/src/mapleall/maple_driver/src/mplcg_compiler.cpp b/src/mapleall/maple_driver/src/mplcg_compiler.cpp index 4b8ad7db362118cdfc37489c7027e769b6d2299a..ab451100fd84587fa6898a88046d33d1fd1a0194 100644 --- a/src/mapleall/maple_driver/src/mplcg_compiler.cpp +++ b/src/mapleall/maple_driver/src/mplcg_compiler.cpp @@ -127,7 +127,7 @@ ErrorCode MplcgCompiler::MakeCGOptions(const MplOptions &options) { if (itOpt != options.GetExeOptions().end()) { const auto &cgExeOpts = itOpt->second; const std::deque strCgOptions(cgExeOpts.begin(), cgExeOpts.end()); - cl::CommandLine::GetCommandLine().HandleInputArgs(strCgOptions, cgCategory); + maplecl::CommandLine::GetCommandLine().HandleInputArgs(strCgOptions, cgCategory); } bool result = cgOption.SolveOptions(opts::debug); diff --git a/src/mapleall/maple_ipa/src/old/ipa_option.cpp b/src/mapleall/maple_ipa/src/old/ipa_option.cpp index 72aa4b78fabe76f971cc4e4c548e43e1ff1aef18..6ff632328196e8ce9e191fd7904db75e37215842 100644 --- a/src/mapleall/maple_ipa/src/old/ipa_option.cpp +++ b/src/mapleall/maple_ipa/src/old/ipa_option.cpp @@ -20,27 +20,27 @@ namespace maple { namespace opts::ipa { - cl::Option help({"--help", "-h"}, + maplecl::Option help({"--help", "-h"}, " -h --help \tPrint usage and exit.Available command names:\n", {ipaCategory}); - cl::Option o1({"--O1", "-O1"}, + maplecl::Option o1({"--O1", "-O1"}, " --O1 \tEnable basic inlining\n", {ipaCategory}); - cl::Option o2({"--O2", "-O2"}, + maplecl::Option o2({"--O2", "-O2"}, " --O2 \tEnable greedy inlining\n", {ipaCategory}); - cl::Option effectipa({"--effectipa", "-effectipa"}, + maplecl::Option effectipa({"--effectipa", "-effectipa"}, " --effectipa \tEnable method side effect for ipa\n", {ipaCategory}); - cl::Option inlinefunclist({"--inlinefunclist", "-inlinefunclist"}, + maplecl::Option inlinefunclist({"--inlinefunclist", "-inlinefunclist"}, " --inlinefunclist= \tInlining related configuration\n", {ipaCategory}); - cl::Option quiet({"--quiet", "-quiet"}, + maplecl::Option quiet({"--quiet", "-quiet"}, " --quiet \tDisable out debug info\n", {ipaCategory}); } @@ -52,7 +52,7 @@ IpaOption &IpaOption::GetInstance() { bool IpaOption::SolveOptions() const { if (opts::ipa::help.IsEnabledByUser()) { - cl::CommandLine::GetCommandLine().HelpPrinter(ipaCategory); + maplecl::CommandLine::GetCommandLine().HelpPrinter(ipaCategory); return false; } @@ -61,7 +61,7 @@ bool IpaOption::SolveOptions() const { Options::quiet = true; } - cl::CopyIfEnabled(MeOption::inlineFuncList, opts::ipa::inlinefunclist); + maplecl::CopyIfEnabled(MeOption::inlineFuncList, opts::ipa::inlinefunclist); return true; } @@ -70,13 +70,13 @@ bool IpaOption::ParseCmdline(int argc, char **argv, std::vector &fi // Default value MeOption::inlineFuncList = ""; - cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, ipaCategory); + maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, ipaCategory); bool result = SolveOptions(); if (!result) { return false; } - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; for (auto &arg : badArgs) { if (FileUtils::IsFileExists(arg.first)) { fileNames.push_back(arg.first); diff --git a/src/mapleall/maple_ir/include/mpl2mpl_options.h b/src/mapleall/maple_ir/include/mpl2mpl_options.h index aa9b63fbf061549f8478258f58e8598e48a496ef..4ad15946852161398b0adf67e0ae27053dc61de1 100644 --- a/src/mapleall/maple_ir/include/mpl2mpl_options.h +++ b/src/mapleall/maple_ir/include/mpl2mpl_options.h @@ -25,89 +25,89 @@ namespace opts::mpl2mpl { -extern cl::Option dumpPhase; -extern cl::Option skipPhase; -extern cl::Option skipFrom; -extern cl::Option skipAfter; -extern cl::Option dumpFunc; -extern cl::Option quiet; -extern cl::Option maplelinker; -extern cl::Option regnativefunc; -extern cl::Option inlineWithProfile; -extern cl::Option inlineOpt; -extern cl::Option ipaClone; -extern cl::Option noInlineFunc; -extern cl::Option importFileList; -extern cl::Option crossModuleInline; -extern cl::Option inlineSmallFunctionThreshold; -extern cl::Option inlineHotFunctionThreshold; -extern cl::Option inlineRecursiveFunctionThreshold; -extern cl::Option inlineDepth; -extern cl::Option inlineModuleGrow; -extern cl::Option inlineColdFuncThresh; -extern cl::Option profileHotCount; -extern cl::Option profileColdCount; -extern cl::Option profileHotRate; -extern cl::Option profileColdRate; -extern cl::Option nativewrapper; -extern cl::Option regnativeDynamicOnly; -extern cl::Option staticBindingList; -extern cl::Option dumpBefore; -extern cl::Option dumpAfter; -extern cl::Option dumpMuid; -extern cl::Option emitVtableImpl; +extern maplecl::Option dumpPhase; +extern maplecl::Option skipPhase; +extern maplecl::Option skipFrom; +extern maplecl::Option skipAfter; +extern maplecl::Option dumpFunc; +extern maplecl::Option quiet; +extern maplecl::Option maplelinker; +extern maplecl::Option regnativefunc; +extern maplecl::Option inlineWithProfile; +extern maplecl::Option inlineOpt; +extern maplecl::Option ipaClone; +extern maplecl::Option noInlineFunc; +extern maplecl::Option importFileList; +extern maplecl::Option crossModuleInline; +extern maplecl::Option inlineSmallFunctionThreshold; +extern maplecl::Option inlineHotFunctionThreshold; +extern maplecl::Option inlineRecursiveFunctionThreshold; +extern maplecl::Option inlineDepth; +extern maplecl::Option inlineModuleGrow; +extern maplecl::Option inlineColdFuncThresh; +extern maplecl::Option profileHotCount; +extern maplecl::Option profileColdCount; +extern maplecl::Option profileHotRate; +extern maplecl::Option profileColdRate; +extern maplecl::Option nativewrapper; +extern maplecl::Option regnativeDynamicOnly; +extern maplecl::Option staticBindingList; +extern maplecl::Option dumpBefore; +extern maplecl::Option dumpAfter; +extern maplecl::Option dumpMuid; +extern maplecl::Option emitVtableImpl; #if MIR_JAVA -extern cl::Option skipvirtual; +extern maplecl::Option skipvirtual; #endif -extern cl::Option userc; -extern cl::Option strictNaiveRc; -extern cl::Option rcOpt1; -extern cl::Option nativeopt; -extern cl::Option o0; -extern cl::Option o2; -extern cl::Option os; -extern cl::Option criticalNative; -extern cl::Option fastNative; -extern cl::Option nodot; -extern cl::Option genIrProfile; -extern cl::Option profileTest; -extern cl::Option barrier; -extern cl::Option nativeFuncPropertyFile; -extern cl::Option maplelinkerNolocal; -extern cl::Option buildApp; -extern cl::Option partialAot; -extern cl::Option decoupleInit; -extern cl::Option sourceMuid; -extern cl::Option deferredVisit; -extern cl::Option deferredVisit2; -extern cl::Option decoupleSuper; -extern cl::Option genDecoupleVtab; -extern cl::Option profileFunc; -extern cl::Option dumpDevirtual; -extern cl::Option readDevirtual; -extern cl::Option usewhiteclass; -extern cl::Option appPackageName; -extern cl::Option checkClInvocation; -extern cl::Option dumpClInvocation; -extern cl::Option warning; -extern cl::Option lazyBinding; -extern cl::Option hotFix; -extern cl::Option compactMeta; -extern cl::Option genPGOReport; -extern cl::Option inlineCache; -extern cl::Option noComment; -extern cl::Option rmnousefunc; -extern cl::Option sideeffect; -extern cl::Option dumpIPA; -extern cl::Option wpaa; -extern cl::Option numOfCloneVersions; -extern cl::Option numOfImpExprLowBound; -extern cl::Option numOfImpExprHighBound; -extern cl::Option numOfCallSiteLowBound; -extern cl::Option numOfCallSiteUpBound; -extern cl::Option numOfConstpropValue; +extern maplecl::Option userc; +extern maplecl::Option strictNaiveRc; +extern maplecl::Option rcOpt1; +extern maplecl::Option nativeopt; +extern maplecl::Option o0; +extern maplecl::Option o2; +extern maplecl::Option os; +extern maplecl::Option criticalNative; +extern maplecl::Option fastNative; +extern maplecl::Option nodot; +extern maplecl::Option genIrProfile; +extern maplecl::Option profileTest; +extern maplecl::Option barrier; +extern maplecl::Option nativeFuncPropertyFile; +extern maplecl::Option maplelinkerNolocal; +extern maplecl::Option buildApp; +extern maplecl::Option partialAot; +extern maplecl::Option decoupleInit; +extern maplecl::Option sourceMuid; +extern maplecl::Option deferredVisit; +extern maplecl::Option deferredVisit2; +extern maplecl::Option decoupleSuper; +extern maplecl::Option genDecoupleVtab; +extern maplecl::Option profileFunc; +extern maplecl::Option dumpDevirtual; +extern maplecl::Option readDevirtual; +extern maplecl::Option usewhiteclass; +extern maplecl::Option appPackageName; +extern maplecl::Option checkClInvocation; +extern maplecl::Option dumpClInvocation; +extern maplecl::Option warning; +extern maplecl::Option lazyBinding; +extern maplecl::Option hotFix; +extern maplecl::Option compactMeta; +extern maplecl::Option genPGOReport; +extern maplecl::Option inlineCache; +extern maplecl::Option noComment; +extern maplecl::Option rmnousefunc; +extern maplecl::Option sideeffect; +extern maplecl::Option dumpIPA; +extern maplecl::Option wpaa; +extern maplecl::Option numOfCloneVersions; +extern maplecl::Option numOfImpExprLowBound; +extern maplecl::Option numOfImpExprHighBound; +extern maplecl::Option numOfCallSiteLowBound; +extern maplecl::Option numOfCallSiteUpBound; +extern maplecl::Option numOfConstpropValue; } diff --git a/src/mapleall/maple_ir/src/mpl2mpl_options.cpp b/src/mapleall/maple_ir/src/mpl2mpl_options.cpp index dd634ad13ddec6515fb8ff2141010251887993a6..84ff4e4336472576ed929bb31d2e75ebc2ee6d45 100644 --- a/src/mapleall/maple_ir/src/mpl2mpl_options.cpp +++ b/src/mapleall/maple_ir/src/mpl2mpl_options.cpp @@ -21,442 +21,442 @@ namespace opts::mpl2mpl { -cl::Option dumpPhase({"--dump-phase"}, +maplecl::Option dumpPhase({"--dump-phase"}, " --dump-phase \tEnable debug trace for" " specified phase (can only specify once)\n" " \t--dump-phase=PHASENAME\n", {mpl2mplCategory}); -cl::Option skipPhase({"--skip-phase"}, +maplecl::Option skipPhase({"--skip-phase"}, " --skip-phase \tSkip the phase when adding it to phase manager\n" " \t--skip-phase=PHASENAME\n", {mpl2mplCategory}); -cl::Option skipFrom({"--skip-from"}, +maplecl::Option skipFrom({"--skip-from"}, " --skip-from \tSkip all remaining phases including PHASENAME\n" " \t--skip-from=PHASENAME\n", {mpl2mplCategory}); -cl::Option skipAfter({"--skip-after"}, +maplecl::Option skipAfter({"--skip-after"}, " --skip-after \tSkip all remaining phases after PHASENAME\n" " \t--skip-after=PHASENAME\n", {mpl2mplCategory}); -cl::Option dumpFunc({"--dump-func"}, +maplecl::Option dumpFunc({"--dump-func"}, " --dump-func \tDump/trace only for functions" " whose names contain FUNCNAME as substring\n" " \t(can only specify once)\n" " \t--dump-func=FUNCNAME\n", {mpl2mplCategory}); -cl::Option quiet({"--quiet"}, +maplecl::Option quiet({"--quiet"}, " --quiet \tDisable brief trace messages with phase/function names\n" " --no-quiet \tEnable brief trace messages with phase/function names\n", {mpl2mplCategory}, - cl::DisableWith("--no-quiet")); + maplecl::DisableWith("--no-quiet")); -cl::Option maplelinker({"--maplelinker"}, +maplecl::Option maplelinker({"--maplelinker"}, " --maplelinker \tGenerate MUID symbol tables and references\n" " --no-maplelinker \tDon't Generate MUID symbol tables and references\n", {mpl2mplCategory}, - cl::DisableWith("--no-maplelinker")); + maplecl::DisableWith("--no-maplelinker")); -cl::Option regnativefunc({"--regnativefunc"}, +maplecl::Option regnativefunc({"--regnativefunc"}, " --regnativefunc \tGenerate native stub function" " to support JNI registration and calling\n" " --no-regnativefunc \tDisable regnativefunc\n", {mpl2mplCategory}, - cl::DisableWith("--no-regnativefunc")); + maplecl::DisableWith("--no-regnativefunc")); -cl::Option inlineWithProfile({"--inline-with-profile"}, +maplecl::Option inlineWithProfile({"--inline-with-profile"}, " --inline-with-profile \tEnable profile-based inlining\n" " --no-inline-with-profile \tDisable profile-based inlining\n", {mpl2mplCategory}, - cl::DisableWith("--no-inline-with-profile")); + maplecl::DisableWith("--no-inline-with-profile")); -cl::Option inlineOpt({"--inline"}, +maplecl::Option inlineOpt({"--inline"}, " --inline \tEnable function inlining\n" " --no-inline \tDisable function inlining\n", {mpl2mplCategory}, - cl::DisableWith("--no-inline")); + maplecl::DisableWith("--no-inline")); -cl::Option ipaClone({"--ipa-clone"}, +maplecl::Option ipaClone({"--ipa-clone"}, " --ipa-clone \tEnable ipa constant_prop and clone\n" " --no-ipa-clone \tDisable ipa constant_prop and clone\n", {mpl2mplCategory}, - cl::DisableWith("--no-ipa-clone")); + maplecl::DisableWith("--no-ipa-clone")); -cl::Option noInlineFunc({"--no-inlinefunclist"}, +maplecl::Option noInlineFunc({"--no-inlinefunclist"}, " --no-inlinefunclist=list \tDo not inline function in this list\n", {mpl2mplCategory}); -cl::Option importFileList({"--importfilelist"}, +maplecl::Option importFileList({"--importfilelist"}, " --importfilelist=list \tImport there files to do cross module analysis\n", {mpl2mplCategory}); -cl::Option crossModuleInline({"--cross-module-inline"}, +maplecl::Option crossModuleInline({"--cross-module-inline"}, " --cross-module-inline \tEnable cross-module inlining\n" " --no-cross-module-inline \tDisable cross-module inlining\n", {mpl2mplCategory}, - cl::DisableWith("--no-cross-module-inline")); + maplecl::DisableWith("--no-cross-module-inline")); -cl::Option inlineSmallFunctionThreshold({"--inline-small-function-threshold"}, +maplecl::Option inlineSmallFunctionThreshold({"--inline-small-function-threshold"}, " --inline-small-function-threshold=15" " \tThreshold for inlining small function\n", {mpl2mplCategory}); -cl::Option inlineHotFunctionThreshold({"--inline-hot-function-threshold"}, +maplecl::Option inlineHotFunctionThreshold({"--inline-hot-function-threshold"}, " --inline-hot-function-threshold=30" " \tThreshold for inlining hot function\n", {mpl2mplCategory}); -cl::Option inlineRecursiveFunctionThreshold({"--inline-recursive-function-threshold"}, +maplecl::Option inlineRecursiveFunctionThreshold({"--inline-recursive-function-threshold"}, " --inline-recursive-function-threshold=15" " \tThreshold for inlining recursive function\n", {mpl2mplCategory}); -cl::Option inlineDepth({"--inline-depth"}, +maplecl::Option inlineDepth({"--inline-depth"}, " --inline-depth=8 \tMax call graph depth for inlining\n", {mpl2mplCategory}); -cl::Option inlineModuleGrow({"--inline-module-growth"}, +maplecl::Option inlineModuleGrow({"--inline-module-growth"}, " --inline-module-growth=100000" " \tThreshold for maxmium code size growth rate (10%)\n", {mpl2mplCategory}); -cl::Option inlineColdFuncThresh({"--inline-cold-function-threshold"}, +maplecl::Option inlineColdFuncThresh({"--inline-cold-function-threshold"}, " --inline-cold-function-threshold=3" " \tThreshold for inlining hot function\n", {mpl2mplCategory}); -cl::Option profileHotCount({"--profile-hot-count"}, +maplecl::Option profileHotCount({"--profile-hot-count"}, " --profile-hot-count=1000" " \tA count is regarded as hot if it exceeds this number\n", {mpl2mplCategory}); -cl::Option profileColdCount({"--profile-cold-count"}, +maplecl::Option profileColdCount({"--profile-cold-count"}, " --profile-cold-count=10" " \tA count is regarded as cold if it is below this number\n", {mpl2mplCategory}); -cl::Option profileHotRate({"--profile-hot-rate"}, +maplecl::Option profileHotRate({"--profile-hot-rate"}, " --profile-hot-rate=500000" " \tA count is regarded as hot if it is in the largest 50%\n", {mpl2mplCategory}); -cl::Option profileColdRate({"--profile-cold-rate"}, +maplecl::Option profileColdRate({"--profile-cold-rate"}, " --profile-cold-rate=900000" " \tA count is regarded as cold if it is in the smallest 10%\n", {mpl2mplCategory}); -cl::Option nativewrapper({"--nativewrapper"}, +maplecl::Option nativewrapper({"--nativewrapper"}, " --nativewrapper \tGenerate native wrappers [default]\n", {mpl2mplCategory}, - cl::DisableWith("--no-nativewrapper")); + maplecl::DisableWith("--no-nativewrapper")); -cl::Option regnativeDynamicOnly({"--regnative-dynamic-only"}, +maplecl::Option regnativeDynamicOnly({"--regnative-dynamic-only"}, " --regnative-dynamic-only \tOnly Generate dynamic register code," " Report Fatal Msg if no implemented\n" " --no-regnative-dynamic-only \tDisable regnative-dynamic-only\n", {mpl2mplCategory}, - cl::DisableWith("--no-regnative-dynamic-only")); + maplecl::DisableWith("--no-regnative-dynamic-only")); -cl::Option staticBindingList({"--static-binding-list"}, +maplecl::Option staticBindingList({"--static-binding-list"}, " --static-bindig-list \tOnly Generate static binding" " function in file configure list\n" " \t--static-bindig-list=file\n", {mpl2mplCategory}); -cl::Option dumpBefore({"--dump-before"}, +maplecl::Option dumpBefore({"--dump-before"}, " --dump-before \tDo extra IR dump before the specified phase\n" " --no-dump-before \tDon't extra IR dump before the specified phase\n", {mpl2mplCategory}, - cl::DisableWith("--no-dump-before")); + maplecl::DisableWith("--no-dump-before")); -cl::Option dumpAfter({"--dump-after"}, +maplecl::Option dumpAfter({"--dump-after"}, " --dump-after \tDo extra IR dump after the specified phase\n" " --no-dump-after \tDon't extra IR dump after the specified phase\n", {mpl2mplCategory}, - cl::DisableWith("--no-dump-after")); + maplecl::DisableWith("--no-dump-after")); -cl::Option dumpMuid({"--dump-muid"}, +maplecl::Option dumpMuid({"--dump-muid"}, " --dump-muid \tDump MUID def information into a .muid file\n" " --no-dump-muid \tDon't dump MUID def information into a .muid file\n", {mpl2mplCategory}, - cl::DisableWith("--no-dump-muid")); + maplecl::DisableWith("--no-dump-muid")); -cl::Option emitVtableImpl({"--emitVtableImpl"}, +maplecl::Option emitVtableImpl({"--emitVtableImpl"}, " --emitVtableImpl \tgenerate VtableImpl file\n" " --no-emitVtableImpl \tDon't generate VtableImpl file\n", {mpl2mplCategory}, - cl::DisableWith("--no-emitVtableImpl")); + maplecl::DisableWith("--no-emitVtableImpl")); #if MIR_JAVA -cl::Option skipvirtual({"--skipvirtual"}, +maplecl::Option skipvirtual({"--skipvirtual"}, " --skipvirtual\n" " --no-skipvirtual\n", {mpl2mplCategory}, - cl::DisableWith("--no-skipvirtual")); + maplecl::DisableWith("--no-skipvirtual")); #endif -cl::Option userc({"--userc"}, +maplecl::Option userc({"--userc"}, " --userc \tEnable reference counting [default]\n" " --no-userc \tDisable reference counting [default]\n", {mpl2mplCategory}, - cl::DisableWith("--no-userc")); + maplecl::DisableWith("--no-userc")); -cl::Option strictNaiveRc({"--strict-naiverc"}, +maplecl::Option strictNaiveRc({"--strict-naiverc"}, " --strict-naiverc \tStrict Naive RC mode," " assume no unsafe multi-thread read/write racing\n" " --no-strict-naiverc \tDisable strict-naiverc\n", {mpl2mplCategory}, - cl::DisableWith("--no-strict-naiverc")); + maplecl::DisableWith("--no-strict-naiverc")); -cl::Option rcOpt1({"--rc-opt1"}, +maplecl::Option rcOpt1({"--rc-opt1"}, " --rc-opt1 \tEnable RC optimization1 [default]\n", {mpl2mplCategory}, - cl::DisableWith("--no-rc-opt1")); + maplecl::DisableWith("--no-rc-opt1")); -cl::Option nativeopt({"--nativeopt"}, +maplecl::Option nativeopt({"--nativeopt"}, " --nativeopt \tEnable native opt\n" " --no-nativeopt \tDisable native opt\n", {mpl2mplCategory}, - cl::DisableWith("--no-nativeopt")); + maplecl::DisableWith("--no-nativeopt")); -cl::Option o0({"-O0", "--O0"}, +maplecl::Option o0({"-O0", "--O0"}, " -O0 \tDo some optimization.\n", {mpl2mplCategory}); -cl::Option o2({"-O2", "--O2"}, +maplecl::Option o2({"-O2", "--O2"}, " -O2 \tDo some optimization.\n", {mpl2mplCategory}); -cl::Option os({"-Os", "--Os"}, +maplecl::Option os({"-Os", "--Os"}, " -Os \tOptimize for size, based on O2.\n", {mpl2mplCategory}); -cl::Option criticalNative({"--CriticalNative"}, +maplecl::Option criticalNative({"--CriticalNative"}, " --CriticalNative \tFor CriticalNative optimization\n" " \t--CriticalNative=list_file\n", {mpl2mplCategory}); -cl::Option fastNative({"--FastNative"}, +maplecl::Option fastNative({"--FastNative"}, " --FastNative \tFor FastNative optimization\n" " \t--FastNative=list_file\n", {mpl2mplCategory}); -cl::Option nodot({"--nodot"}, +maplecl::Option nodot({"--nodot"}, " --nodot \tDisable dot file generation from cfg\n" " --no-nodot \tEnable dot file generation from cfg\n", {mpl2mplCategory}, - cl::DisableWith("--no-nodot")); + maplecl::DisableWith("--no-nodot")); -cl::Option genIrProfile({"--ir-profile-gen"}, +maplecl::Option genIrProfile({"--ir-profile-gen"}, " --ir-profile-gen \tGen IR level Profile\n" " --no-ir-profile-gen \tDisable Gen IR level Profile\n", {mpl2mplCategory}, - cl::DisableWith("--no-ir-profile-gen")); + maplecl::DisableWith("--no-ir-profile-gen")); -cl::Option profileTest({"--profile-test"}, +maplecl::Option profileTest({"--profile-test"}, " --profile-test \tprofile test\n" " --no-profile-test \tDisable profile test\n", {mpl2mplCategory}, - cl::DisableWith("--no-profile-test")); + maplecl::DisableWith("--no-profile-test")); -cl::Option barrier({"--barrier"}, +maplecl::Option barrier({"--barrier"}, " --barrier \tEnable barrier insertion instead of RC insertion\n" " --no-barrier \tDisable barrier insertion instead of RC insertion\n", {mpl2mplCategory}, - cl::DisableWith("--no-barrier")); + maplecl::DisableWith("--no-barrier")); -cl::Option nativeFuncPropertyFile({"--nativefunc-property-list"}, +maplecl::Option nativeFuncPropertyFile({"--nativefunc-property-list"}, " --nativefunc-property-list" " \tGenerate native binding function stub\n" " \t--nativefunc-property-list=file\n", {mpl2mplCategory}); -cl::Option maplelinkerNolocal({"--maplelinker-nolocal"}, +maplecl::Option maplelinkerNolocal({"--maplelinker-nolocal"}, " --maplelinker-nolocal \tDo not turn functions" " into local when maple linker is on\n" " --no-maplelinker-nolocal\n", {mpl2mplCategory}, - cl::DisableWith("--no-maplelinker-nolocal")); + maplecl::DisableWith("--no-maplelinker-nolocal")); -cl::Option buildApp({"--build-app"}, +maplecl::Option buildApp({"--build-app"}, " --build-app[=0,1,2] \tbuild the app dex" " 0:off, 1:method1, 2:method2, ignore:method1\n", {mpl2mplCategory}, - cl::optionalValue, cl::Init(1)); + maplecl::optionalValue, maplecl::Init(1)); -cl::Option partialAot({"--partialAot"}, +maplecl::Option partialAot({"--partialAot"}, " --partialAot \tenerate the detailed information for the partialAot\n", {mpl2mplCategory}, - cl::optionalValue); + maplecl::optionalValue); -cl::Option decoupleInit({"--decouple-init"}, +maplecl::Option decoupleInit({"--decouple-init"}, " --decouple-init \tdecouple the constructor method\n", {mpl2mplCategory}, - cl::optionalValue, cl::Init(1)); + maplecl::optionalValue, maplecl::Init(1)); -cl::Option sourceMuid({"--source-muid"}, +maplecl::Option sourceMuid({"--source-muid"}, " --source-muid="" \tWrite the source file muid into the mpl file\n", {mpl2mplCategory}, - cl::optionalValue); + maplecl::optionalValue); -cl::Option deferredVisit({"--deferred-visit"}, +maplecl::Option deferredVisit({"--deferred-visit"}, " --deferred-visit \tGenerate deferred MCC call for undefined type\n" " --no-deferred-visit \tDont't generate" " deferred MCC call for undefined type\n", {mpl2mplCategory}, - cl::DisableWith("--no-deferred-visit")); + maplecl::DisableWith("--no-deferred-visit")); -cl::Option deferredVisit2({"--deferred-visit2"}, +maplecl::Option deferredVisit2({"--deferred-visit2"}, " --deferred-visit2" " \tGenerate deferred MCC call(DAI2.0) for undefined type\n" " --no-deferred-visit2" " \tDon't generate deferred MCC call(DAI2.0) for undefined type\n", {mpl2mplCategory}, - cl::DisableWith("--no-deferred-visit2")); + maplecl::DisableWith("--no-deferred-visit2")); -cl::Option decoupleSuper({"--decouple-super"}, +maplecl::Option decoupleSuper({"--decouple-super"}, " --decouple-super \tGenerate deferred MCC call for undefined type\n" " --no-decouple-super \tDon't generate deferred MCC call for undefined type\n", {mpl2mplCategory}, - cl::DisableWith("--no-decouple-super")); + maplecl::DisableWith("--no-decouple-super")); -cl::Option genDecoupleVtab({"--gen-decouple-vtab"}, +maplecl::Option genDecoupleVtab({"--gen-decouple-vtab"}, " --gen-decouple-vtab \tGenerate the whole and complete vtab and itab\n" " --no-gen-decouple-vtab" " \tDon't generate the whole and complete vtab and itab\n", {mpl2mplCategory}, - cl::DisableWith("--no-gen-decouple-vtab")); + maplecl::DisableWith("--no-gen-decouple-vtab")); -cl::Option profileFunc({"--profile-func"}, +maplecl::Option profileFunc({"--profile-func"}, " --profile-func \tProfile function usage\n" " --no-profile-func \tDisable profile function usage\n", {mpl2mplCategory}, - cl::DisableWith("--no-profile-func")); + maplecl::DisableWith("--no-profile-func")); -cl::Option dumpDevirtual({"--dump-devirtual-list"}, +maplecl::Option dumpDevirtual({"--dump-devirtual-list"}, " --dump-devirtual-list" " \tDump candidates of devirtualization into a specified file\n" " \t--dump-devirtual-list=\n", {mpl2mplCategory}); -cl::Option readDevirtual({"--read-devirtual-list"}, +maplecl::Option readDevirtual({"--read-devirtual-list"}, " --read-devirtual-list \tRead in candidates of devirtualization from\n" " \t a specified file and perform devirtualizatin\n" " \t--read-devirtual-list=\n", {mpl2mplCategory}); -cl::Option usewhiteclass({"--usewhiteclass"}, +maplecl::Option usewhiteclass({"--usewhiteclass"}, " --usewhiteclass" " \tEnable use preloaded class list to reducing clinit check\n" " --no-usewhiteclass" " \tDisable use preloaded class list to reducing clinit check\n", {mpl2mplCategory}, - cl::DisableWith("--no-usewhiteclass")); + maplecl::DisableWith("--no-usewhiteclass")); -cl::Option appPackageName({"--app-package-name"}, +maplecl::Option appPackageName({"--app-package-name"}, " --app-package-name \tSet APP package name\n" " \t--app-package-name=package_name\n", {mpl2mplCategory}, - cl::optionalValue); + maplecl::optionalValue); -cl::Option checkClInvocation({"--check_cl_invocation"}, +maplecl::Option checkClInvocation({"--check_cl_invocation"}, " --check_cl_invocation \tFor classloader invocation checking\n" " \t--check_cl_invocation=list_file\n", {mpl2mplCategory}); -cl::Option dumpClInvocation({"--dump_cl_invocation"}, +maplecl::Option dumpClInvocation({"--dump_cl_invocation"}, " --dump_cl_invocation \tFor classloader invocation dumping.\n" " \tWork only if already set --check_cl_invocation\n" " --no-dump_cl_invocation \tDisable dump_cl_invocation\n", {mpl2mplCategory}, - cl::DisableWith("--no-dump_cl_invocation")); + maplecl::DisableWith("--no-dump_cl_invocation")); -cl::Option warning({"--warning"}, +maplecl::Option warning({"--warning"}, " --warning=level \t--warning=level\n", {mpl2mplCategory}); -cl::Option lazyBinding({"--lazy-binding"}, +maplecl::Option lazyBinding({"--lazy-binding"}, " --lazy-binding \tBind class symbols lazily[default off]\n" " --no-lazy-binding \tDon't bind class symbols lazily\n", {mpl2mplCategory}, - cl::DisableWith("--no-lazy-binding")); + maplecl::DisableWith("--no-lazy-binding")); -cl::Option hotFix({"--hot-fix"}, +maplecl::Option hotFix({"--hot-fix"}, " --hot-fix \tOpen for App hot fix[default off]\n" " --no-hot-fix \tDon't open for App hot fix\n", {mpl2mplCategory}, - cl::DisableWith("--no-hot-fix")); + maplecl::DisableWith("--no-hot-fix")); -cl::Option compactMeta({"--compact-meta"}, +maplecl::Option compactMeta({"--compact-meta"}, " --compact-meta \tEnable compact method and field meta\n" " --no-compact-meta \tDisable compact method and field meta\n", {mpl2mplCategory}, - cl::DisableWith("--no-compact-meta")); + maplecl::DisableWith("--no-compact-meta")); -cl::Option genPGOReport({"--gen-pgo-report"}, +maplecl::Option genPGOReport({"--gen-pgo-report"}, " --gen-pgo-report \tDisplay pgo report\n" " --no-gen-pgo-report\n", {mpl2mplCategory}, - cl::DisableWith("--no-gen-pgo-report")); + maplecl::DisableWith("--no-gen-pgo-report")); -cl::Option inlineCache({"--inlineCache"}, +maplecl::Option inlineCache({"--inlineCache"}, " --inlineCache \tbuild inlineCache 0,1,2,3\n", {mpl2mplCategory}, - cl::optionalValue, cl::Init(0)); + maplecl::optionalValue, maplecl::Init(0)); -cl::Option noComment({"--no-comment"}, +maplecl::Option noComment({"--no-comment"}, " --no-comment \tbuild inlineCache 0:off, 1:open\n", {mpl2mplCategory}); -cl::Option rmnousefunc({"--rmnousefunc"}, +maplecl::Option rmnousefunc({"--rmnousefunc"}, " --rmnousefunc \tEnable remove no-used file-static function\n" " --no-rmnousefunc \tDisable remove no-used file-static function\n", {mpl2mplCategory}, - cl::DisableWith("--no-rmnousefunc")); + maplecl::DisableWith("--no-rmnousefunc")); -cl::Option sideeffect({"--sideeffect"}, +maplecl::Option sideeffect({"--sideeffect"}, " --sideeffect \tIPA: analysis sideeffect\n" " --no-sideeffect \n", {mpl2mplCategory}, - cl::DisableWith("--no-sideeffect")); + maplecl::DisableWith("--no-sideeffect")); -cl::Option dumpIPA({"--dump-ipa"}, +maplecl::Option dumpIPA({"--dump-ipa"}, " --dump-ipa \tIPA: dump\n" " --no-dump-ipa \n", {mpl2mplCategory}, - cl::DisableWith("--no-dump-ipa")); + maplecl::DisableWith("--no-dump-ipa")); -cl::Option wpaa({"--wpaa"}, +maplecl::Option wpaa({"--wpaa"}, " --wpaa \tWhole Program Alias Analysis\n" " --no-wpaa \n", {mpl2mplCategory}, - cl::DisableWith("--no-wpaa")); + maplecl::DisableWith("--no-wpaa")); -cl::Option numOfCloneVersions({"--num-of-clone-versions"}, +maplecl::Option numOfCloneVersions({"--num-of-clone-versions"}, " --num-of-clone-versions=3 \tnum of clone versions\n", {mpl2mplCategory}); -cl::Option numOfImpExprLowBound({"--num-of-ImpExpr-LowBound"}, +maplecl::Option numOfImpExprLowBound({"--num-of-ImpExpr-LowBound"}, " --num-of-ImpExpr-LowBound=3 \tnum of ImpExpr LowBound\n", {mpl2mplCategory}); -cl::Option numOfImpExprHighBound({"--num-of-ImpExpr-HighBound"}, +maplecl::Option numOfImpExprHighBound({"--num-of-ImpExpr-HighBound"}, " --num-of-ImpExpr-LowBound=3 \tnum of ImpExpr LowBound\n", {mpl2mplCategory}); -cl::Option numOfCallSiteLowBound({"--num-of-CallSite-LowBound"}, +maplecl::Option numOfCallSiteLowBound({"--num-of-CallSite-LowBound"}, " --num-of-CallSite-LowBound=3 \tnum of CallSite LowBound\n", {mpl2mplCategory}); -cl::Option numOfCallSiteUpBound({"--num-of-CallSite-HighBound"}, +maplecl::Option numOfCallSiteUpBound({"--num-of-CallSite-HighBound"}, " --num-of-CallSite-HighBound=3 \tnum of CallSite HighBound\n", {mpl2mplCategory}); -cl::Option numOfConstpropValue({"--num-of-ConstProp-value"}, +maplecl::Option numOfConstpropValue({"--num-of-ConstProp-value"}, " --num-of-CallSite-HighBound=3 \tnum of CallSite HighBound\n", {mpl2mplCategory}); diff --git a/src/mapleall/maple_ir/src/option.cpp b/src/mapleall/maple_ir/src/option.cpp index ec7dad5c75571749bf72c5902e58fa7b66fdcd01..78bde6c2b199c4de003c86f8b144f4c0db3afdd7 100644 --- a/src/mapleall/maple_ir/src/option.cpp +++ b/src/mapleall/maple_ir/src/option.cpp @@ -152,44 +152,44 @@ bool Options::SolveOptions(bool isDebug) const { } } - cl::CopyIfEnabled(dumpBefore, opts::mpl2mpl::dumpBefore); - cl::CopyIfEnabled(dumpAfter, opts::mpl2mpl::dumpAfter); - cl::CopyIfEnabled(dumpFunc, opts::mpl2mpl::dumpFunc); + maplecl::CopyIfEnabled(dumpBefore, opts::mpl2mpl::dumpBefore); + maplecl::CopyIfEnabled(dumpAfter, opts::mpl2mpl::dumpAfter); + maplecl::CopyIfEnabled(dumpFunc, opts::mpl2mpl::dumpFunc); // quiet can be set by verbose option in driver - cl::CopyIfEnabled(quiet, !opts::verbose, opts::verbose); - cl::CopyIfEnabled(quiet, opts::mpl2mpl::quiet); - - cl::CopyIfEnabled(dumpPhase, opts::mpl2mpl::dumpPhase); - cl::CopyIfEnabled(skipPhase, opts::mpl2mpl::skipPhase); - cl::CopyIfEnabled(skipFrom, opts::mpl2mpl::skipFrom); - cl::CopyIfEnabled(skipAfter, opts::mpl2mpl::skipAfter); - cl::CopyIfEnabled(regNativeDynamicOnly, opts::mpl2mpl::regnativeDynamicOnly); - cl::CopyIfEnabled(staticBindingList, opts::mpl2mpl::staticBindingList); - cl::CopyIfEnabled(regNativeFunc, opts::mpl2mpl::regnativefunc); - cl::CopyIfEnabled(nativeWrapper, opts::mpl2mpl::nativewrapper); - cl::CopyIfEnabled(inlineWithProfile, opts::mpl2mpl::inlineWithProfile); - cl::CopyIfEnabled(useInline, opts::mpl2mpl::inlineOpt); - cl::CopyIfEnabled(enableIPAClone, opts::mpl2mpl::ipaClone); - cl::CopyIfEnabled(noInlineFuncList, opts::mpl2mpl::noInlineFunc); - cl::CopyIfEnabled(importFileList, opts::mpl2mpl::importFileList); - cl::CopyIfEnabled(numOfCloneVersions, opts::mpl2mpl::numOfCloneVersions); - cl::CopyIfEnabled(numOfImpExprLowBound, opts::mpl2mpl::numOfImpExprLowBound); - cl::CopyIfEnabled(numOfImpExprHighBound, opts::mpl2mpl::numOfImpExprHighBound); - cl::CopyIfEnabled(numOfCallSiteLowBound, opts::mpl2mpl::numOfCallSiteLowBound); - cl::CopyIfEnabled(numOfCallSiteUpBound, opts::mpl2mpl::numOfCallSiteUpBound); - cl::CopyIfEnabled(numOfConstpropValue, opts::mpl2mpl::numOfConstpropValue); - cl::CopyIfEnabled(useCrossModuleInline, opts::mpl2mpl::crossModuleInline); - cl::CopyIfEnabled(inlineSmallFunctionThreshold, opts::mpl2mpl::inlineSmallFunctionThreshold); - cl::CopyIfEnabled(inlineHotFunctionThreshold, opts::mpl2mpl::inlineHotFunctionThreshold); - cl::CopyIfEnabled(inlineRecursiveFunctionThreshold, opts::mpl2mpl::inlineRecursiveFunctionThreshold); - cl::CopyIfEnabled(inlineDepth, opts::mpl2mpl::inlineDepth); - cl::CopyIfEnabled(inlineModuleGrowth, opts::mpl2mpl::inlineModuleGrow); - cl::CopyIfEnabled(inlineColdFunctionThreshold, opts::mpl2mpl::inlineColdFuncThresh); - cl::CopyIfEnabled(profileHotCount, opts::mpl2mpl::profileHotCount); - cl::CopyIfEnabled(profileColdCount, opts::mpl2mpl::profileColdCount); - cl::CopyIfEnabled(profileHotRate, opts::mpl2mpl::profileHotRate); - cl::CopyIfEnabled(profileColdRate, opts::mpl2mpl::profileColdRate); + maplecl::CopyIfEnabled(quiet, !opts::verbose, opts::verbose); + maplecl::CopyIfEnabled(quiet, opts::mpl2mpl::quiet); + + maplecl::CopyIfEnabled(dumpPhase, opts::mpl2mpl::dumpPhase); + maplecl::CopyIfEnabled(skipPhase, opts::mpl2mpl::skipPhase); + maplecl::CopyIfEnabled(skipFrom, opts::mpl2mpl::skipFrom); + maplecl::CopyIfEnabled(skipAfter, opts::mpl2mpl::skipAfter); + maplecl::CopyIfEnabled(regNativeDynamicOnly, opts::mpl2mpl::regnativeDynamicOnly); + maplecl::CopyIfEnabled(staticBindingList, opts::mpl2mpl::staticBindingList); + maplecl::CopyIfEnabled(regNativeFunc, opts::mpl2mpl::regnativefunc); + maplecl::CopyIfEnabled(nativeWrapper, opts::mpl2mpl::nativewrapper); + maplecl::CopyIfEnabled(inlineWithProfile, opts::mpl2mpl::inlineWithProfile); + maplecl::CopyIfEnabled(useInline, opts::mpl2mpl::inlineOpt); + maplecl::CopyIfEnabled(enableIPAClone, opts::mpl2mpl::ipaClone); + maplecl::CopyIfEnabled(noInlineFuncList, opts::mpl2mpl::noInlineFunc); + maplecl::CopyIfEnabled(importFileList, opts::mpl2mpl::importFileList); + maplecl::CopyIfEnabled(numOfCloneVersions, opts::mpl2mpl::numOfCloneVersions); + maplecl::CopyIfEnabled(numOfImpExprLowBound, opts::mpl2mpl::numOfImpExprLowBound); + maplecl::CopyIfEnabled(numOfImpExprHighBound, opts::mpl2mpl::numOfImpExprHighBound); + maplecl::CopyIfEnabled(numOfCallSiteLowBound, opts::mpl2mpl::numOfCallSiteLowBound); + maplecl::CopyIfEnabled(numOfCallSiteUpBound, opts::mpl2mpl::numOfCallSiteUpBound); + maplecl::CopyIfEnabled(numOfConstpropValue, opts::mpl2mpl::numOfConstpropValue); + maplecl::CopyIfEnabled(useCrossModuleInline, opts::mpl2mpl::crossModuleInline); + maplecl::CopyIfEnabled(inlineSmallFunctionThreshold, opts::mpl2mpl::inlineSmallFunctionThreshold); + maplecl::CopyIfEnabled(inlineHotFunctionThreshold, opts::mpl2mpl::inlineHotFunctionThreshold); + maplecl::CopyIfEnabled(inlineRecursiveFunctionThreshold, opts::mpl2mpl::inlineRecursiveFunctionThreshold); + maplecl::CopyIfEnabled(inlineDepth, opts::mpl2mpl::inlineDepth); + maplecl::CopyIfEnabled(inlineModuleGrowth, opts::mpl2mpl::inlineModuleGrow); + maplecl::CopyIfEnabled(inlineColdFunctionThreshold, opts::mpl2mpl::inlineColdFuncThresh); + maplecl::CopyIfEnabled(profileHotCount, opts::mpl2mpl::profileHotCount); + maplecl::CopyIfEnabled(profileColdCount, opts::mpl2mpl::profileColdCount); + maplecl::CopyIfEnabled(profileHotRate, opts::mpl2mpl::profileHotRate); + maplecl::CopyIfEnabled(profileColdRate, opts::mpl2mpl::profileColdRate); if (opts::mpl2mpl::maplelinker) { mapleLinker = opts::mpl2mpl::maplelinker; @@ -199,29 +199,29 @@ bool Options::SolveOptions(bool isDebug) const { } } - cl::CopyIfEnabled(dumpMuidFile, opts::mpl2mpl::dumpMuid); - cl::CopyIfEnabled(emitVtableImpl, opts::mpl2mpl::emitVtableImpl); + maplecl::CopyIfEnabled(dumpMuidFile, opts::mpl2mpl::dumpMuid); + maplecl::CopyIfEnabled(emitVtableImpl, opts::mpl2mpl::emitVtableImpl); #if MIR_JAVA - cl::CopyIfEnabled(skipVirtualMethod, opts::mpl2mpl::skipvirtual); + maplecl::CopyIfEnabled(skipVirtualMethod, opts::mpl2mpl::skipvirtual); #endif - cl::CopyIfEnabled(noRC, !opts::mpl2mpl::userc, opts::mpl2mpl::userc); - cl::CopyIfEnabled(strictNaiveRC, opts::mpl2mpl::strictNaiveRc); - cl::CopyIfEnabled(gcOnly, opts::gconly); - cl::CopyIfEnabled(bigEndian, opts::bigendian); - cl::CopyIfEnabled(rcOpt1, opts::mpl2mpl::rcOpt1); - cl::CopyIfEnabled(nativeOpt, opts::mpl2mpl::nativeopt); - cl::CopyIfEnabled(criticalNativeFile, opts::mpl2mpl::criticalNative); - cl::CopyIfEnabled(fastNativeFile, opts::mpl2mpl::fastNative); - cl::CopyIfEnabled(noDot, opts::mpl2mpl::nodot); - cl::CopyIfEnabled(genIRProfile, opts::mpl2mpl::genIrProfile); - cl::CopyIfEnabled(profileTest, opts::mpl2mpl::profileTest); - cl::CopyIfEnabled(barrier, opts::mpl2mpl::barrier); - cl::CopyIfEnabled(nativeFuncPropertyFile, opts::mpl2mpl::nativeFuncPropertyFile); - - cl::CopyIfEnabled(mapleLinkerTransformLocal, !opts::mpl2mpl::maplelinkerNolocal, opts::mpl2mpl::maplelinkerNolocal); - cl::CopyIfEnabled(deferredVisit, opts::mpl2mpl::deferredVisit); + maplecl::CopyIfEnabled(noRC, !opts::mpl2mpl::userc, opts::mpl2mpl::userc); + maplecl::CopyIfEnabled(strictNaiveRC, opts::mpl2mpl::strictNaiveRc); + maplecl::CopyIfEnabled(gcOnly, opts::gconly); + maplecl::CopyIfEnabled(bigEndian, opts::bigendian); + maplecl::CopyIfEnabled(rcOpt1, opts::mpl2mpl::rcOpt1); + maplecl::CopyIfEnabled(nativeOpt, opts::mpl2mpl::nativeopt); + maplecl::CopyIfEnabled(criticalNativeFile, opts::mpl2mpl::criticalNative); + maplecl::CopyIfEnabled(fastNativeFile, opts::mpl2mpl::fastNative); + maplecl::CopyIfEnabled(noDot, opts::mpl2mpl::nodot); + maplecl::CopyIfEnabled(genIRProfile, opts::mpl2mpl::genIrProfile); + maplecl::CopyIfEnabled(profileTest, opts::mpl2mpl::profileTest); + maplecl::CopyIfEnabled(barrier, opts::mpl2mpl::barrier); + maplecl::CopyIfEnabled(nativeFuncPropertyFile, opts::mpl2mpl::nativeFuncPropertyFile); + + maplecl::CopyIfEnabled(mapleLinkerTransformLocal, !opts::mpl2mpl::maplelinkerNolocal, opts::mpl2mpl::maplelinkerNolocal); + maplecl::CopyIfEnabled(deferredVisit, opts::mpl2mpl::deferredVisit); if (opts::mpl2mpl::deferredVisit.IsEnabledByUser()) { deferredVisit = true; @@ -232,7 +232,7 @@ bool Options::SolveOptions(bool isDebug) const { } } - cl::CopyIfEnabled(decoupleSuper, opts::mpl2mpl::decoupleSuper); + maplecl::CopyIfEnabled(decoupleSuper, opts::mpl2mpl::decoupleSuper); if (opts::mpl2mpl::buildApp.IsEnabledByUser()) { if (opts::mpl2mpl::buildApp != 0 && @@ -245,13 +245,13 @@ bool Options::SolveOptions(bool isDebug) const { buildApp = opts::mpl2mpl::buildApp; } - cl::CopyIfEnabled(sourceMuid, opts::mpl2mpl::sourceMuid); + maplecl::CopyIfEnabled(sourceMuid, opts::mpl2mpl::sourceMuid); if (opts::decoupleStatic.IsEnabledByUser()) { decoupleStatic = opts::decoupleStatic; buildApp = (opts::decoupleStatic == true) ? 1 : 0; } - cl::CopyIfEnabled(partialAot, opts::mpl2mpl::partialAot); + maplecl::CopyIfEnabled(partialAot, opts::mpl2mpl::partialAot); if (opts::mpl2mpl::decoupleInit.IsEnabledByUser()) { if (opts::mpl2mpl::decoupleInit != 0 && @@ -269,12 +269,12 @@ bool Options::SolveOptions(bool isDebug) const { buildApp = Options::kConservativeDecouple; } - cl::CopyIfEnabled(genVtabAndItabForDecouple, opts::mpl2mpl::genDecoupleVtab); - cl::CopyIfEnabled(profileFunc, opts::mpl2mpl::profileFunc); - cl::CopyIfEnabled(dumpDevirtualList, opts::mpl2mpl::dumpDevirtual); - cl::CopyIfEnabled(readDevirtualList, opts::mpl2mpl::readDevirtual); - cl::CopyIfEnabled(usePreloadedClass, opts::mpl2mpl::usewhiteclass); - cl::CopyIfEnabled(profile, opts::profile); + maplecl::CopyIfEnabled(genVtabAndItabForDecouple, opts::mpl2mpl::genDecoupleVtab); + maplecl::CopyIfEnabled(profileFunc, opts::mpl2mpl::profileFunc); + maplecl::CopyIfEnabled(dumpDevirtualList, opts::mpl2mpl::dumpDevirtual); + maplecl::CopyIfEnabled(readDevirtualList, opts::mpl2mpl::readDevirtual); + maplecl::CopyIfEnabled(usePreloadedClass, opts::mpl2mpl::usewhiteclass); + maplecl::CopyIfEnabled(profile, opts::profile); if (opts::profileGen.IsEnabledByUser()) { if (O2) { @@ -285,17 +285,17 @@ bool Options::SolveOptions(bool isDebug) const { } } - cl::CopyIfEnabled(profileUse, opts::profileUse); - cl::CopyIfEnabled(genLMBC, opts::genLMBC); - cl::CopyIfEnabled(appPackageName, opts::mpl2mpl::appPackageName); - cl::CopyIfEnabled(classLoaderInvocationList, opts::mpl2mpl::checkClInvocation); - cl::CopyIfEnabled(dumpClassLoaderInvocation, opts::mpl2mpl::dumpClInvocation); - cl::CopyIfEnabled(warningLevel, opts::mpl2mpl::warning); - cl::CopyIfEnabled(lazyBinding, opts::mpl2mpl::lazyBinding); - cl::CopyIfEnabled(hotFix, opts::mpl2mpl::hotFix); - cl::CopyIfEnabled(compactMeta, opts::mpl2mpl::compactMeta); - cl::CopyIfEnabled(genPGOReport, opts::mpl2mpl::genPGOReport); - cl::CopyIfEnabled(verify, opts::verify); + maplecl::CopyIfEnabled(profileUse, opts::profileUse); + maplecl::CopyIfEnabled(genLMBC, opts::genLMBC); + maplecl::CopyIfEnabled(appPackageName, opts::mpl2mpl::appPackageName); + maplecl::CopyIfEnabled(classLoaderInvocationList, opts::mpl2mpl::checkClInvocation); + maplecl::CopyIfEnabled(dumpClassLoaderInvocation, opts::mpl2mpl::dumpClInvocation); + maplecl::CopyIfEnabled(warningLevel, opts::mpl2mpl::warning); + maplecl::CopyIfEnabled(lazyBinding, opts::mpl2mpl::lazyBinding); + maplecl::CopyIfEnabled(hotFix, opts::mpl2mpl::hotFix); + maplecl::CopyIfEnabled(compactMeta, opts::mpl2mpl::compactMeta); + maplecl::CopyIfEnabled(genPGOReport, opts::mpl2mpl::genPGOReport); + maplecl::CopyIfEnabled(verify, opts::verify); if (opts::mpl2mpl::inlineCache.IsEnabledByUser()) { if (opts::mpl2mpl::inlineCache != 0 && @@ -309,23 +309,23 @@ bool Options::SolveOptions(bool isDebug) const { inlineCache = opts::mpl2mpl::inlineCache; } - cl::CopyIfEnabled(noComment, opts::mpl2mpl::noComment); - cl::CopyIfEnabled(rmNoUseFunc, opts::mpl2mpl::rmnousefunc); - cl::CopyIfEnabled(sideEffect, opts::mpl2mpl::sideeffect); - cl::CopyIfEnabled(dumpIPA, opts::mpl2mpl::dumpIPA); - cl::CopyIfEnabled(wpaa, opts::mpl2mpl::wpaa); + maplecl::CopyIfEnabled(noComment, opts::mpl2mpl::noComment); + maplecl::CopyIfEnabled(rmNoUseFunc, opts::mpl2mpl::rmnousefunc); + maplecl::CopyIfEnabled(sideEffect, opts::mpl2mpl::sideeffect); + maplecl::CopyIfEnabled(dumpIPA, opts::mpl2mpl::dumpIPA); + maplecl::CopyIfEnabled(wpaa, opts::mpl2mpl::wpaa); return true; } bool Options::ParseOptions(int argc, char **argv, std::string &fileName) const { - cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, mpl2mplCategory); + maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, mpl2mplCategory); bool result = SolveOptions(false); if (!result) { return result; } - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; int inputFileCount = 0; for (auto &arg : badArgs) { if (FileUtils::IsFileExists(arg.first)) { diff --git a/src/mapleall/maple_me/include/me_options.h b/src/mapleall/maple_me/include/me_options.h index 797dc798d2395a4a1a35514f9b4aeb6e07720a5a..4b009116a771e5a3a083503d149e77052c87773c 100644 --- a/src/mapleall/maple_me/include/me_options.h +++ b/src/mapleall/maple_me/include/me_options.h @@ -25,115 +25,115 @@ namespace opts::me { -extern cl::Option help; -extern cl::Option o1; -extern cl::Option o2; -extern cl::Option os; -extern cl::Option o3; -extern cl::Option refusedcheck; -extern cl::Option range; -extern cl::Option dumpPhases; -extern cl::Option skipPhases; -extern cl::Option dumpFunc; -extern cl::Option quiet; -extern cl::Option nodot; -extern cl::Option userc; -extern cl::Option strictNaiverc; -extern cl::Option skipFrom; -extern cl::Option skipAfter; -extern cl::Option calleeHasSideEffect; -extern cl::Option ubaa; -extern cl::Option tbaa; -extern cl::Option ddaa; -extern cl::Option aliasAnalysisLevel; -extern cl::Option stmtnum; -extern cl::Option rclower; -extern cl::Option gconlyopt; -extern cl::Option usegcbar; -extern cl::Option regnativefunc; -extern cl::Option warnemptynative; -extern cl::Option dumpBefore; -extern cl::Option dumpAfter; -extern cl::Option realcheckcast; -extern cl::Option eprelimit; -extern cl::Option eprepulimit; -extern cl::Option stmtprepulimit; -extern cl::Option lprelimit; -extern cl::Option lprepulimit; -extern cl::Option pregrenamelimit; -extern cl::Option rename2preglimit; -extern cl::Option proplimit; -extern cl::Option copyproplimit; -extern cl::Option delrcpulimit; -extern cl::Option profileBbHotRate; -extern cl::Option profileBbColdRate; -extern cl::Option ignoreipa; -extern cl::Option enableHotColdSplit; -extern cl::Option aggressiveABCO; -extern cl::Option commonABCO; -extern cl::Option conservativeABCO; -extern cl::Option epreincluderef; -extern cl::Option eprelocalrefvar; -extern cl::Option eprelhsivar; -extern cl::Option dsekeepref; -extern cl::Option propbase; -extern cl::Option propiloadref; -extern cl::Option propglobalref; -extern cl::Option propfinaliloadref; -extern cl::Option propiloadrefnonparm; -extern cl::Option lessthrowalias; -extern cl::Option nodelegaterc; -extern cl::Option nocondbasedrc; -extern cl::Option subsumrc; -extern cl::Option performFSAA; -extern cl::Option strengthreduction; -extern cl::Option sradd; -extern cl::Option lftr; -extern cl::Option ivopts; -extern cl::Option checkcastopt; -extern cl::Option parmtoptr; -extern cl::Option nullcheckpre; -extern cl::Option clinitpre; -extern cl::Option dassignpre; -extern cl::Option assign2finalpre; -extern cl::Option regreadatreturn; -extern cl::Option propatphi; -extern cl::Option propduringbuild; -extern cl::Option propwithinverse; -extern cl::Option nativeopt; -extern cl::Option optdirectcall; -extern cl::Option enableEa; -extern cl::Option lprespeculate; -extern cl::Option lpre4address; -extern cl::Option lpre4largeint; -extern cl::Option spillatcatch; -extern cl::Option placementrc; -extern cl::Option lazydecouple; -extern cl::Option mergestmts; -extern cl::Option generalRegOnly; -extern cl::Option inlinefunclist; -extern cl::Option threads; -extern cl::Option ignoreInferredRetType; -extern cl::Option meverify; -extern cl::Option dserunslimit; -extern cl::Option hdserunslimit; -extern cl::Option hproprunslimit; -extern cl::Option sinklimit; -extern cl::Option sinkPUlimit; -extern cl::Option loopvec; -extern cl::Option seqvec; -extern cl::Option layoutwithpredict; -extern cl::Option veclooplimit; -extern cl::Option ivoptslimit; -extern cl::Option acquireFunc; -extern cl::Option releaseFunc; -extern cl::Option toolonly; -extern cl::Option toolstrict; -extern cl::Option skipvirtual; -extern cl::Option warning; -extern cl::Option remat; -extern cl::Option unifyrets; -extern cl::Option lfo; +extern maplecl::Option help; +extern maplecl::Option o1; +extern maplecl::Option o2; +extern maplecl::Option os; +extern maplecl::Option o3; +extern maplecl::Option refusedcheck; +extern maplecl::Option range; +extern maplecl::Option dumpPhases; +extern maplecl::Option skipPhases; +extern maplecl::Option dumpFunc; +extern maplecl::Option quiet; +extern maplecl::Option nodot; +extern maplecl::Option userc; +extern maplecl::Option strictNaiverc; +extern maplecl::Option skipFrom; +extern maplecl::Option skipAfter; +extern maplecl::Option calleeHasSideEffect; +extern maplecl::Option ubaa; +extern maplecl::Option tbaa; +extern maplecl::Option ddaa; +extern maplecl::Option aliasAnalysisLevel; +extern maplecl::Option stmtnum; +extern maplecl::Option rclower; +extern maplecl::Option gconlyopt; +extern maplecl::Option usegcbar; +extern maplecl::Option regnativefunc; +extern maplecl::Option warnemptynative; +extern maplecl::Option dumpBefore; +extern maplecl::Option dumpAfter; +extern maplecl::Option realcheckcast; +extern maplecl::Option eprelimit; +extern maplecl::Option eprepulimit; +extern maplecl::Option stmtprepulimit; +extern maplecl::Option lprelimit; +extern maplecl::Option lprepulimit; +extern maplecl::Option pregrenamelimit; +extern maplecl::Option rename2preglimit; +extern maplecl::Option proplimit; +extern maplecl::Option copyproplimit; +extern maplecl::Option delrcpulimit; +extern maplecl::Option profileBbHotRate; +extern maplecl::Option profileBbColdRate; +extern maplecl::Option ignoreipa; +extern maplecl::Option enableHotColdSplit; +extern maplecl::Option aggressiveABCO; +extern maplecl::Option commonABCO; +extern maplecl::Option conservativeABCO; +extern maplecl::Option epreincluderef; +extern maplecl::Option eprelocalrefvar; +extern maplecl::Option eprelhsivar; +extern maplecl::Option dsekeepref; +extern maplecl::Option propbase; +extern maplecl::Option propiloadref; +extern maplecl::Option propglobalref; +extern maplecl::Option propfinaliloadref; +extern maplecl::Option propiloadrefnonparm; +extern maplecl::Option lessthrowalias; +extern maplecl::Option nodelegaterc; +extern maplecl::Option nocondbasedrc; +extern maplecl::Option subsumrc; +extern maplecl::Option performFSAA; +extern maplecl::Option strengthreduction; +extern maplecl::Option sradd; +extern maplecl::Option lftr; +extern maplecl::Option ivopts; +extern maplecl::Option checkcastopt; +extern maplecl::Option parmtoptr; +extern maplecl::Option nullcheckpre; +extern maplecl::Option clinitpre; +extern maplecl::Option dassignpre; +extern maplecl::Option assign2finalpre; +extern maplecl::Option regreadatreturn; +extern maplecl::Option propatphi; +extern maplecl::Option propduringbuild; +extern maplecl::Option propwithinverse; +extern maplecl::Option nativeopt; +extern maplecl::Option optdirectcall; +extern maplecl::Option enableEa; +extern maplecl::Option lprespeculate; +extern maplecl::Option lpre4address; +extern maplecl::Option lpre4largeint; +extern maplecl::Option spillatcatch; +extern maplecl::Option placementrc; +extern maplecl::Option lazydecouple; +extern maplecl::Option mergestmts; +extern maplecl::Option generalRegOnly; +extern maplecl::Option inlinefunclist; +extern maplecl::Option threads; +extern maplecl::Option ignoreInferredRetType; +extern maplecl::Option meverify; +extern maplecl::Option dserunslimit; +extern maplecl::Option hdserunslimit; +extern maplecl::Option hproprunslimit; +extern maplecl::Option sinklimit; +extern maplecl::Option sinkPUlimit; +extern maplecl::Option loopvec; +extern maplecl::Option seqvec; +extern maplecl::Option layoutwithpredict; +extern maplecl::Option veclooplimit; +extern maplecl::Option ivoptslimit; +extern maplecl::Option acquireFunc; +extern maplecl::Option releaseFunc; +extern maplecl::Option toolonly; +extern maplecl::Option toolstrict; +extern maplecl::Option skipvirtual; +extern maplecl::Option warning; +extern maplecl::Option remat; +extern maplecl::Option unifyrets; +extern maplecl::Option lfo; } diff --git a/src/mapleall/maple_me/src/me_option.cpp b/src/mapleall/maple_me/src/me_option.cpp index fb9bdb7170f2d04cc6ba83d6e2ada85b6f391fe0..549e144e8851af4b48ab0dac623d1ee567497089 100644 --- a/src/mapleall/maple_me/src/me_option.cpp +++ b/src/mapleall/maple_me/src/me_option.cpp @@ -194,19 +194,19 @@ bool MeOption::SolveOptions(bool isDebug) { } } - cl::CopyIfEnabled(dumpBefore, opts::me::dumpBefore); - cl::CopyIfEnabled(dumpAfter, opts::me::dumpAfter); - cl::CopyIfEnabled(isBigEndian, opts::bigendian); - cl::CopyIfEnabled(dumpFunc, opts::me::dumpFunc); - cl::CopyIfEnabled(skipFrom, opts::me::skipFrom); - cl::CopyIfEnabled(skipAfter, opts::me::skipAfter); + maplecl::CopyIfEnabled(dumpBefore, opts::me::dumpBefore); + maplecl::CopyIfEnabled(dumpAfter, opts::me::dumpAfter); + maplecl::CopyIfEnabled(isBigEndian, opts::bigendian); + maplecl::CopyIfEnabled(dumpFunc, opts::me::dumpFunc); + maplecl::CopyIfEnabled(skipFrom, opts::me::skipFrom); + maplecl::CopyIfEnabled(skipAfter, opts::me::skipAfter); if (opts::me::dumpPhases.IsEnabledByUser()) { SplitPhases(opts::me::dumpPhases, dumpPhases); } - cl::CopyIfEnabled(quiet, opts::me::quiet); - cl::CopyIfEnabled(quiet, !opts::verbose, opts::verbose); + maplecl::CopyIfEnabled(quiet, opts::me::quiet); + maplecl::CopyIfEnabled(quiet, !opts::verbose, opts::verbose); if (opts::profileGen.IsEnabledByUser()) { if (optLevel != kLevelZero) { @@ -215,10 +215,10 @@ bool MeOption::SolveOptions(bool isDebug) { } } - cl::CopyIfEnabled(setCalleeHasSideEffect, opts::me::calleeHasSideEffect); - cl::CopyIfEnabled(unionBasedAA, opts::me::ubaa); - cl::CopyIfEnabled(tbaa, opts::me::tbaa); - cl::CopyIfEnabled(ddaa, opts::me::ddaa); + maplecl::CopyIfEnabled(setCalleeHasSideEffect, opts::me::calleeHasSideEffect); + maplecl::CopyIfEnabled(unionBasedAA, opts::me::ubaa); + maplecl::CopyIfEnabled(tbaa, opts::me::tbaa); + maplecl::CopyIfEnabled(ddaa, opts::me::ddaa); if (opts::me::aliasAnalysisLevel.IsEnabledByUser()) { aliasAnalysisLevel = opts::me::aliasAnalysisLevel; @@ -259,10 +259,10 @@ bool MeOption::SolveOptions(bool isDebug) { } } - cl::CopyIfEnabled(rcLowering, opts::me::rclower); - cl::CopyIfEnabled(noRC, !opts::me::userc, opts::me::userc); - cl::CopyIfEnabled(lazyDecouple, opts::me::lazydecouple); - cl::CopyIfEnabled(strictNaiveRC, opts::me::strictNaiverc); + maplecl::CopyIfEnabled(rcLowering, opts::me::rclower); + maplecl::CopyIfEnabled(noRC, !opts::me::userc, opts::me::userc); + maplecl::CopyIfEnabled(lazyDecouple, opts::me::lazydecouple); + maplecl::CopyIfEnabled(strictNaiveRC, opts::me::strictNaiverc); if (opts::gconly.IsEnabledByUser()) { gcOnly = opts::gconly; @@ -273,36 +273,36 @@ bool MeOption::SolveOptions(bool isDebug) { } } - cl::CopyIfEnabled(gcOnlyOpt, opts::me::gconlyopt); - cl::CopyIfEnabled(noGCBar, !opts::me::usegcbar, opts::me::usegcbar); - cl::CopyIfEnabled(realCheckCast, opts::me::realcheckcast); - cl::CopyIfEnabled(noDot, opts::me::nodot); - cl::CopyIfEnabled(stmtNum, opts::me::stmtnum); - cl::CopyIfEnabled(regNativeFunc, opts::me::regnativefunc); - cl::CopyIfEnabled(warnNativeFunc, opts::me::warnemptynative); - cl::CopyIfEnabled(epreLimit, opts::me::eprelimit); - cl::CopyIfEnabled(eprePULimit, opts::me::eprepulimit); - cl::CopyIfEnabled(stmtprePULimit, opts::me::stmtprepulimit); - cl::CopyIfEnabled(lpreLimit, opts::me::lprelimit); - cl::CopyIfEnabled(lprePULimit, opts::me::lprepulimit); - cl::CopyIfEnabled(pregRenameLimit, opts::me::pregrenamelimit); - cl::CopyIfEnabled(rename2pregLimit, opts::me::rename2preglimit); - cl::CopyIfEnabled(propLimit, opts::me::proplimit); - cl::CopyIfEnabled(copyPropLimit, opts::me::copyproplimit); - cl::CopyIfEnabled(delRcPULimit, opts::me::delrcpulimit); - cl::CopyIfEnabled(profileBBHotRate, opts::me::profileBbHotRate); - cl::CopyIfEnabled(profileBBColdRate, opts::me::profileBbColdRate); - cl::CopyIfEnabled(ignoreIPA, opts::me::ignoreipa); - cl::CopyIfEnabled(enableHotColdSplit, opts::me::enableHotColdSplit); - cl::CopyIfEnabled(aggressiveABCO, opts::me::aggressiveABCO); - cl::CopyIfEnabled(commonABCO, opts::me::commonABCO); - cl::CopyIfEnabled(conservativeABCO, opts::me::conservativeABCO); - cl::CopyIfEnabled(epreIncludeRef, opts::me::epreincluderef); - cl::CopyIfEnabled(epreLocalRefVar, opts::me::eprelocalrefvar); - cl::CopyIfEnabled(epreLHSIvar, opts::me::eprelhsivar); - cl::CopyIfEnabled(dseKeepRef, opts::me::dsekeepref); - cl::CopyIfEnabled(lessThrowAlias, opts::me::lessthrowalias); - cl::CopyIfEnabled(propBase, opts::me::propbase); + maplecl::CopyIfEnabled(gcOnlyOpt, opts::me::gconlyopt); + maplecl::CopyIfEnabled(noGCBar, !opts::me::usegcbar, opts::me::usegcbar); + maplecl::CopyIfEnabled(realCheckCast, opts::me::realcheckcast); + maplecl::CopyIfEnabled(noDot, opts::me::nodot); + maplecl::CopyIfEnabled(stmtNum, opts::me::stmtnum); + maplecl::CopyIfEnabled(regNativeFunc, opts::me::regnativefunc); + maplecl::CopyIfEnabled(warnNativeFunc, opts::me::warnemptynative); + maplecl::CopyIfEnabled(epreLimit, opts::me::eprelimit); + maplecl::CopyIfEnabled(eprePULimit, opts::me::eprepulimit); + maplecl::CopyIfEnabled(stmtprePULimit, opts::me::stmtprepulimit); + maplecl::CopyIfEnabled(lpreLimit, opts::me::lprelimit); + maplecl::CopyIfEnabled(lprePULimit, opts::me::lprepulimit); + maplecl::CopyIfEnabled(pregRenameLimit, opts::me::pregrenamelimit); + maplecl::CopyIfEnabled(rename2pregLimit, opts::me::rename2preglimit); + maplecl::CopyIfEnabled(propLimit, opts::me::proplimit); + maplecl::CopyIfEnabled(copyPropLimit, opts::me::copyproplimit); + maplecl::CopyIfEnabled(delRcPULimit, opts::me::delrcpulimit); + maplecl::CopyIfEnabled(profileBBHotRate, opts::me::profileBbHotRate); + maplecl::CopyIfEnabled(profileBBColdRate, opts::me::profileBbColdRate); + maplecl::CopyIfEnabled(ignoreIPA, opts::me::ignoreipa); + maplecl::CopyIfEnabled(enableHotColdSplit, opts::me::enableHotColdSplit); + maplecl::CopyIfEnabled(aggressiveABCO, opts::me::aggressiveABCO); + maplecl::CopyIfEnabled(commonABCO, opts::me::commonABCO); + maplecl::CopyIfEnabled(conservativeABCO, opts::me::conservativeABCO); + maplecl::CopyIfEnabled(epreIncludeRef, opts::me::epreincluderef); + maplecl::CopyIfEnabled(epreLocalRefVar, opts::me::eprelocalrefvar); + maplecl::CopyIfEnabled(epreLHSIvar, opts::me::eprelhsivar); + maplecl::CopyIfEnabled(dseKeepRef, opts::me::dsekeepref); + maplecl::CopyIfEnabled(lessThrowAlias, opts::me::lessthrowalias); + maplecl::CopyIfEnabled(propBase, opts::me::propbase); if (opts::me::propiloadref.IsEnabledByUser()) { propIloadRef = opts::me::propiloadref; @@ -315,8 +315,8 @@ bool MeOption::SolveOptions(bool isDebug) { } } - cl::CopyIfEnabled(propGlobalRef, opts::me::propglobalref); - cl::CopyIfEnabled(propFinaliLoadRef, opts::me::propfinaliloadref); + maplecl::CopyIfEnabled(propGlobalRef, opts::me::propglobalref); + maplecl::CopyIfEnabled(propFinaliLoadRef, opts::me::propfinaliloadref); if (opts::me::propiloadrefnonparm.IsEnabledByUser()) { propIloadRefNonParm = opts::me::propiloadrefnonparm; @@ -327,27 +327,27 @@ bool MeOption::SolveOptions(bool isDebug) { } } - cl::CopyIfEnabled(noDelegateRC, opts::me::nodelegaterc); - cl::CopyIfEnabled(noCondBasedRC, opts::me::nocondbasedrc); - cl::CopyIfEnabled(checkCastOpt, opts::me::checkcastopt); - cl::CopyIfEnabled(parmToPtr, opts::me::parmtoptr); - cl::CopyIfEnabled(nullCheckPre, opts::me::nullcheckpre); - cl::CopyIfEnabled(clinitPre, opts::me::clinitpre); - cl::CopyIfEnabled(dassignPre, opts::me::dassignpre); - cl::CopyIfEnabled(mergeStmts, opts::me::mergestmts); - cl::CopyIfEnabled(generalRegOnly, opts::me::generalRegOnly); - cl::CopyIfEnabled(assign2FinalPre, opts::me::assign2finalpre); - cl::CopyIfEnabled(regreadAtReturn, opts::me::regreadatreturn); - cl::CopyIfEnabled(propAtPhi, opts::me::propatphi); - cl::CopyIfEnabled(propDuringBuild, opts::me::propduringbuild); - cl::CopyIfEnabled(propWithInverse, opts::me::propwithinverse); - cl::CopyIfEnabled(nativeOpt, opts::me::nativeopt); - cl::CopyIfEnabled(optDirectCall, opts::me::optdirectcall); - cl::CopyIfEnabled(enableEA, opts::me::enableEa); - cl::CopyIfEnabled(lpreSpeculate, opts::me::lprespeculate); - cl::CopyIfEnabled(lpre4Address, opts::me::lpre4address); - cl::CopyIfEnabled(lpre4LargeInt, opts::me::lpre4largeint); - cl::CopyIfEnabled(spillAtCatch, opts::me::spillatcatch); + maplecl::CopyIfEnabled(noDelegateRC, opts::me::nodelegaterc); + maplecl::CopyIfEnabled(noCondBasedRC, opts::me::nocondbasedrc); + maplecl::CopyIfEnabled(checkCastOpt, opts::me::checkcastopt); + maplecl::CopyIfEnabled(parmToPtr, opts::me::parmtoptr); + maplecl::CopyIfEnabled(nullCheckPre, opts::me::nullcheckpre); + maplecl::CopyIfEnabled(clinitPre, opts::me::clinitpre); + maplecl::CopyIfEnabled(dassignPre, opts::me::dassignpre); + maplecl::CopyIfEnabled(mergeStmts, opts::me::mergestmts); + maplecl::CopyIfEnabled(generalRegOnly, opts::me::generalRegOnly); + maplecl::CopyIfEnabled(assign2FinalPre, opts::me::assign2finalpre); + maplecl::CopyIfEnabled(regreadAtReturn, opts::me::regreadatreturn); + maplecl::CopyIfEnabled(propAtPhi, opts::me::propatphi); + maplecl::CopyIfEnabled(propDuringBuild, opts::me::propduringbuild); + maplecl::CopyIfEnabled(propWithInverse, opts::me::propwithinverse); + maplecl::CopyIfEnabled(nativeOpt, opts::me::nativeopt); + maplecl::CopyIfEnabled(optDirectCall, opts::me::optdirectcall); + maplecl::CopyIfEnabled(enableEA, opts::me::enableEa); + maplecl::CopyIfEnabled(lpreSpeculate, opts::me::lprespeculate); + maplecl::CopyIfEnabled(lpre4Address, opts::me::lpre4address); + maplecl::CopyIfEnabled(lpre4LargeInt, opts::me::lpre4largeint); + maplecl::CopyIfEnabled(spillAtCatch, opts::me::spillatcatch); if (opts::me::placementrc.IsEnabledByUser()) { placementRC = opts::me::placementrc; @@ -366,37 +366,37 @@ bool MeOption::SolveOptions(bool isDebug) { epreIncludeRef = opts::me::subsumrc; } - cl::CopyIfEnabled(performFSAA, opts::me::performFSAA); - cl::CopyIfEnabled(strengthReduction, opts::me::strengthreduction); - cl::CopyIfEnabled(srForAdd, opts::me::sradd); - cl::CopyIfEnabled(doLFTR, opts::me::lftr); - cl::CopyIfEnabled(ivopts, opts::me::ivopts); - cl::CopyIfEnabled(inlineFuncList, opts::me::inlinefunclist); - cl::CopyIfEnabled(decoupleStatic, opts::decoupleStatic); - cl::CopyIfEnabled(threads, opts::me::threads); - cl::CopyIfEnabled(ignoreInferredRetType, opts::me::ignoreInferredRetType); - cl::CopyIfEnabled(meVerify, opts::me::meverify); - cl::CopyIfEnabled(dseRunsLimit, opts::me::dserunslimit); - cl::CopyIfEnabled(hdseRunsLimit, opts::me::hdserunslimit); - cl::CopyIfEnabled(hpropRunsLimit, opts::me::hproprunslimit); - cl::CopyIfEnabled(sinkLimit, opts::me::sinklimit); - cl::CopyIfEnabled(sinkPULimit, opts::me::sinkPUlimit); - cl::CopyIfEnabled(loopVec, opts::me::loopvec); - cl::CopyIfEnabled(seqVec, opts::me::seqvec); - cl::CopyIfEnabled(enableLFO, opts::me::lfo); - cl::CopyIfEnabled(rematLevel, opts::me::remat); - cl::CopyIfEnabled(layoutWithPredict, opts::me::layoutwithpredict); - cl::CopyIfEnabled(vecLoopLimit, opts::me::veclooplimit); - cl::CopyIfEnabled(ivoptsLimit, opts::me::ivoptslimit); - cl::CopyIfEnabled(unifyRets, opts::me::unifyrets); + maplecl::CopyIfEnabled(performFSAA, opts::me::performFSAA); + maplecl::CopyIfEnabled(strengthReduction, opts::me::strengthreduction); + maplecl::CopyIfEnabled(srForAdd, opts::me::sradd); + maplecl::CopyIfEnabled(doLFTR, opts::me::lftr); + maplecl::CopyIfEnabled(ivopts, opts::me::ivopts); + maplecl::CopyIfEnabled(inlineFuncList, opts::me::inlinefunclist); + maplecl::CopyIfEnabled(decoupleStatic, opts::decoupleStatic); + maplecl::CopyIfEnabled(threads, opts::me::threads); + maplecl::CopyIfEnabled(ignoreInferredRetType, opts::me::ignoreInferredRetType); + maplecl::CopyIfEnabled(meVerify, opts::me::meverify); + maplecl::CopyIfEnabled(dseRunsLimit, opts::me::dserunslimit); + maplecl::CopyIfEnabled(hdseRunsLimit, opts::me::hdserunslimit); + maplecl::CopyIfEnabled(hpropRunsLimit, opts::me::hproprunslimit); + maplecl::CopyIfEnabled(sinkLimit, opts::me::sinklimit); + maplecl::CopyIfEnabled(sinkPULimit, opts::me::sinkPUlimit); + maplecl::CopyIfEnabled(loopVec, opts::me::loopvec); + maplecl::CopyIfEnabled(seqVec, opts::me::seqvec); + maplecl::CopyIfEnabled(enableLFO, opts::me::lfo); + maplecl::CopyIfEnabled(rematLevel, opts::me::remat); + maplecl::CopyIfEnabled(layoutWithPredict, opts::me::layoutwithpredict); + maplecl::CopyIfEnabled(vecLoopLimit, opts::me::veclooplimit); + maplecl::CopyIfEnabled(ivoptsLimit, opts::me::ivoptslimit); + maplecl::CopyIfEnabled(unifyRets, opts::me::unifyrets); #if MIR_JAVA - cl::CopyIfEnabled(acquireFuncName, opts::me::acquireFunc); - cl::CopyIfEnabled(releaseFuncName, opts::me::releaseFunc); - cl::CopyIfEnabled(warningLevel, opts::me::warning); - cl::CopyIfEnabled(mplToolOnly, opts::me::toolonly); - cl::CopyIfEnabled(mplToolStrict, opts::me::toolstrict); - cl::CopyIfEnabled(skipVirtualMethod, opts::me::skipvirtual); + maplecl::CopyIfEnabled(acquireFuncName, opts::me::acquireFunc); + maplecl::CopyIfEnabled(releaseFuncName, opts::me::releaseFunc); + maplecl::CopyIfEnabled(warningLevel, opts::me::warning); + maplecl::CopyIfEnabled(mplToolOnly, opts::me::toolonly); + maplecl::CopyIfEnabled(mplToolStrict, opts::me::toolstrict); + maplecl::CopyIfEnabled(skipVirtualMethod, opts::me::skipvirtual); #endif return true; @@ -408,13 +408,13 @@ MeOption &MeOption::GetInstance() { } void MeOption::ParseOptions(int argc, char **argv, std::string &fileName) { - cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, meCategory); + maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, meCategory); bool result = SolveOptions(false); if (!result) { return; } - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; int inputFileCount = 0; for (auto &arg : badArgs) { if (FileUtils::IsFileExists(arg.first)) { diff --git a/src/mapleall/maple_me/src/me_options.cpp b/src/mapleall/maple_me/src/me_options.cpp index 75fbdb00651194afdb70522b4ea51ce703e644b3..66103cf29fe64caec4ab43b3d1fd9c5eee006e82 100644 --- a/src/mapleall/maple_me/src/me_options.cpp +++ b/src/mapleall/maple_me/src/me_options.cpp @@ -21,116 +21,116 @@ namespace opts::me { -cl::Option help({"--help", "-h"}, +maplecl::Option help({"--help", "-h"}, " -h --help \tPrint usage and exit.Available command names:\n" " \tme\n", {meCategory}); -cl::Option o1({"--O1", "-O1"}, +maplecl::Option o1({"--O1", "-O1"}, " -O1 \tDo some optimization.\n", {meCategory}); -cl::Option o2({"--O2", "-O2"}, +maplecl::Option o2({"--O2", "-O2"}, " -O2 \tDo some optimization.\n", {meCategory}); -cl::Option os({"--Os", "-Os"}, +maplecl::Option os({"--Os", "-Os"}, " -Os \tOptimize for size, based on O2.\n", {meCategory}); -cl::Option o3({"--O3", "-O3"}, +maplecl::Option o3({"--O3", "-O3"}, " -O3 \tDo aggressive optimizations.\n", {meCategory}); -cl::Option refusedcheck({"--refusedcheck"}, +maplecl::Option refusedcheck({"--refusedcheck"}, " --refusedcheck=FUNCNAME,... \tEnable ref check used in func in the comma" " separated list, * means all func.\n", {meCategory}); -cl::Option range({"--range"}, +maplecl::Option range({"--range"}, " --range \tOptimize only functions in the range [NUM0, NUM1]\n" " \t--range=NUM0,NUM1\n", {meCategory}); -cl::Option dumpPhases({"--dump-phases"}, +maplecl::Option dumpPhases({"--dump-phases"}, " --dump-phases \tEnable debug trace for specified phases" " in the comma separated list\n" " \t--dump-phases=PHASENAME,...\n", {meCategory}); -cl::Option skipPhases({"--skip-phases"}, +maplecl::Option skipPhases({"--skip-phases"}, " --skip-phases \tSkip the phases specified" " in the comma separated list\n" " \t--skip-phases=PHASENAME,...\n", {meCategory}); -cl::Option dumpFunc({"--dump-func"}, +maplecl::Option dumpFunc({"--dump-func"}, " --dump-func \tDump/trace only for functions whose names" " contain FUNCNAME as substring\n" " \t(can only specify once)\n" " \t--dump-func=FUNCNAME\n", {meCategory}); -cl::Option quiet({"--quiet"}, +maplecl::Option quiet({"--quiet"}, " --quiet \tDisable brief trace messages with phase/function names\n" " --no-quiet \tEnable brief trace messages with phase/function names\n", {meCategory}, - cl::DisableWith("--no-quiet")); + maplecl::DisableWith("--no-quiet")); -cl::Option nodot({"--nodot"}, +maplecl::Option nodot({"--nodot"}, " --nodot \tDisable dot file generation from cfg\n" " --no-nodot \tEnable dot file generation from cfg\n", {meCategory}, - cl::DisableWith("--no-nodot")); + maplecl::DisableWith("--no-nodot")); -cl::Option userc({"--userc"}, +maplecl::Option userc({"--userc"}, " --userc \tEnable reference counting [default]\n" " --no-userc \tDisable reference counting [default]\n", {meCategory}, - cl::DisableWith("--no-userc")); + maplecl::DisableWith("--no-userc")); -cl::Option strictNaiverc({"--strict-naiverc"}, +maplecl::Option strictNaiverc({"--strict-naiverc"}, " --strict-naiverc \tStrict Naive RC mode, assume no unsafe multi-thread" " read/write racing\n" " --no-strict-naiverc \tDisable Strict Naive RC mode, assume no unsafe" " multi-thread read/write racing\n", {meCategory}, - cl::DisableWith("--no-strict-naiverc")); + maplecl::DisableWith("--no-strict-naiverc")); -cl::Option skipFrom({"--skip-from"}, +maplecl::Option skipFrom({"--skip-from"}, " --skip-from \tSkip the rest phases from PHASENAME(included)\n" " \t--skip-from=PHASENAME\n", {meCategory}); -cl::Option skipAfter({"--skip-after"}, +maplecl::Option skipAfter({"--skip-after"}, " --skip-after \tSkip the rest phases after PHASENAME(excluded)\n" " \t--skip-after=PHASENAME\n", {meCategory}); -cl::Option calleeHasSideEffect({"--setCalleeHasSideEffect"}, +maplecl::Option calleeHasSideEffect({"--setCalleeHasSideEffect"}, " --setCalleeHasSideEffect \tSet all the callees have side effect\n" " --no-setCalleeHasSideEffect \tNot set all the callees have side effect\n", {meCategory}, - cl::DisableWith("--no-setCalleeHasSideEffect")); + maplecl::DisableWith("--no-setCalleeHasSideEffect")); -cl::Option ubaa({"--ubaa"}, +maplecl::Option ubaa({"--ubaa"}, " --ubaa \tEnable UnionBased alias analysis\n" " --no-ubaa \tDisable UnionBased alias analysis\n", {meCategory}, - cl::DisableWith("--no-ubaa")); + maplecl::DisableWith("--no-ubaa")); -cl::Option tbaa({"--tbaa"}, +maplecl::Option tbaa({"--tbaa"}, " --tbaa \tEnable type-based alias analysis\n" " --no-tbaa \tDisable type-based alias analysis\n", {meCategory}, - cl::DisableWith("--no-tbaa")); + maplecl::DisableWith("--no-tbaa")); -cl::Option ddaa({"--ddaa"}, +maplecl::Option ddaa({"--ddaa"}, " --ddaa \tEnable demand driven alias analysis\n" " --no-ddaa \tDisable demand driven alias analysis\n", {meCategory}, - cl::DisableWith("--no-ddaa")); + maplecl::DisableWith("--no-ddaa")); -cl::Option aliasAnalysisLevel({"--aliasAnalysisLevel"}, +maplecl::Option aliasAnalysisLevel({"--aliasAnalysisLevel"}, " --aliasAnalysisLevel \tSet level of alias analysis. \n" " \t0: most conservative;\n" " \t1: Union-based alias analysis;" @@ -139,542 +139,542 @@ cl::Option aliasAnalysisLevel({"--aliasAnalysisLevel"}, " \t--aliasAnalysisLevel=NUM\n", {meCategory}); -cl::Option stmtnum({"--stmtnum"}, +maplecl::Option stmtnum({"--stmtnum"}, " --stmtnum \tPrint MeStmt index number in IR dump\n" " --no-stmtnum \tDon't print MeStmt index number in IR dump\n", {meCategory}, - cl::DisableWith("--no-stmtnum")); + maplecl::DisableWith("--no-stmtnum")); -cl::Option rclower({"--rclower"}, +maplecl::Option rclower({"--rclower"}, " --rclower \tEnable rc lowering\n" " --no-rclower \tDisable rc lowering\n", {meCategory}, - cl::DisableWith("--no-rclower")); + maplecl::DisableWith("--no-rclower")); -cl::Option gconlyopt({"--gconlyopt"}, +maplecl::Option gconlyopt({"--gconlyopt"}, " --gconlyopt \tEnable write barrier optimization in gconly\n" " --no-gconlyopt \tDisable write barrier optimization in gconly\n", {meCategory}, - cl::DisableWith("--no-gconlyopt")); + maplecl::DisableWith("--no-gconlyopt")); -cl::Option usegcbar({"--usegcbar"}, +maplecl::Option usegcbar({"--usegcbar"}, " --usegcbar \tEnable GC barriers\n" " --no-usegcbar \tDisable GC barriers\n", {meCategory}, - cl::DisableWith("--no-usegcbar")); + maplecl::DisableWith("--no-usegcbar")); -cl::Option regnativefunc({"--regnativefunc"}, +maplecl::Option regnativefunc({"--regnativefunc"}, " --regnativefunc \tGenerate native stub function to support JNI" " registration and calling\n" " --no-regnativefunc \tDon't generate native stub function to support JNI" " registration and calling\n", {meCategory}, - cl::DisableWith("--no-regnativefunc")); + maplecl::DisableWith("--no-regnativefunc")); -cl::Option warnemptynative({"--warnemptynative"}, +maplecl::Option warnemptynative({"--warnemptynative"}, " --warnemptynative \tGenerate warning and abort unimplemented native" " function\n" " --no-warnemptynative \tDon't generate warning and abort unimplemented" " native function\n", {meCategory}, - cl::DisableWith("--no-warnemptynative")); + maplecl::DisableWith("--no-warnemptynative")); -cl::Option dumpBefore({"--dump-before"}, +maplecl::Option dumpBefore({"--dump-before"}, " --dump-before \tDo extra IR dump before the specified phase in me\n" " --no-dump-before \tDon't extra IR dump before the specified phase in me\n", {meCategory}, - cl::DisableWith("--no-dump-before")); + maplecl::DisableWith("--no-dump-before")); -cl::Option dumpAfter({"--dump-after"}, +maplecl::Option dumpAfter({"--dump-after"}, " --dump-after \tDo extra IR dump after the specified phase in me\n" " --no-dump-after \tDo not extra IR dump after the specified phase in me\n", {meCategory}, - cl::DisableWith("--no-dump-after")); + maplecl::DisableWith("--no-dump-after")); -cl::Option realcheckcast({"--realcheckcast"}, +maplecl::Option realcheckcast({"--realcheckcast"}, " --realcheckcast\n" " --no-realcheckcast\n", {meCategory}, - cl::DisableWith("--no-realcheckcast")); + maplecl::DisableWith("--no-realcheckcast")); -cl::Option eprelimit({"--eprelimit"}, +maplecl::Option eprelimit({"--eprelimit"}, " --eprelimit \tApply EPRE optimization only for" " the first NUM expressions\n" " \t--eprelimit=NUM\n", {meCategory}); -cl::Option eprepulimit({"--eprepulimit"}, +maplecl::Option eprepulimit({"--eprepulimit"}, " --eprepulimit \tApply EPRE optimization only for the first NUM PUs\n" " \t--eprepulimit=NUM\n", {meCategory}); -cl::Option stmtprepulimit({"--stmtprepulimit"}, +maplecl::Option stmtprepulimit({"--stmtprepulimit"}, " --stmtprepulimit \tApply STMTPRE optimization only for" " the first NUM PUs\n" " \t--stmtprepulimit=NUM\n", {meCategory}); -cl::Option lprelimit({"--lprelimit"}, +maplecl::Option lprelimit({"--lprelimit"}, " --lprelimit \tApply LPRE optimization only for" " the first NUM variables\n" " \t--lprelimit=NUM\n", {meCategory}); -cl::Option lprepulimit({"--lprepulimit"}, +maplecl::Option lprepulimit({"--lprepulimit"}, " --lprepulimit \tApply LPRE optimization only for the first NUM PUs\n" " \t--lprepulimit=NUM\n", {meCategory}); -cl::Option pregrenamelimit({"--pregrenamelimit"}, +maplecl::Option pregrenamelimit({"--pregrenamelimit"}, " --pregrenamelimit" " \tApply Preg Renaming optimization only up to NUM times\n" " \t--pregrenamelimit=NUM\n", {meCategory}); -cl::Option rename2preglimit({"--rename2preglimit"}, +maplecl::Option rename2preglimit({"--rename2preglimit"}, " --rename2preglimit" " \tApply Rename-to-Preg optimization only up to NUM times\n" " \t--rename2preglimit=NUM\n", {meCategory}); -cl::Option proplimit({"--proplimit"}, +maplecl::Option proplimit({"--proplimit"}, " --proplimit" " \tApply propagation only up to NUM times in each hprop invocation\n" " \t--proplimit=NUM\n", {meCategory}); -cl::Option copyproplimit({"--copyproplimit"}, +maplecl::Option copyproplimit({"--copyproplimit"}, " --copyproplimit \tApply copy propagation only up to NUM times\n" " \t--copyproplimit=NUM\n", {meCategory}); -cl::Option delrcpulimit({"--delrcpulimit"}, +maplecl::Option delrcpulimit({"--delrcpulimit"}, " --delrcpulimit" " \tApply DELEGATERC optimization only for the first NUM PUs\n" " \t--delrcpulimit=NUM\n", {meCategory}); -cl::Option profileBbHotRate({"--profile-bb-hot-rate"}, +maplecl::Option profileBbHotRate({"--profile-bb-hot-rate"}, " --profile-bb-hot-rate=10" " \tA count is regarded as hot if it is in the largest 10%\n", {meCategory}); -cl::Option profileBbColdRate({"--profile-bb-cold-rate"}, +maplecl::Option profileBbColdRate({"--profile-bb-cold-rate"}, " --profile-bb-cold-rate=99" " \tA count is regarded as cold if it is in the smallest 1%\n", {meCategory}); -cl::Option ignoreipa({"--ignoreipa"}, +maplecl::Option ignoreipa({"--ignoreipa"}, " --ignoreipa \tIgnore information provided by interprocedural analysis\n" " --no-ignoreipa" " \tDon't ignore information provided by interprocedural analysis\n", {meCategory}, - cl::DisableWith("--no-ignoreipa")); + maplecl::DisableWith("--no-ignoreipa")); -cl::Option enableHotColdSplit({"--enableHotColdSplit"}, +maplecl::Option enableHotColdSplit({"--enableHotColdSplit"}, " --enableHotColdSplit \tEnable the HotCold function split\n" " --no-enableHotColdSplit \tDisable the HotCold function split\n", {meCategory}, - cl::DisableWith("--no-enableHotColdSplit")); + maplecl::DisableWith("--no-enableHotColdSplit")); -cl::Option aggressiveABCO({"--aggressiveABCO"}, +maplecl::Option aggressiveABCO({"--aggressiveABCO"}, " --aggressiveABCO" " \tEnable aggressive array boundary check optimization\n" " --no-aggressiveABCO" " \tDon't enable aggressive array boundary check optimization\n", {meCategory}, - cl::DisableWith("--no-aggressiveABCO")); + maplecl::DisableWith("--no-aggressiveABCO")); -cl::Option commonABCO({"--commonABCO"}, +maplecl::Option commonABCO({"--commonABCO"}, " --commonABCO \tEnable aggressive array boundary check optimization\n" " --no-commonABCO" " \tDon't enable aggressive array boundary check optimization\n", {meCategory}, - cl::DisableWith("--no-commonABCO")); + maplecl::DisableWith("--no-commonABCO")); -cl::Option conservativeABCO({"--conservativeABCO"}, +maplecl::Option conservativeABCO({"--conservativeABCO"}, " --conservativeABCO" " \tEnable aggressive array boundary check optimization\n" " --no-conservativeABCO" " \tDon't enable aggressive array boundary check optimization\n", {meCategory}, - cl::DisableWith("--no-conservativeABCO")); + maplecl::DisableWith("--no-conservativeABCO")); -cl::Option epreincluderef({"--epreincluderef"}, +maplecl::Option epreincluderef({"--epreincluderef"}, " --epreincluderef" " \tInclude ref-type expressions when performing epre optimization\n" " --no-epreincluderef" " \tDon't include ref-type expressions when performing epre optimization\n", {meCategory}, - cl::DisableWith("--no-epreincluderef")); + maplecl::DisableWith("--no-epreincluderef")); -cl::Option eprelocalrefvar({"--eprelocalrefvar"}, +maplecl::Option eprelocalrefvar({"--eprelocalrefvar"}, " --eprelocalrefvar" " \tThe EPRE phase will create new localrefvars when appropriate\n" " --no-eprelocalrefvar" " \tDisable the EPRE phase create new localrefvars when appropriate\n", {meCategory}, - cl::DisableWith("--no-eprelocalrefvar")); + maplecl::DisableWith("--no-eprelocalrefvar")); -cl::Option eprelhsivar({"--eprelhsivar"}, +maplecl::Option eprelhsivar({"--eprelhsivar"}, " --eprelhsivar" " \tThe EPRE phase will consider iassigns when optimizing ireads\n" " --no-eprelhsivar" " \tDisable the EPRE phase consider iassigns when optimizing ireads\n", {meCategory}, - cl::DisableWith("--no-eprelhsivar")); + maplecl::DisableWith("--no-eprelhsivar")); -cl::Option dsekeepref({"--dsekeepref"}, +maplecl::Option dsekeepref({"--dsekeepref"}, " --dsekeepref" " \tPreverse dassign of local var that are of ref type to anywhere\n" " --no-dsekeepref" " \tDon't preverse dassign of local var that are of ref type to anywhere\n", {meCategory}, - cl::DisableWith("--no-dsekeepref")); + maplecl::DisableWith("--no-dsekeepref")); -cl::Option propbase({"--propbase"}, +maplecl::Option propbase({"--propbase"}, " --propbase \tApply copy propagation" " that can change the base of indirect memory accesses\n" " --no-propbase \tDon't apply copy propagation\n", {meCategory}, - cl::DisableWith("--no-propbase")); + maplecl::DisableWith("--no-propbase")); -cl::Option propiloadref({"--propiloadref"}, +maplecl::Option propiloadref({"--propiloadref"}, " --propiloadref" " \tAllow copy propagating iloads that are of ref type to anywhere\n" " --no-propiloadref" " \tDon't aAllow copy propagating iloads that are of ref type to anywhere\n", {meCategory}, - cl::DisableWith("--no-propiloadref")); + maplecl::DisableWith("--no-propiloadref")); -cl::Option propglobalref({"--propglobalref"}, +maplecl::Option propglobalref({"--propglobalref"}, " --propglobalref" " \tAllow copy propagating global that are of ref type to anywhere\n" " --no-propglobalref" " \tDon't allow copy propagating global that are of ref type to anywhere\n", {meCategory}, - cl::DisableWith("--no-propglobalref")); + maplecl::DisableWith("--no-propglobalref")); -cl::Option propfinaliloadref({"--propfinaliloadref"}, +maplecl::Option propfinaliloadref({"--propfinaliloadref"}, " --propfinaliloadref \tAllow copy propagating iloads of\n" " \tfinal fields that are of ref type to anywhere\n" " --no-propfinaliloadref \tDisable propfinaliloadref\n", {meCategory}, - cl::DisableWith("--no-propfinaliloadref")); + maplecl::DisableWith("--no-propfinaliloadref")); -cl::Option propiloadrefnonparm({"--propiloadrefnonparm"}, +maplecl::Option propiloadrefnonparm({"--propiloadrefnonparm"}, " --propiloadrefnonparm" " \tAllow copy propagating iloads that are of ref type to\n" " \tanywhere except actual parameters\n" " --no-propiloadrefnonparm \tDisbale propiloadref\n", {meCategory}, - cl::DisableWith("--no-propiloadrefnonparm")); + maplecl::DisableWith("--no-propiloadrefnonparm")); -cl::Option lessthrowalias({"--lessthrowalias"}, +maplecl::Option lessthrowalias({"--lessthrowalias"}, " --lessthrowalias" " \tHandle aliases at java throw statements more accurately\n" " --no-lessthrowalias \tDisable lessthrowalias\n", {meCategory}, - cl::DisableWith("--no-lessthrowalias")); + maplecl::DisableWith("--no-lessthrowalias")); -cl::Option nodelegaterc({"--nodelegaterc"}, +maplecl::Option nodelegaterc({"--nodelegaterc"}, " --nodelegateerc" " \tDo not apply RC delegation to local object reference pointers\n" " --no-nodelegateerc \tDisable nodelegateerc\n", {meCategory}, - cl::DisableWith("--no-nodelegateerc")); + maplecl::DisableWith("--no-nodelegateerc")); -cl::Option nocondbasedrc({"--nocondbasedrc"}, +maplecl::Option nocondbasedrc({"--nocondbasedrc"}, " --nocondbasedrc \tDo not apply condition-based RC optimization to\n" " \tlocal object reference pointers\n" " --no-nocondbasedrc \tDisable nocondbasedrc\n", {meCategory}, - cl::DisableWith("--no-nocondbasedrc")); + maplecl::DisableWith("--no-nocondbasedrc")); -cl::Option subsumrc({"--subsumrc"}, +maplecl::Option subsumrc({"--subsumrc"}, " --subsumrc" " \tDelete decrements for localrefvars whose live range is just in\n" " \tanother which point to the same obj\n" " --no-subsumrc \tDisable subsumrc\n", {meCategory}, - cl::DisableWith("--no-subsumrc")); + maplecl::DisableWith("--no-subsumrc")); -cl::Option performFSAA({"--performFSAA"}, +maplecl::Option performFSAA({"--performFSAA"}, " --performFSAA \tPerform flow sensitive alias analysis\n" " --no-performFSAA \tDisable flow sensitive alias analysis\n", {meCategory}, - cl::DisableWith("--no-performFSAA")); + maplecl::DisableWith("--no-performFSAA")); -cl::Option strengthreduction({"--strengthreduction"}, +maplecl::Option strengthreduction({"--strengthreduction"}, " --strengthreduction \tPerform strength reduction\n" " --no-strengthreduction \tDisable strength reduction\n", {meCategory}, - cl::DisableWith("--no-strengthreduction")); + maplecl::DisableWith("--no-strengthreduction")); -cl::Option sradd({"--sradd"}, +maplecl::Option sradd({"--sradd"}, " --sradd \tPerform strength reduction for OP_add/sub\n" " --no-sradd \tDisable strength reduction for OP_add/sub\n", {meCategory}, - cl::DisableWith("--no-sradd")); + maplecl::DisableWith("--no-sradd")); -cl::Option lftr({"--lftr"}, +maplecl::Option lftr({"--lftr"}, " --lftr \tPerform linear function test replacement\n" " --no-lftr \tDisable linear function test replacement\n", {meCategory}, - cl::DisableWith("--no-lftr")); + maplecl::DisableWith("--no-lftr")); -cl::Option ivopts({"--ivopts"}, +maplecl::Option ivopts({"--ivopts"}, " --ivopts \tPerform induction variables optimization\n" " --no-ivopts \tDisable induction variables optimization\n", {meCategory}, - cl::DisableWith("--no-ivopts")); + maplecl::DisableWith("--no-ivopts")); -cl::Option checkcastopt({"--checkcastopt"}, +maplecl::Option checkcastopt({"--checkcastopt"}, " --checkcastopt \tApply template--checkcast optimization \n" " --no-checkcastopt \tDisable checkcastopt \n", {meCategory}, - cl::DisableWith("--no-checkcastopt")); + maplecl::DisableWith("--no-checkcastopt")); -cl::Option parmtoptr({"--parmtoptr"}, +maplecl::Option parmtoptr({"--parmtoptr"}, " --parmtoptr" " \tAllow rcoptlocals to change actual parameters from ref to ptr type\n" " --no-parmtoptr \tDisable parmtoptr\n", {meCategory}, - cl::DisableWith("--no-parmtoptr")); + maplecl::DisableWith("--no-parmtoptr")); -cl::Option nullcheckpre({"--nullcheckpre"}, +maplecl::Option nullcheckpre({"--nullcheckpre"}, " --nullcheckpre" " \tTurn on partial redundancy elimination of null pointer checks\n" " --no-nullcheckpre \tDisable nullcheckpre\n", {meCategory}, - cl::DisableWith("--no-nullcheckpre")); + maplecl::DisableWith("--no-nullcheckpre")); -cl::Option clinitpre({"--clinitpre"}, +maplecl::Option clinitpre({"--clinitpre"}, " --clinitpre" " \tTurn on partial redundancy elimination of class initialization checks\n" " --no-clinitpre \tDisable clinitpre\n", {meCategory}, - cl::DisableWith("--no-clinitpre")); + maplecl::DisableWith("--no-clinitpre")); -cl::Option dassignpre({"--dassignpre"}, +maplecl::Option dassignpre({"--dassignpre"}, " --dassignpre"" \tTurn on partial redundancy" " elimination of assignments to scalar variables\n" " --no-dassignpre \tDisable dassignpre\n", {meCategory}, - cl::DisableWith("--no-dassignpre")); + maplecl::DisableWith("--no-dassignpre")); -cl::Option assign2finalpre({"--assign2finalpre"}, +maplecl::Option assign2finalpre({"--assign2finalpre"}, " --assign2finalpre \tTurn on partial redundancy" " elimination of assignments to final variables\n" " --no-assign2finalpre \tDisable assign2finalpre\n", {meCategory}, - cl::DisableWith("--no-assign2finalpre")); + maplecl::DisableWith("--no-assign2finalpre")); -cl::Option regreadatreturn({"--regreadatreturn"}, +maplecl::Option regreadatreturn({"--regreadatreturn"}, " --regreadatreturn \tAllow register promotion" " to promote the operand of return statements\n" " --no-regreadatreturn \tDisable regreadatreturn\n", {meCategory}, - cl::DisableWith("--no-regreadatreturn")); + maplecl::DisableWith("--no-regreadatreturn")); -cl::Option propatphi({"--propatphi"}, +maplecl::Option propatphi({"--propatphi"}, " --propatphi \tEnable copy propagation across phi nodes\n" " --no-propatphi \tDisable propatphi\n", {meCategory}, - cl::DisableWith("--no-propatphi")); + maplecl::DisableWith("--no-propatphi")); -cl::Option propduringbuild({"--propduringbuild"}, +maplecl::Option propduringbuild({"--propduringbuild"}, " --propduringbuild \tEnable copy propagation when building HSSA\n" " --no-propduringbuild \tDisable propduringbuild\n", {meCategory}, - cl::DisableWith("--no-propduringbuild")); + maplecl::DisableWith("--no-propduringbuild")); -cl::Option propwithinverse({"--propwithinverse"}, +maplecl::Option propwithinverse({"--propwithinverse"}, " --propwithinverse" " \tEnable copy propagation across statements with inverse functions" " --no-propwithinverse" " \tDisable copy propagation across statements with inverse functions\n", {meCategory}, - cl::DisableWith("")); + maplecl::DisableWith("")); -cl::Option nativeopt({"--nativeopt"}, +maplecl::Option nativeopt({"--nativeopt"}, " --nativeopt \tEnable native opt\n" " --no-nativeopt \tDisable native opt\n", {meCategory}, - cl::DisableWith("--no-nativeopt")); + maplecl::DisableWith("--no-nativeopt")); -cl::Option optdirectcall({"--optdirectcall"}, +maplecl::Option optdirectcall({"--optdirectcall"}, " --optdirectcall \tEnable redundancy elimination of directcalls\n" " --no-optdirectcall \tDisable optdirectcall\n", {meCategory}, - cl::DisableWith("--no-optdirectcall")); + maplecl::DisableWith("--no-optdirectcall")); -cl::Option enableEa({"--enable-ea"}, +maplecl::Option enableEa({"--enable-ea"}, " --enable-ea \tEnable escape analysis\n" " --no-enable-ea \tDisable escape analysis\n", {meCategory}, - cl::DisableWith("--no-enable-ea")); + maplecl::DisableWith("--no-enable-ea")); -cl::Option lprespeculate({"--lprespeculate"}, +maplecl::Option lprespeculate({"--lprespeculate"}, " --lprespeculate \tEnable speculative code motion in LPRE phase\n" " --no-lprespeculate \tDisable speculative code motion in LPRE phase\n", {meCategory}, - cl::DisableWith("--no-lprespeculate")); + maplecl::DisableWith("--no-lprespeculate")); -cl::Option lpre4address({"--lpre4address"}, +maplecl::Option lpre4address({"--lpre4address"}, " --lpre4address \tEnable register promotion of addresses in LPRE phase\n" " --no-lpre4address" " \tDisable register promotion of addresses in LPRE phase\n", - cl::DisableWith("--no-lpre4address")); + maplecl::DisableWith("--no-lpre4address")); -cl::Option lpre4largeint({"--lpre4largeint"}, +maplecl::Option lpre4largeint({"--lpre4largeint"}, " --lpre4largeint" " \tEnable register promotion of large integers in LPRE phase\n" " --no-lpre4largeint" " \tDisable register promotion of large integers in LPRE phase\n", {meCategory}, - cl::DisableWith("--no-lpre4largeint")); + maplecl::DisableWith("--no-lpre4largeint")); -cl::Option spillatcatch({"--spillatcatch"}, +maplecl::Option spillatcatch({"--spillatcatch"}, " --spillatcatch \tMinimize upward exposed preg usage in catch blocks\n" " --no-spillatcatch \tDisable spillatcatch\n", {meCategory}, - cl::DisableWith("--no-spillatcatch")); + maplecl::DisableWith("--no-spillatcatch")); -cl::Option placementrc({"--placementrc"}, +maplecl::Option placementrc({"--placementrc"}, " --placementrc \tInsert RC decrements for localrefvars using\n" " \tthe placement optimization approach\n" " --no-placementrc \tInsert RC decrements for localrefvars using\n", {meCategory}, - cl::DisableWith("--no-placementrc")); + maplecl::DisableWith("--no-placementrc")); -cl::Option lazydecouple({"--lazydecouple"}, +maplecl::Option lazydecouple({"--lazydecouple"}, " --lazydecouple \tDo optimized for lazy Decouple\n" " --no-lazydecouple \tDo not optimized for lazy Decouple\n", {meCategory}, - cl::DisableWith("--no-lazydecouple")); + maplecl::DisableWith("--no-lazydecouple")); -cl::Option mergestmts({"--mergestmts"}, +maplecl::Option mergestmts({"--mergestmts"}, " --mergestmts \tTurn on statment merging optimization\n" " --no-mergestmts \tDisable mergestmts\n", {meCategory}, - cl::DisableWith("--no-mergestmts")); + maplecl::DisableWith("--no-mergestmts")); -cl::Option generalRegOnly({"--general-reg-only"}, +maplecl::Option generalRegOnly({"--general-reg-only"}, " --general-reg-only" " \tME will avoid generate fp type when enable general-reg-only\n" " --no-general-reg-only \tDisable general-reg-only\n", {meCategory}); -cl::Option inlinefunclist({"--inlinefunclist"}, +maplecl::Option inlinefunclist({"--inlinefunclist"}, " --inlinefunclist \tInlining related configuration\n" " \t--inlinefunclist=\n", {meCategory}); -cl::Option threads({"--threads"}, +maplecl::Option threads({"--threads"}, " --threads=n \tOptimizing me functions using n threads\n" " \tIf n >= 2," " ignore-inferred-return-type will be enabled default\n", {meCategory}); -cl::Option ignoreInferredRetType({"--ignore-inferred-ret-type"}, +maplecl::Option ignoreInferredRetType({"--ignore-inferred-ret-type"}, " --ignore-inferred-ret-type \tIgnore func return type inferred by ssadevrt\n" " --no-ignore-inferred-ret-type" "\tDo not ignore func return type inferred by ssadevirt\n", {meCategory}, - cl::DisableWith("--no-ignore-inferred-ret-type")); + maplecl::DisableWith("--no-ignore-inferred-ret-type")); -cl::Option meverify({"--meverify"}, +maplecl::Option meverify({"--meverify"}, " --meverify \tenable meverify features\n", {meCategory}, - cl::DisableWith("--no-meverify")); + maplecl::DisableWith("--no-meverify")); -cl::Option dserunslimit({"--dserunslimit"}, +maplecl::Option dserunslimit({"--dserunslimit"}, " --dserunslimit=n \tControl number of times dse phase can be run\n" " \t--dserunslimit=NUM\n", {meCategory}); -cl::Option hdserunslimit({"--hdserunslimit"}, +maplecl::Option hdserunslimit({"--hdserunslimit"}, " --hdserunslimit=n \tControl number of times hdse phase can be run\n" " \t--hdserunslimit=NUM\n", {meCategory}); -cl::Option hproprunslimit({"--hproprunslimit"}, +maplecl::Option hproprunslimit({"--hproprunslimit"}, " --hproprunslimit=n \tControl number of times hprop phase can be run\n" " \t--hproprunslimit=NUM\n", {meCategory}); -cl::Option sinklimit({"--sinklimit"}, +maplecl::Option sinklimit({"--sinklimit"}, " --sinklimit=n \tControl number of stmts sink-phase can sink\n" " \t--sinklimit=NUM\n", {meCategory}); -cl::Option sinkPUlimit({"--sinkPUlimit"}, +maplecl::Option sinkPUlimit({"--sinkPUlimit"}, " --sinkPUlimit=n \tControl number of function sink-phase can be run\n" " \t--sinkPUlimit=NUM\n", {meCategory}); -cl::Option loopvec({"--loopvec"}, +maplecl::Option loopvec({"--loopvec"}, " --loopvec \tEnable auto loop vectorization\n" " --no-loopvec \tDisable auto loop vectorization\n", {meCategory}, - cl::DisableWith("--no-loopvec")); + maplecl::DisableWith("--no-loopvec")); -cl::Option seqvec({"--seqvec"}, +maplecl::Option seqvec({"--seqvec"}, " --seqvec \tEnable auto sequencial vectorization\n" " --no-seqvec \tDisable auto sequencial vectorization\n", {meCategory}, - cl::DisableWith("--no-seqvec")); + maplecl::DisableWith("--no-seqvec")); -cl::Option layoutwithpredict({"--layoutwithpredict"}, +maplecl::Option layoutwithpredict({"--layoutwithpredict"}, " --layoutwithpredict" " \tEnable optimizing output layout using branch prediction\n" " --no-layoutwithpredict" " \tDisable optimizing output layout using branch prediction\n", {meCategory}, - cl::DisableWith("--no-layoutwithpredict")); + maplecl::DisableWith("--no-layoutwithpredict")); -cl::Option veclooplimit({"--veclooplimit"}, +maplecl::Option veclooplimit({"--veclooplimit"}, " --veclooplimit \tApply vectorize loops only up to NUM \n" " \t--veclooplimit=NUM\n", {meCategory}); -cl::Option ivoptslimit({"--ivoptslimit"}, +maplecl::Option ivoptslimit({"--ivoptslimit"}, " --ivoptslimit \tApply ivopts only up to NUM loops \n" " \t--ivoptslimit=NUM\n", {meCategory}); -cl::Option acquireFunc({"--acquire-func"}, +maplecl::Option acquireFunc({"--acquire-func"}, " --acquire-func \t--acquire-func=FUNCNAME\n", {meCategory}); -cl::Option releaseFunc({"--release-func"}, +maplecl::Option releaseFunc({"--release-func"}, " --release-func \t--release-func=FUNCNAME\n", {meCategory}); -cl::Option toolonly({"--toolonly"}, +maplecl::Option toolonly({"--toolonly"}, " --toolonly\n" " --no-toolonly\n", {meCategory}, - cl::DisableWith("--no-toolonly")); + maplecl::DisableWith("--no-toolonly")); -cl::Option toolstrict({"--toolstrict"}, +maplecl::Option toolstrict({"--toolstrict"}, " --toolstrict\n" " --no-toolstrict\n", {meCategory}, - cl::DisableWith("--no-toolstrict")); + maplecl::DisableWith("--no-toolstrict")); -cl::Option skipvirtual({"--skipvirtual"}, +maplecl::Option skipvirtual({"--skipvirtual"}, " --skipvirtual\n" " --no-skipvirtual\n", {meCategory}, - cl::DisableWith("--no-skipvirtual")); + maplecl::DisableWith("--no-skipvirtual")); -cl::Option warning({"--warning"}, +maplecl::Option warning({"--warning"}, " --warning=level \t--warning=level\n", {meCategory}); -cl::Option remat({"--remat"}, +maplecl::Option remat({"--remat"}, " --remat \tEnable rematerialization during register allocation\n" " \t 0: no rematerialization (default)\n" " \t >= 1: rematerialize constants\n" @@ -683,16 +683,16 @@ cl::Option remat({"--remat"}, " \t >= 4: rematerialize global dreads\n", {meCategory}); -cl::Option unifyrets({"--unifyrets"}, +maplecl::Option unifyrets({"--unifyrets"}, " --unifyrets \tEnable return blocks unification\n" " --no-unifyrets \tDisable return blocks unification\n", {meCategory}, - cl::DisableWith("--no-unifyrets")); + maplecl::DisableWith("--no-unifyrets")); -cl::Option lfo({"--lfo"}, +maplecl::Option lfo({"--lfo"}, " --lfo \tEnable LFO framework\n" " --no-lfo \tDisable LFO framework\n", {meCategory}, - cl::DisableWith("--no-lfo")); + maplecl::DisableWith("--no-lfo")); } diff --git a/src/mapleall/maple_util/include/cl_option.h b/src/mapleall/maple_util/include/cl_option.h index 7e29f5a8bc6aa70421309ed5533fbf3a74702791..195eaad5d63b3698cde57d7a75ad63007f7c9c7b 100644 --- a/src/mapleall/maple_util/include/cl_option.h +++ b/src/mapleall/maple_util/include/cl_option.h @@ -28,7 +28,7 @@ #include #include -namespace cl { +namespace maplecl { template constexpr inline bool digitalCheck = (std::is_same_v || @@ -60,9 +60,9 @@ enum class OptionVisibilityType { }; /* These constexpr are needed to use short name in option description, like this: - * cl::Option option({"--option"}, "Description", optionalValue); + * maplecl::Option option({"--option"}, "Description", optionalValue); * instead of: - * cl::Option option({"--option"}, "Description", ValueExpectedType::kValueOptional); + * maplecl::Option option({"--option"}, "Description", ValueExpectedType::kValueOptional); */ constexpr ValueExpectedType optionalValue = ValueExpectedType::kValueOptional; constexpr ValueExpectedType requiredValue = ValueExpectedType::kValueRequired; @@ -370,7 +370,7 @@ bool operator==(const char *arg, Option& opt) { } template -void CopyIfEnabled(T &dst, cl::Option &src) { +void CopyIfEnabled(T &dst, maplecl::Option &src) { if (src.IsEnabledByUser()) { dst = src; } diff --git a/src/mapleall/maple_util/include/cl_parser.h b/src/mapleall/maple_util/include/cl_parser.h index d15d556af96bdbdafc04b2290eb386833982e586..ffec864606845bf819f663a6a8a59cf9d2f57ef6 100644 --- a/src/mapleall/maple_util/include/cl_parser.h +++ b/src/mapleall/maple_util/include/cl_parser.h @@ -24,7 +24,7 @@ #include #include -namespace cl { +namespace maplecl { enum class RetCode { noError, diff --git a/src/mapleall/maple_util/src/cl_option.cpp b/src/mapleall/maple_util/src/cl_option.cpp index 82fc7513f52be2f82a70b4ff4df78539247351ac..51640baa804f390910ef56142141736f0e548225 100644 --- a/src/mapleall/maple_util/src/cl_option.cpp +++ b/src/mapleall/maple_util/src/cl_option.cpp @@ -17,7 +17,7 @@ #include #include -using namespace cl; +using namespace maplecl; void OptionInterface::FinalizeInitialization(const std::vector &optnames, const std::string &descr, diff --git a/src/mapleall/maple_util/src/cl_option_parser.cpp b/src/mapleall/maple_util/src/cl_option_parser.cpp index 10b9b4f94084f10ff2eb94d48fc72ea86574fbf4..addd56a858b3de8e4076d1448c24dfd914ec5fdf 100644 --- a/src/mapleall/maple_util/src/cl_option_parser.cpp +++ b/src/mapleall/maple_util/src/cl_option_parser.cpp @@ -22,7 +22,7 @@ #include #include -using namespace cl; +using namespace maplecl; /* ################################################################ * Utility Fuctions @@ -230,11 +230,11 @@ RetCode Option::ParseDigit(ssize_t &argsIndex, } /* Needed to describe OptionType<>::Parse template in this .cpp file */ -template class cl::Option; -template class cl::Option; -template class cl::Option; -template class cl::Option; -template class cl::Option; -template class cl::Option; -template class cl::Option; -template class cl::Option; +template class maplecl::Option; +template class maplecl::Option; +template class maplecl::Option; +template class maplecl::Option; +template class maplecl::Option; +template class maplecl::Option; +template class maplecl::Option; +template class maplecl::Option; diff --git a/src/mapleall/maple_util/src/cl_parser.cpp b/src/mapleall/maple_util/src/cl_parser.cpp index 34efc883d1da3614fcdef43ddca761dfc0eef808..c8a2aa9a2e51a71c195fedaa863f8c3128d961c4 100644 --- a/src/mapleall/maple_util/src/cl_parser.cpp +++ b/src/mapleall/maple_util/src/cl_parser.cpp @@ -24,7 +24,7 @@ #include #include -using namespace cl; +using namespace maplecl; CommandLine &CommandLine::GetCommandLine() { static CommandLine cl; diff --git a/src/mapleall/test/cl_ut_test.cpp b/src/mapleall/test/cl_ut_test.cpp index 07a2777949b2846c6fa54864ce80d28b61622b61..3c14bb5e73a8788d8e84a585a2bad64061e11dad 100644 --- a/src/mapleall/test/cl_ut_test.cpp +++ b/src/mapleall/test/cl_ut_test.cpp @@ -46,24 +46,24 @@ bool operator==(const std::string &str, const UTCLType &opt) { } template <> -void cl::Option::Clear() { +void maplecl::Option::Clear() { value.data = ""; } template <> -std::vector cl::Option::GetRawValues() { +std::vector maplecl::Option::GetRawValues() { return std::vector(); } template <> -cl::RetCode cl::Option::Parse(ssize_t &argsIndex, +maplecl::RetCode maplecl::Option::Parse(ssize_t &argsIndex, const std::deque &args, KeyArg &keyArg) { utCLTypeChecker = true; - RetCode err = cl::RetCode::noError; + RetCode err = maplecl::RetCode::noError; if (args[argsIndex] != "--uttype") { - return cl::RetCode::parsingErr; + return maplecl::RetCode::parsingErr; } ssize_t localArgsIndex = argsIndex + 1; @@ -75,10 +75,10 @@ cl::RetCode cl::Option::Parse(ssize_t &argsIndex, /* In this example, the value of UTCLType must be --UTCLTypeOption */ if (args[localArgsIndex] == "--UTCLTypeOption") { argsIndex += 2; /* 1 for Option Key, 1 for Value */ - err = cl::RetCode::noError; + err = maplecl::RetCode::noError; SetValue(UTCLType("--UTCLTypeOption")); } else { - err = cl::RetCode::valueEmpty; + err = maplecl::RetCode::valueEmpty; } return err; @@ -89,60 +89,60 @@ cl::RetCode cl::Option::Parse(ssize_t &argsIndex, namespace testopts { - cl::OptionCategory defaultCategory; - cl::OptionCategory testCategory1; - cl::OptionCategory testCategory2; + maplecl::OptionCategory defaultCategory; + maplecl::OptionCategory testCategory1; + maplecl::OptionCategory testCategory2; - cl::Option booloptEnabled({"--boole"}, ""); - cl::Option booloptDisabled({"--boold"}, ""); + maplecl::Option booloptEnabled({"--boole"}, ""); + maplecl::Option booloptDisabled({"--boold"}, ""); - cl::Option testStr({"--str"}, ""); + maplecl::Option testStr({"--str"}, ""); - cl::Option testUint8({"--uint8"}, ""); - cl::Option testUint16({"--uint16"}, ""); + maplecl::Option testUint8({"--uint8"}, ""); + maplecl::Option testUint16({"--uint16"}, ""); - cl::Option testInt32({"--int32"}, ""); - cl::Option testUint32({"--uint32"}, ""); + maplecl::Option testInt32({"--int32"}, ""); + maplecl::Option testUint32({"--uint32"}, ""); - cl::Option testInt64({"--int64"}, ""); - cl::Option testUint64({"--uint64"}, ""); + maplecl::Option testInt64({"--int64"}, ""); + maplecl::Option testUint64({"--uint64"}, ""); - cl::Option doubleDefinedOpt({"--tst", "-t"}, ""); + maplecl::Option doubleDefinedOpt({"--tst", "-t"}, ""); - cl::Option defaultBool({"--defbool"}, "", cl::Init(true)); - cl::Option defaultString({"--defstring"}, "", cl::Init("Default String")); - cl::Option defaultDigit({"--defdigit"}, "", cl::Init(-42)); + maplecl::Option defaultBool({"--defbool"}, "", maplecl::Init(true)); + maplecl::Option defaultString({"--defstring"}, "", maplecl::Init("Default String")); + maplecl::Option defaultDigit({"--defdigit"}, "", maplecl::Init(-42)); - cl::Option enable({"--enable"}, "", cl::Init(true), cl::DisableWith("--no-enable")); + maplecl::Option enable({"--enable"}, "", maplecl::Init(true), maplecl::DisableWith("--no-enable")); - cl::Option macro({"-JOIN"}, "", cl::joinedValue); - cl::Option joindig({"--joindig"}, "", cl::joinedValue); + maplecl::Option macro({"-JOIN"}, "", maplecl::joinedValue); + maplecl::Option joindig({"--joindig"}, "", maplecl::joinedValue); - cl::Option equalStr({"--eqstr"}, ""); - cl::Option equalDig({"--eqdig"}, ""); + maplecl::Option equalStr({"--eqstr"}, ""); + maplecl::Option equalDig({"--eqdig"}, ""); - cl::Option reqVal({"--reqval"}, "", cl::requiredValue, cl::Init(-42)); - cl::Option optVal({"--optval"}, "", cl::optionalValue, cl::Init(-42)); - cl::Option woVal({"--woval"}, "", cl::disallowedValue, cl::Init(-42)); + maplecl::Option reqVal({"--reqval"}, "", maplecl::requiredValue, maplecl::Init(-42)); + maplecl::Option optVal({"--optval"}, "", maplecl::optionalValue, maplecl::Init(-42)); + maplecl::Option woVal({"--woval"}, "", maplecl::disallowedValue, maplecl::Init(-42)); - cl::Option cat1Opt1({"--c1opt1"}, "", {testCategory1}); - cl::Option cat12Opt({"--c12opt"}, "", {testCategory1, testCategory2}); + maplecl::Option cat1Opt1({"--c1opt1"}, "", {testCategory1}); + maplecl::Option cat12Opt({"--c12opt"}, "", {testCategory1, testCategory2}); - cl::Option uttype({"--uttype"}, ""); + maplecl::Option uttype({"--uttype"}, ""); - cl::Option desc({"--desc"}, "It's test description"); + maplecl::Option desc({"--desc"}, "It's test description"); - cl::Option dup({"--dup"}, ""); + maplecl::Option dup({"--dup"}, ""); - cl::List vecString({"--vecstr"}, ""); - cl::List vecDig({"--vecdig"}, ""); - cl::List vecBool({"--vecbool"}, "", cl::DisableWith("--no-vecbool")); + maplecl::List vecString({"--vecstr"}, ""); + maplecl::List vecDig({"--vecdig"}, ""); + maplecl::List vecBool({"--vecbool"}, "", maplecl::DisableWith("--no-vecbool")); - cl::List vecStringDef({"--vecstrdef"}, "", cl::Init("Default")); - cl::List vecDigDef({"--vecdigdef"}, "", cl::Init(100)); - cl::List vecBoolDef({"--vecbooldef"}, "", cl::DisableWith("--no-vecbooldef"), cl::Init(true)); + maplecl::List vecStringDef({"--vecstrdef"}, "", maplecl::Init("Default")); + maplecl::List vecDigDef({"--vecdigdef"}, "", maplecl::Init(100)); + maplecl::List vecBoolDef({"--vecbooldef"}, "", maplecl::DisableWith("--no-vecbooldef"), maplecl::Init(true)); - cl::Option common({"--common"}, ""); + maplecl::Option common({"--common"}, ""); } // namespace testopts /* ################# "Enable/Disable Boolean Options" Test ############### @@ -157,8 +157,8 @@ TEST(clOptions, boolOpt) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); bool isSet = testopts::booloptEnabled; ASSERT_EQ(isSet, true); @@ -181,8 +181,8 @@ TEST(clOptions, comparableOpt1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); std::string lStr = "data"; int32_t lDig = 42; @@ -217,13 +217,13 @@ TEST(clOptions, IncorrectVal) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 1); ASSERT_EQ(badArgs[0].first, "--str"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::valueEmpty); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::valueEmpty); bool isSet = (testopts::booloptEnabled == true); ASSERT_EQ(isSet, true); @@ -246,8 +246,8 @@ TEST(clOptions, digitTestMaxVal) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); uint8_t uint8Dig = testopts::testUint8; ASSERT_EQ(uint8Dig, (1 << 8) - 1); @@ -277,15 +277,15 @@ TEST(clOptions, digitTestNegativeVal1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--uint32"); ASSERT_EQ(badArgs[1].first, "-10"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::incorrectValue); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::incorrectValue); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } TEST(clOptions, digitTestNegativeVal2) { @@ -297,15 +297,15 @@ TEST(clOptions, digitTestNegativeVal2) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--uint64"); ASSERT_EQ(badArgs[1].first, "-10"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::incorrectValue); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::incorrectValue); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } TEST(clOptions, digitTestNegativeVal3) { @@ -318,8 +318,8 @@ TEST(clOptions, digitTestNegativeVal3) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); int64_t int64Dig = testopts::testInt64; ASSERT_EQ(int64Dig, LLONG_MIN); @@ -334,15 +334,15 @@ TEST(clOptions, digitIncorrectPrefix) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--int32"); ASSERT_EQ(badArgs[1].first, "--10"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::incorrectValue); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::incorrectValue); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } TEST(clOptions, digitIncorrectVal) { @@ -354,15 +354,15 @@ TEST(clOptions, digitIncorrectVal) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--int32"); ASSERT_EQ(badArgs[1].first, "INCORRECT"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::incorrectValue); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::incorrectValue); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } /* ################# "Set out of range Value in Option" Test ############# @@ -377,15 +377,15 @@ TEST(clOptions, digitTestOutOfRange1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--int32"); ASSERT_EQ(badArgs[1].first, "-2147483649"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::outOfRange); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::outOfRange); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } TEST(clOptions, digitTestOutOfRange2) { @@ -399,10 +399,10 @@ TEST(clOptions, digitTestOutOfRange2) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 6); ASSERT_EQ(badArgs[0].first, "--uint32"); ASSERT_EQ(badArgs[1].first, "4294967296"); @@ -410,12 +410,12 @@ TEST(clOptions, digitTestOutOfRange2) { ASSERT_EQ(badArgs[3].first, "65536"); ASSERT_EQ(badArgs[4].first, "--uint8"); ASSERT_EQ(badArgs[5].first, "256"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::outOfRange); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); - ASSERT_EQ(badArgs[2].second, cl::RetCode::outOfRange); - ASSERT_EQ(badArgs[3].second, cl::RetCode::notRegistered); - ASSERT_EQ(badArgs[4].second, cl::RetCode::outOfRange); - ASSERT_EQ(badArgs[5].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::outOfRange); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); + ASSERT_EQ(badArgs[2].second, maplecl::RetCode::outOfRange); + ASSERT_EQ(badArgs[3].second, maplecl::RetCode::notRegistered); + ASSERT_EQ(badArgs[4].second, maplecl::RetCode::outOfRange); + ASSERT_EQ(badArgs[5].second, maplecl::RetCode::notRegistered); } TEST(clOptions, digitTestOutOfRange3) { @@ -427,15 +427,15 @@ TEST(clOptions, digitTestOutOfRange3) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--int64"); ASSERT_EQ(badArgs[1].first, "-9223372036854775809"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::outOfRange); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::outOfRange); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } TEST(clOptions, digitTestOutOfRange4) { @@ -447,15 +447,15 @@ TEST(clOptions, digitTestOutOfRange4) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--uint64"); ASSERT_EQ(badArgs[1].first, "18446744073709551616"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::outOfRange); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::outOfRange); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } /* ################# Check double option name definition ################# @@ -469,8 +469,8 @@ TEST(clOptions, doubleDef1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); bool isSet = testopts::doubleDefinedOpt; ASSERT_EQ(isSet, true); @@ -484,8 +484,8 @@ TEST(clOptions, doubleDef2) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); bool isSet = testopts::doubleDefinedOpt; ASSERT_EQ(isSet, true); @@ -501,8 +501,8 @@ TEST(clOptions, defaultVal) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); /* Default Options are not set in command line but initialized with default value */ bool isSet = testopts::defaultBool; @@ -528,8 +528,8 @@ TEST(clOptions, disableOpt1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); bool isSet = testopts::enable; ASSERT_EQ(isSet, true); @@ -544,8 +544,8 @@ TEST(clOptions, disableOpt2) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); bool isSet = testopts::enable; ASSERT_EQ(isSet, false); @@ -564,8 +564,8 @@ TEST(clOptions, joinedOpt) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); std::string joinOpt = testopts::macro; ASSERT_EQ(joinOpt, "MACRO"); @@ -587,8 +587,8 @@ TEST(clOptions, equalOpt) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); std::string equalStr = testopts::equalStr; ASSERT_EQ(equalStr, "EQUALSTRING"); @@ -607,17 +607,17 @@ TEST(clOptions, equalOptErr) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); /* --woval must not contain any key values, so 20 will be handled as second key */ - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--eqstr="); - ASSERT_EQ(badArgs[0].second, cl::RetCode::valueEmpty); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::valueEmpty); ASSERT_EQ(badArgs[1].first, "--eqdig="); - ASSERT_EQ(badArgs[0].second, cl::RetCode::valueEmpty); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::valueEmpty); } TEST(clOptions, joinedEqualOpt) { @@ -629,8 +629,8 @@ TEST(clOptions, joinedEqualOpt) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); std::string joinOpt = testopts::macro; ASSERT_EQ(joinOpt, "TEST=20"); @@ -649,13 +649,13 @@ TEST(clOptions, expectedVal1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 1); ASSERT_EQ(badArgs[0].first, "--reqval"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::incorrectValue); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::incorrectValue); bool isSet = testopts::booloptEnabled; ASSERT_EQ(isSet, true); @@ -670,8 +670,8 @@ TEST(clOptions, expectedVal2) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); int32_t equalDig = testopts::reqVal; ASSERT_EQ(equalDig, 20); @@ -686,8 +686,8 @@ TEST(clOptions, expectedVal3) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); int32_t equalDig = testopts::optVal; ASSERT_EQ(equalDig, -42); @@ -702,8 +702,8 @@ TEST(clOptions, expectedVal4) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); int32_t equalDig = testopts::optVal; ASSERT_EQ(equalDig, 20); @@ -718,8 +718,8 @@ TEST(clOptions, expectedVal5) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); } TEST(clOptions, expectedVal6) { @@ -736,8 +736,8 @@ TEST(clOptions, expectedVal6) { ASSERT_EQ(testopts::booloptEnabled.GetValue(), false); ASSERT_EQ(testopts::optVal.IsEnabledByUser(), false); - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); ASSERT_EQ(testopts::booloptEnabled.GetValue(), true); ASSERT_EQ(testopts::optVal.IsEnabledByUser(), true); @@ -753,14 +753,14 @@ TEST(clOptions, expectedVal7) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); /* --woval must not contain any key values, so 20 will be handled as second key */ - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 1); ASSERT_EQ(badArgs[0].first, "20"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::notRegistered); } TEST(clOptions, expectedVal8) { @@ -772,13 +772,13 @@ TEST(clOptions, expectedVal8) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 1); ASSERT_EQ(badArgs[0].first, "--woval=20"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::unnecessaryValue); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::unnecessaryValue); } TEST(clOptions, expectedVal9) { @@ -790,8 +790,8 @@ TEST(clOptions, expectedVal9) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); int32_t equalDig = testopts::woVal; ASSERT_EQ(equalDig, -42); @@ -809,13 +809,13 @@ TEST(clOptions, optCategory1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, testopts::defaultCategory); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, testopts::defaultCategory); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 1); ASSERT_EQ(badArgs[0].first, "--c1opt1"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::notRegistered); } TEST(clOptions, optCategory2) { @@ -828,8 +828,8 @@ TEST(clOptions, optCategory2) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, testopts::testCategory1); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, testopts::testCategory1); + ASSERT_EQ(err, maplecl::RetCode::noError); bool isSet = testopts::cat1Opt1; ASSERT_EQ(isSet, true); @@ -847,8 +847,8 @@ TEST(clOptions, optCategory3) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, testopts::testCategory2); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv, testopts::testCategory2); + ASSERT_EQ(err, maplecl::RetCode::noError); bool isSet = testopts::cat12Opt; ASSERT_EQ(isSet, true); @@ -868,15 +868,15 @@ TEST(clOptions, ownOptionType1) { ASSERT_EQ(utCLTypeChecker, false); - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); ASSERT_EQ(utCLTypeChecker, true); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 1); ASSERT_EQ(badArgs[0].first, "--uttype"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::valueEmpty); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::valueEmpty); } TEST(clOptions, ownOptionType2) { @@ -891,17 +891,17 @@ TEST(clOptions, ownOptionType2) { utCLTypeChecker = false; ASSERT_EQ(utCLTypeChecker, false); - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::parsingErr); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::parsingErr); ASSERT_EQ(utCLTypeChecker, true); - auto &badArgs = cl::CommandLine::GetCommandLine().badCLArgs; + auto &badArgs = maplecl::CommandLine::GetCommandLine().badCLArgs; ASSERT_EQ(badArgs.size(), 2); ASSERT_EQ(badArgs[0].first, "--uttype"); - ASSERT_EQ(badArgs[0].second, cl::RetCode::valueEmpty); + ASSERT_EQ(badArgs[0].second, maplecl::RetCode::valueEmpty); ASSERT_EQ(badArgs[1].first, "TEST"); - ASSERT_EQ(badArgs[1].second, cl::RetCode::notRegistered); + ASSERT_EQ(badArgs[1].second, maplecl::RetCode::notRegistered); } TEST(clOptions, ownOptionType3) { @@ -916,8 +916,8 @@ TEST(clOptions, ownOptionType3) { utCLTypeChecker = false; ASSERT_EQ(utCLTypeChecker, false); - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); ASSERT_EQ(utCLTypeChecker, true); UTCLType opt = testopts::uttype; @@ -933,7 +933,7 @@ TEST(clOptions, ownOptionType3) { * ####################################################################### */ TEST(clOptions, duplicatedOptions) { - EXPECT_DEATH(cl::Option dup2({"--dup"}, ""), ""); + EXPECT_DEATH(maplecl::Option dup2({"--dup"}, ""), ""); } /* ##################### Check Description ############################### @@ -943,7 +943,7 @@ TEST(clOptions, description) { ASSERT_EQ(testopts::desc.GetDescription(), "It's test description"); } -/* ##################### Check cl::list ################################## +/* ##################### Check maplecl::list ################################## * ####################################################################### */ TEST(clOptions, optList1) { @@ -959,8 +959,8 @@ TEST(clOptions, optList1) { nullptr}; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); auto strVals = testopts::vecString.GetValues(); ASSERT_EQ(strVals.size(), 3); @@ -979,7 +979,7 @@ TEST(clOptions, optList1) { ASSERT_EQ(boolVals[1], false); ASSERT_EQ(boolVals[2], true); - cl::CommandLine::GetCommandLine().Clear(); // to clear previous test data + maplecl::CommandLine::GetCommandLine().Clear(); // to clear previous test data ASSERT_EQ(testopts::vecBool.GetValues().size(), 0); ASSERT_EQ(testopts::vecDig.GetValues().size(), 0); @@ -1004,8 +1004,8 @@ TEST(clOptions, optList2) { ASSERT_EQ(testopts::vecBoolDef.GetValues()[0], true); ASSERT_EQ(testopts::vecStringDef.GetValues()[0], "Default"); - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); ASSERT_EQ(testopts::vecStringDef.GetValues().size(), 2); ASSERT_EQ(testopts::vecDigDef.GetValues().size(), 2); @@ -1016,7 +1016,7 @@ TEST(clOptions, optList2) { ASSERT_EQ(testopts::vecBoolDef.GetValues()[1], true); ASSERT_EQ(testopts::vecBoolDef.GetValues()[2], false); - cl::CommandLine::GetCommandLine().Clear(); // to clear previous test data + maplecl::CommandLine::GetCommandLine().Clear(); // to clear previous test data ASSERT_EQ(testopts::vecStringDef.GetValues().size(), 1); ASSERT_EQ(testopts::vecDigDef.GetValues().size(), 1); ASSERT_EQ(testopts::vecBoolDef.GetValues().size(), 1); @@ -1032,10 +1032,10 @@ TEST(clOptions, common) { nullptr }; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); - cl::OptionInterface *commonOpt = &testopts::common; + maplecl::OptionInterface *commonOpt = &testopts::common; std::string val = commonOpt->GetCommonValue(); ASSERT_EQ(val, "datacommon"); } @@ -1052,7 +1052,7 @@ TEST(clOptions, copyifenabled) { nullptr }; int argc = (sizeof(argv) / sizeof(argv[0])) - 1; - cl::CommandLine::GetCommandLine().Clear(); // to clear previous test data + maplecl::CommandLine::GetCommandLine().Clear(); // to clear previous test data /* Check that options are cleared */ ASSERT_EQ(testopts::booloptEnabled == false, true); ASSERT_EQ(testopts::booloptEnabled.IsEnabledByUser(), false); @@ -1063,20 +1063,20 @@ TEST(clOptions, copyifenabled) { ASSERT_EQ(testopts::testUint8 == (uint8_t)0, true); ASSERT_EQ(testopts::testUint8.IsEnabledByUser(), false); - auto err = cl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); - ASSERT_EQ(err, cl::RetCode::noError); + auto err = maplecl::CommandLine::GetCommandLine().Parse(argc, (char **)argv); + ASSERT_EQ(err, maplecl::RetCode::noError); bool boole = false, boold = false; std::string strTmp = ""; uint8_t u8Tmp = 0; int tstEnabled = -1, tstDisabled = -1; - cl::CopyIfEnabled(boole, testopts::booloptEnabled); - cl::CopyIfEnabled(boold, testopts::booloptDisabled); - cl::CopyIfEnabled(tstEnabled, 10, testopts::booloptEnabled); - cl::CopyIfEnabled(tstDisabled, 10, testopts::booloptDisabled); - cl::CopyIfEnabled(strTmp, testopts::testStr); - cl::CopyIfEnabled(u8Tmp, testopts::testUint8); + maplecl::CopyIfEnabled(boole, testopts::booloptEnabled); + maplecl::CopyIfEnabled(boold, testopts::booloptDisabled); + maplecl::CopyIfEnabled(tstEnabled, 10, testopts::booloptEnabled); + maplecl::CopyIfEnabled(tstDisabled, 10, testopts::booloptDisabled); + maplecl::CopyIfEnabled(strTmp, testopts::testStr); + maplecl::CopyIfEnabled(u8Tmp, testopts::testUint8); ASSERT_EQ(boole, true); ASSERT_EQ(boold, false);