diff --git a/src/bin/jbc2mpl b/src/bin/jbc2mpl
index 8fbfc773a14bea5a598f656143b3e37900bd9def..d6817f1ebd0885c8a1373316be062fae44efab90 100755
Binary files a/src/bin/jbc2mpl and b/src/bin/jbc2mpl differ
diff --git a/src/bin/maple b/src/bin/maple
index 79506de0bf33614c9be1a31be5435f4b2c9090bb..2a63b17198c11930efd6975613dd159a2f14d34b 100755
Binary files a/src/bin/maple and b/src/bin/maple differ
diff --git a/src/deplibs/libmplphase.a b/src/deplibs/libmplphase.a
index 6601d5dc731a9ec62f170265fafd258820a9ef8d..a307177ad0dd8480a46e8c1aa479be93674a5654 100644
Binary files a/src/deplibs/libmplphase.a and b/src/deplibs/libmplphase.a differ
diff --git a/src/maple_be/src/cg/cg_option.cpp b/src/maple_be/src/cg/cg_option.cpp
index 5fb714153663e171d1bd486e493989d9a187d83a..d10b7935073089a3e21ef51e5340fce2e28af05e 100644
--- a/src/maple_be/src/cg/cg_option.cpp
+++ b/src/maple_be/src/cg/cg_option.cpp
@@ -64,9 +64,8 @@ enum OptionIndex : uint64 {
kCGQuiet = kCommonOptionEnd + 1,
kPie,
kPic,
- kVerbose,
+ kCGVerbose,
kCGMapleLinker,
- kCGHelp,
kCgen,
kCGNativeOpt,
kInsertCall,
@@ -97,7 +96,6 @@ enum OptionIndex : uint64 {
kCGO0,
kCGO1,
kCGO2,
- kProfileData,
kProepilogue,
kYieldPoing,
kLocalRc,
@@ -123,7 +121,8 @@ const Descriptor kUsage[] = {
"pie",
kBuildTypeProduct,
kArgCheckPolicyBool,
- " --pie \tGenerate position-independent executable\n",
+ " --pie \tGenerate position-independent executable\n"
+ " --no-pie\n",
"mplcg",
{} },
{ kPic,
@@ -132,16 +131,18 @@ const Descriptor kUsage[] = {
"fpic",
kBuildTypeProduct,
kArgCheckPolicyBool,
- " --fpic \tGenerate position-independent shared library\n",
+ " --fpic \tGenerate position-independent shared library\n"
+ " --no-fpic\n",
"mplcg",
{} },
- { kVerbose,
+ { kCGVerbose,
kEnable,
nullptr,
"verbose-asm",
kBuildTypeProduct,
kArgCheckPolicyBool,
- " --verbose-asm \tAdd comments to asm output\n",
+ " --verbose-asm \tAdd comments to asm output\n"
+ " --no-verbose-asm\n",
"mplcg",
{} },
{ kCGMapleLinker,
@@ -150,35 +151,28 @@ const Descriptor kUsage[] = {
"maplelinker",
kBuildTypeProduct,
kArgCheckPolicyBool,
- " --maplelinker \tGenerate the MapleLinker .s format\n",
+ " --maplelinker \tGenerate the MapleLinker .s format\n"
+ " --no-maplelinker\n",
"mplcg",
{} },
- { kCGQuiet,
+ { kCGQuiet,
kEnable,
nullptr,
"quiet",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --quiet \tBe quiet (don't output debug messages)\n",
+ " --quiet \tBe quiet (don't output debug messages)\n"
+ " --no-quiet\n",
"mplcg",
{} },
- { kCGHelp,
- 0,
- "h-mplcg",
- "help-mplcg",
- kBuildTypeAll,
- kArgCheckPolicyOptional,
- " -h-mplcg --help-mplcg \tPrint usage and exit.Available command names:\n"
- " \tmplcg\n",
- "all",
- {} },
{ kCgen,
kEnable,
nullptr,
"cg",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --cg \tGenerate the output .s file\n",
+ " --cg \tGenerate the output .s file\n"
+ " --no-cg\n",
"mplcg",
{} },
{ kCGLazyBinding,
@@ -194,9 +188,10 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"hot-fix",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --hot-fix \tOpen for App hot fix[default off]\n",
+ " --hot-fix \tOpen for App hot fix[default off]\n"
+ " --no-hot-fix\n",
"mplcg",
{} },
{ kCGNativeOpt,
@@ -205,50 +200,55 @@ const Descriptor kUsage[] = {
"nativeopt",
kBuildTypeProduct,
kArgCheckPolicyBool,
- " --nativeopt \tEnable native opt\n",
+ " --nativeopt \tEnable native opt\n"
+ " --no-nativeopt\n",
"mplcg",
{} },
{ kObjMap,
kEnable,
nullptr,
"objmap",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --objmap \tCreate object maps (GCTIBs) inside the main output (.s) file\n",
+ " --objmap \tCreate object maps (GCTIBs) inside the main output (.s) file\n"
+ " --no-objmap\n",
"mplcg",
{} },
{ kYieldPoing,
kEnable,
nullptr,
"yieldpoint",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --yieldpoint \tGenerate yieldpoints [default]\n",
+ " --yieldpoint \tGenerate yieldpoints [default]\n"
+ " --no-yieldpoint\n",
"mplcg",
{} },
{ kProepilogue,
kEnable,
nullptr,
"proepilogue",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --proepilogue \tDo tail call optimization and eliminate unnecessary prologue and epilogue.\n",
+ " --proepilogue \tDo tail call optimization and eliminate unnecessary prologue and epilogue.\n"
+ " --no-proepilogue\n",
"mplcg",
{} },
{ kLocalRc,
kEnable,
nullptr,
"local-rc",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --local-rc \tHandle Local Stack RC [default]\n",
+ " --local-rc \tHandle Local Stack RC [default]\n"
+ " --no-local-rc\n",
"mplcg",
{} },
{ kInsertCall,
0,
nullptr,
"insert-call",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --insert-call=name \tInsert a call to the named function\n",
"mplcg",
@@ -266,7 +266,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"class-list-file",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --class-list-file \tSet the class list file for the following generation options,\n"
" \tif not given, generate for all visible classes\n"
@@ -280,33 +280,36 @@ const Descriptor kUsage[] = {
kBuildTypeProduct,
kArgCheckPolicyBool,
" --gen-c-macro-def \tGenerate a .def file that contains extra type metadata, including the\n"
- " \tclass instance sizes and field offsets (default)\n",
+ " \tclass instance sizes and field offsets (default)\n"
+ " --no-gen-c-macro-def\n",
"mplcg",
{} },
{ kGenGctib,
kEnable,
nullptr,
"gen-gctib-file",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
" --gen-gctib-file \tGenerate a separate .s file for GCTIBs. Usually used together with\n"
- " \t--no-objmap (not implemented yet)\n",
+ " \t--no-objmap (not implemented yet)\n"
+ " --no-gen-gctib-file\n",
"mplcg",
{} },
{ kStackGuard,
kEnable,
nullptr,
"stackguard",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " -stackguard \tadd stack guard\n",
+ " -stackguard \tadd stack guard\n"
+ " -no-stackguard\n",
"mplcg",
{} },
{ kDebuggingInfo,
0,
"g",
nullptr,
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" -g \tGenerate debug information\n",
"mplcg",
@@ -342,7 +345,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"gmixedasm",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" --gmixedasm \tComment out both original source file and mpl file for debugging\n",
"mplcg",
@@ -351,7 +354,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"with-ra-graph-color",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" --with-ra-graph-color \tDo coloring-based register allocation\n",
"mplcg",
@@ -360,7 +363,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"const-fold",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" --const-fold \tEnable constant folding\n",
"mplcg",
@@ -369,7 +372,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"eh-exclusive-list",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --eh-exclusive-list \tFor generating gold files in unit testing\n"
" \t--eh-exclusive-list=list_file\n",
@@ -379,7 +382,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"O0",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" -O0 \tNo optimization.\n",
"mplcg",
@@ -388,7 +391,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"O1",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyOptional,
" -O1 \tDo some optimization.\n",
"mplcg",
@@ -406,7 +409,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"suppress-fileinfo",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" --suppress-fileinfo \tFor generating gold files in unit testing\n",
"mplcg",
@@ -415,7 +418,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"dump-cfg",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" --dump-cfg\n",
"mplcg",
@@ -424,7 +427,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"dump-phases",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --dump-phases=PHASENAME,... \tEnable debug trace for specified phases in the comma separated list\n",
"mplcg",
@@ -433,7 +436,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"skip-phases",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --skip-phases=PHASENAME,... \tSkip the phases specified in the comma separated list\n",
"mplcg",
@@ -442,7 +445,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"skip-from",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --skip-from=PHASENAME \tSkip the rest phases from PHASENAME(included)\n",
"mplcg",
@@ -451,7 +454,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"skip-after",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --skip-after=PHASENAME \tSkip the rest phases after PHASENAME(excluded)\n",
"mplcg",
@@ -460,7 +463,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"dump-func",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --dump-func=FUNCNAME \tDump/trace only for functions whose names contain FUNCNAME as substring\n"
" \t(can only specify once)\n",
@@ -470,7 +473,7 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"dump-before",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
" --dump-before \tDo extra IR dump before the specified phase\n"
" --no-dump-before \tDon't extra IR dump before the specified phase\n",
@@ -480,7 +483,7 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"dump-after",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
" --dump-after \tDo extra IR dump after the specified phase\n"
" --no-dump-after \tDon't extra IR dump after the specified phase\n",
@@ -490,7 +493,7 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"time-phases",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
" --time-phases \tCollect compilation time stats for each phase\n"
" --no-time-phases \tDon't Collect compilation time stats for each phase\n",
@@ -500,7 +503,7 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"use-barriers-for-volatile",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
" --use-barriers-for-volatile \tOptimize volatile load/str\n"
" --no-use-barriers-for-volatile\n",
@@ -510,7 +513,7 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"callee-cfi",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
" --callee-cfi \tcallee cfi message will be generated\n"
" --no-callee-cfi \tcallee cfi message will not be generated\n",
@@ -520,27 +523,17 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"print-func",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
" --print-func\n"
" --no-print-func\n",
"mplcg",
{} },
- { kProfileData,
- 0,
- nullptr,
- "profile_data",
- kBuildTypeAll,
- kArgCheckPolicyRequired,
- " --profile_data \tuse profile info to sort funcbody and class static field\n"
- " \t--profile_data=FUNCINFOFILE[:]CLASSINFOFILE\n",
- "mplcg",
- {} },
{ kCyclePatternList,
0,
nullptr,
"cycle-pattern-list",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyRequired,
" --cycle-pattern-list \tFor generating cycle pattern meta\n"
" \t--cycle-pattern-list=list_file\n",
@@ -560,7 +553,7 @@ const Descriptor kUsage[] = {
0,
nullptr,
"soe-check",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyNone,
" --soe-check \tInsert a soe check instruction[default off]\n",
"mplcg",
@@ -569,27 +562,20 @@ const Descriptor kUsage[] = {
kEnable,
nullptr,
"check-arraystore",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --check-arraystore \tcheck arraystore exception[default off]\n",
+ " --check-arraystore \tcheck arraystore exception[default off]\n"
+ " --no-check-arraystore\n",
"mplcg",
{} },
{ kLongCalls,
kEnable,
nullptr,
"long-calls",
- kBuildTypeAll,
+ kBuildTypeExperimental,
kArgCheckPolicyBool,
- " --long-calls \tgenerate long call\n",
- "mplcg",
- {} },
- { kGCOnly,
- kEnable,
- nullptr,
- "gconly",
- kBuildTypeProduct,
- kArgCheckPolicyBool,
- " --gconly \tEnable GCONLY, generate code without RC\n",
+ " --long-calls \tgenerate long call\n"
+ " --no-long-calls\n",
"mplcg",
{} },
// End
@@ -653,6 +639,9 @@ bool CGOptions::SolveOptions(const std::vector