[lldb/Host] Pass a StringRef to the FileSpec ctor
authorJonas Devlieghere <jonas@devlieghere.com>
Wed, 29 Apr 2020 02:21:27 +0000 (19:21 -0700)
committerJonas Devlieghere <jonas@devlieghere.com>
Wed, 29 Apr 2020 02:21:58 +0000 (19:21 -0700)
The FileSpec constructor takes a StringRef so there's no point in going
through a C string.

lldb/source/Host/common/Host.cpp

index 8a6af38..a5705c9 100644 (file)
@@ -521,7 +521,7 @@ Status Host::RunShellCommand(const Args &args, const FileSpec &working_dir,
     }
   }
 
-  FileSpec output_file_spec(output_file_path.c_str());
+  FileSpec output_file_spec(output_file_path.str());
   // Set up file descriptors.
   launch_info.AppendSuppressFileAction(STDIN_FILENO, true, false);
   if (output_file_spec)