Move Args::StringTo*** functions to a new OptionArgParser class

Summary:
The idea behind this is to move the functionality which depend on other lldb
classes into a separate class. This way, the Args class can be turned
into a lightweight arc+argv wrapper and moved into the lower lldb
layers.

Reviewers: jingham, zturner

Subscribers: lldb-commits

Differential Revision: https://reviews.llvm.org/D44306

llvm-svn: 329677
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp
index 01ca311..22b456d 100644
--- a/lldb/source/Commands/CommandObjectExpression.cpp
+++ b/lldb/source/Commands/CommandObjectExpression.cpp
@@ -27,6 +27,7 @@
 #include "lldb/Host/OptionParser.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Interpreter/OptionArgParser.h"
 #include "lldb/Symbol/ObjectFile.h"
 #include "lldb/Symbol/Variable.h"
 #include "lldb/Target/Language.h"
@@ -88,7 +89,7 @@
   case 'a': {
     bool success;
     bool result;
-    result = Args::StringToBoolean(option_arg, true, &success);
+    result = OptionArgParser::ToBoolean(option_arg, true, &success);
     if (!success)
       error.SetErrorStringWithFormat(
           "invalid all-threads value setting: \"%s\"",
@@ -99,7 +100,7 @@
 
   case 'i': {
     bool success;
-    bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+    bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
     if (success)
       ignore_breakpoints = tmp_value;
     else
@@ -111,7 +112,7 @@
 
   case 'j': {
     bool success;
-    bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+    bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
     if (success)
       allow_jit = tmp_value;
     else
@@ -131,7 +132,7 @@
 
   case 'u': {
     bool success;
-    bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+    bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
     if (success)
       unwind_on_error = tmp_value;
     else
@@ -146,8 +147,8 @@
       m_verbosity = eLanguageRuntimeDescriptionDisplayVerbosityFull;
       break;
     }
-    m_verbosity =
-        (LanguageRuntimeDescriptionDisplayVerbosity)Args::StringToOptionEnum(
+    m_verbosity = (LanguageRuntimeDescriptionDisplayVerbosity)
+        OptionArgParser::ToOptionEnum(
             option_arg, GetDefinitions()[option_idx].enum_values, 0, error);
     if (!error.Success())
       error.SetErrorStringWithFormat(
@@ -167,7 +168,7 @@
 
   case 'X': {
     bool success;
-    bool tmp_value = Args::StringToBoolean(option_arg, true, &success);
+    bool tmp_value = OptionArgParser::ToBoolean(option_arg, true, &success);
     if (success)
       auto_apply_fixits = tmp_value ? eLazyBoolYes : eLazyBoolNo;
     else