@@ -325,14 +325,14 @@ RealFileSystem::openFileForRead(const Twine &Name) {
325325
326326llvm::ErrorOr<std::string> RealFileSystem::getCurrentWorkingDirectory () const {
327327 if (WD && *WD)
328- return std::string (WD->get ().Specified . str () );
328+ return std::string (WD->get ().Specified );
329329 if (WD)
330330 return WD->getError ();
331331
332332 SmallString<128 > Dir;
333333 if (std::error_code EC = llvm::sys::fs::current_path (Dir))
334334 return EC;
335- return std::string (Dir. str () );
335+ return std::string (Dir);
336336}
337337
338338std::error_code RealFileSystem::setCurrentWorkingDirectory (const Twine &Path) {
@@ -1091,7 +1091,7 @@ class InMemoryFileSystem::DirIterator : public llvm::vfs::detail::DirIterImpl {
10911091 }
10921092 break ;
10931093 }
1094- CurrentEntry = directory_entry (std::string (Path. str () ), Type);
1094+ CurrentEntry = directory_entry (std::string (Path), Type);
10951095 } else {
10961096 // When we're at the end, make CurrentEntry invalid and DirIterImpl will
10971097 // do the rest.
@@ -1146,7 +1146,7 @@ std::error_code InMemoryFileSystem::setCurrentWorkingDirectory(const Twine &P) {
11461146 llvm::sys::path::remove_dots (Path, /* remove_dot_dot=*/ true );
11471147
11481148 if (!Path.empty ())
1149- WorkingDirectory = std::string (Path. str () );
1149+ WorkingDirectory = std::string (Path);
11501150 return {};
11511151}
11521152
@@ -1252,7 +1252,7 @@ class llvm::vfs::RedirectingFSDirIterImpl
12521252 Type = sys::fs::file_type::regular_file;
12531253 break ;
12541254 }
1255- CurrentEntry = directory_entry (std::string (PathStr. str () ), Type);
1255+ CurrentEntry = directory_entry (std::string (PathStr), Type);
12561256 } else {
12571257 CurrentEntry = directory_entry ();
12581258 }
@@ -1328,7 +1328,7 @@ RedirectingFileSystem::setCurrentWorkingDirectory(const Twine &Path) {
13281328 Path.toVector (AbsolutePath);
13291329 if (std::error_code EC = makeAbsolute (AbsolutePath))
13301330 return EC;
1331- WorkingDirectory = std::string (AbsolutePath. str () );
1331+ WorkingDirectory = std::string (AbsolutePath);
13321332 return {};
13331333}
13341334
0 commit comments