[Lldb-commits] [lldb] 6e69338 - [lldb/Host] Pass a StringRef to the FileSpec ctor

Jonas Devlieghere via lldb-commits lldb-commits at lists.llvm.org
Tue Apr 28 19:22:11 PDT 2020


Author: Jonas Devlieghere
Date: 2020-04-28T19:21:58-07:00
New Revision: 6e693386afedab5237b42679d94ca6c72684621d

URL: https://github.com/llvm/llvm-project/commit/6e693386afedab5237b42679d94ca6c72684621d
DIFF: https://github.com/llvm/llvm-project/commit/6e693386afedab5237b42679d94ca6c72684621d.diff

LOG: [lldb/Host] Pass a StringRef to the FileSpec ctor

The FileSpec constructor takes a StringRef so there's no point in going
through a C string.

Added: 
    

Modified: 
    lldb/source/Host/common/Host.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Host/common/Host.cpp b/lldb/source/Host/common/Host.cpp
index 8a6af3881a0f..a5705c92afec 100644
--- a/lldb/source/Host/common/Host.cpp
+++ b/lldb/source/Host/common/Host.cpp
@@ -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)


        


More information about the lldb-commits mailing list