[FileSpec] Make style argument mandatory for SetFile. NFC

SetFile has an optional style argument which defaulted to the native
style. This patch makes that argument mandatory so clients of the
FileSpec class are forced to think about the correct syntax.

At the same time this introduces a (protected) convenience method to
update the file from within the FileSpec class that keeps the current
style.

These two changes together prevent a potential pitfall where the style
might be forgotten, leading to the path being updated and the style
unintentionally being changed to the host style.

llvm-svn: 334663
diff --git a/lldb/source/Commands/CommandObjectLog.cpp b/lldb/source/Commands/CommandObjectLog.cpp
index 8d6b1cd..1389ff2 100644
--- a/lldb/source/Commands/CommandObjectLog.cpp
+++ b/lldb/source/Commands/CommandObjectLog.cpp
@@ -101,7 +101,7 @@
 
       switch (short_option) {
       case 'f':
-        log_file.SetFile(option_arg, true);
+        log_file.SetFile(option_arg, true, FileSpec::Style::native);
         break;
       case 't':
         log_options |= LLDB_LOG_OPTION_THREADSAFE;
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp
index a77c415..e4a49e5 100644
--- a/lldb/source/Commands/CommandObjectMemory.cpp
+++ b/lldb/source/Commands/CommandObjectMemory.cpp
@@ -1209,7 +1209,7 @@
 
       switch (short_option) {
       case 'i':
-        m_infile.SetFile(option_value, true);
+        m_infile.SetFile(option_value, true, FileSpec::Style::native);
         if (!m_infile.Exists()) {
           m_infile.Clear();
           error.SetErrorStringWithFormat("input file does not exist: '%s'",
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp
index 0c97903..3c44e8f 100644
--- a/lldb/source/Commands/CommandObjectPlatform.cpp
+++ b/lldb/source/Commands/CommandObjectPlatform.cpp
@@ -1342,32 +1342,32 @@
       } break;
 
       case 'n':
-        match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
-                                                                false);
+        match_info.GetProcessInfo().GetExecutableFile().SetFile(
+            option_arg, false, FileSpec::Style::native);
         match_info.SetNameMatchType(NameMatch::Equals);
         break;
 
       case 'e':
-        match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
-                                                                false);
+        match_info.GetProcessInfo().GetExecutableFile().SetFile(
+            option_arg, false, FileSpec::Style::native);
         match_info.SetNameMatchType(NameMatch::EndsWith);
         break;
 
       case 's':
-        match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
-                                                                false);
+        match_info.GetProcessInfo().GetExecutableFile().SetFile(
+            option_arg, false, FileSpec::Style::native);
         match_info.SetNameMatchType(NameMatch::StartsWith);
         break;
 
       case 'c':
-        match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
-                                                                false);
+        match_info.GetProcessInfo().GetExecutableFile().SetFile(
+            option_arg, false, FileSpec::Style::native);
         match_info.SetNameMatchType(NameMatch::Contains);
         break;
 
       case 'r':
-        match_info.GetProcessInfo().GetExecutableFile().SetFile(option_arg,
-                                                                false);
+        match_info.GetProcessInfo().GetExecutableFile().SetFile(
+            option_arg, false, FileSpec::Style::native);
         match_info.SetNameMatchType(NameMatch::RegularExpression);
         break;
 
@@ -1536,7 +1536,8 @@
         break;
 
       case 'n':
-        attach_info.GetExecutableFile().SetFile(option_arg, false);
+        attach_info.GetExecutableFile().SetFile(option_arg, false,
+                                                FileSpec::Style::native);
         break;
 
       case 'w':
@@ -1585,7 +1586,7 @@
           ProcessInstanceInfoMatch match_info;
           if (partial_name) {
             match_info.GetProcessInfo().GetExecutableFile().SetFile(
-                partial_name, false);
+                partial_name, false, FileSpec::Style::native);
             match_info.SetNameMatchType(NameMatch::StartsWith);
           }
           platform_sp->FindProcesses(match_info, process_infos);
diff --git a/lldb/source/Commands/CommandObjectProcess.cpp b/lldb/source/Commands/CommandObjectProcess.cpp
index 0be1dd1..9deb2e6 100644
--- a/lldb/source/Commands/CommandObjectProcess.cpp
+++ b/lldb/source/Commands/CommandObjectProcess.cpp
@@ -358,7 +358,8 @@
         break;
 
       case 'n':
-        attach_info.GetExecutableFile().SetFile(option_arg, false);
+        attach_info.GetExecutableFile().SetFile(option_arg, false,
+                                                FileSpec::Style::native);
         break;
 
       case 'w':
@@ -411,7 +412,7 @@
           ProcessInstanceInfoMatch match_info;
           if (partial_name) {
             match_info.GetProcessInfo().GetExecutableFile().SetFile(
-                partial_name, false);
+                partial_name, false, FileSpec::Style::native);
             match_info.SetNameMatchType(NameMatch::StartsWith);
           }
           platform_sp->FindProcesses(match_info, process_infos);
@@ -983,7 +984,7 @@
       case 'i':
         do_install = true;
         if (!option_arg.empty())
-          install_path.SetFile(option_arg, false);
+          install_path.SetFile(option_arg, false, FileSpec::Style::native);
         break;
       default:
         error.SetErrorStringWithFormat("invalid short option character '%c'",
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index b383b55..feeecf5 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -258,7 +258,7 @@
       FileSpec file_spec;
 
       if (file_path)
-        file_spec.SetFile(file_path, true);
+        file_spec.SetFile(file_path, true, FileSpec::Style::native);
 
       bool must_set_platform_path = false;
 
@@ -3581,7 +3581,7 @@
         break;
 
       case 'f':
-        m_file.SetFile(option_arg, false);
+        m_file.SetFile(option_arg, false, FileSpec::Style::native);
         m_type = eLookupTypeFileLine;
         break;
 
@@ -4319,7 +4319,8 @@
 
         for (auto &entry : args.entries()) {
           if (!entry.ref.empty()) {
-            module_spec.GetSymbolFileSpec().SetFile(entry.ref, true);
+            module_spec.GetSymbolFileSpec().SetFile(entry.ref, true,
+                                                    FileSpec::Style::native);
             if (file_option_set) {
               module_spec.GetFileSpec() =
                   m_file_option.GetOptionValue().GetCurrentValue();