Subzero: Allow per-method controls.

Several aspects of compilation can now be controlled with fine per-function granularity:

- Focus -timing on individual functions
- Only translate certain functions
- Enable verbosity only for certain functions
- Force O2 translation for certain functions (with Om1 default)

In addition, -test-status limits the output of -verbose=status.  This is just used to enable lit testing of the RangeSpec class.

The main motivation here is to enable bisection debugging of a PNaCl application running in the browser.  The initial use is to control O2 versus Om1, and could be extended to control things like address mode inference and advanced phi lowering, possibly even controlling at the granularity of the instruction numbers.

BUG= https://bugs.chromium.org/p/nativeclient/issues/detail?id=4370
R=eholk@chromium.org, jpp@chromium.org

Review URL: https://codereview.chromium.org/1900543002 .
diff --git a/src/IceClFlags.def b/src/IceClFlags.def
index 58f1777..0ae8e09 100644
--- a/src/IceClFlags.def
+++ b/src/IceClFlags.def
@@ -149,6 +149,9 @@
   X(ForceMemIntrinOpt, bool, dev_opt_flag, "fmem-intrin-opt",                  \
     cl::desc("Force optimization of memory intrinsics."))                      \
                                                                                \
+  X(ForceO2String, std::string, dev_opt_flag, "force-O2",                      \
+    cl::desc("Force -O2 for certain functions (assumes -Om1)"), cl::init(""))  \
+                                                                               \
   X(FunctionSections, bool, dev_opt_flag, "ffunction-sections",                \
     cl::desc("Emit functions into separate sections"))                         \
                                                                                \
@@ -282,15 +285,18 @@
              "frame in bytes (for testing)."),                                 \
     cl::init(0))                                                               \
                                                                                \
+  X(TestStatusString, std::string, dev_opt_flag, "test-status",                \
+    cl::desc("Testing flag for -verbose=status"), cl::init(":"))               \
+                                                                               \
   X(TimeEachFunction, bool, dev_opt_flag, "timing-funcs",                      \
     cl::desc("Print total translation time for each function"))                \
                                                                                \
-  X(TimingFocusOn, std::string, dev_opt_flag, "timing-focus",                  \
-    cl::desc("Break down timing for a specific function (use '*' for all)"),   \
+  X(TimingFocusOnString, std::string, dev_opt_flag, "timing-focus",            \
+    cl::desc("Break down timing for specific functions (use ':' for all)"),    \
     cl::init(""))                                                              \
                                                                                \
-  X(TranslateOnly, std::string, dev_opt_flag, "translate-only",                \
-    cl::desc("Translate only the given function"), cl::init(""))               \
+  X(TranslateOnlyString, std::string, dev_opt_flag, "translate-only",          \
+    cl::desc("Translate only the given functions"), cl::init(":"))             \
                                                                                \
   X(UseNonsfi, bool, dev_opt_flag, "nonsfi", cl::desc("Enable Non-SFI mode"))  \
                                                                                \
@@ -335,9 +341,9 @@
                    "Use all verbose options except 'regalloc,global_init'"),   \
         clEnumValN(Ice::IceV_None, "none", "No verbosity"), clEnumValEnd))     \
                                                                                \
-  X(VerboseFocusOn, std::string, dev_opt_flag, "verbose-focus",                \
-    cl::desc("Override with -verbose=none except for the specified function"), \
-    cl::init(""))
+  X(VerboseFocusOnString, std::string, dev_opt_flag, "verbose-focus",          \
+    cl::desc("Override with -verbose=none except for specified functions"),    \
+    cl::init(":"))
 //#define X(Name, Type, ClType, ...)
 
 } // end of namespace Ice