summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/FileSystem.h2
-rw-r--r--llvm/lib/Support/Unix/Path.inc2
-rw-r--r--llvm/lib/Support/Windows/Path.inc2
3 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/FileSystem.h b/llvm/include/llvm/Support/FileSystem.h
index 1ce5c559d5b..3d780236f12 100644
--- a/llvm/include/llvm/Support/FileSystem.h
+++ b/llvm/include/llvm/Support/FileSystem.h
@@ -658,7 +658,7 @@ std::error_code getUniqueID(const Twine Path, UniqueID &Result);
/// @returns a space_info structure filled with the capacity, free, and
/// available space on the device \a Path is on. A platform specific error_code
/// is returned on error.
-ErrorOr<space_info> disk_space(const Twine Path);
+ErrorOr<space_info> disk_space(const Twine &Path);
/// This class represents a memory mapped file. It is based on
/// boost::iostreams::mapped_file.
diff --git a/llvm/lib/Support/Unix/Path.inc b/llvm/lib/Support/Unix/Path.inc
index f79c4636e5a..3cedf64d4b0 100644
--- a/llvm/lib/Support/Unix/Path.inc
+++ b/llvm/lib/Support/Unix/Path.inc
@@ -208,7 +208,7 @@ UniqueID file_status::getUniqueID() const {
return UniqueID(fs_st_dev, fs_st_ino);
}
-ErrorOr<space_info> disk_space(const Twine Path) {
+ErrorOr<space_info> disk_space(const Twine &Path) {
struct STATVFS Vfs;
if (::STATVFS(Path.str().c_str(), &Vfs))
return std::error_code(errno, std::generic_category());
diff --git a/llvm/lib/Support/Windows/Path.inc b/llvm/lib/Support/Windows/Path.inc
index 72604c0e406..c17c5c61b5a 100644
--- a/llvm/lib/Support/Windows/Path.inc
+++ b/llvm/lib/Support/Windows/Path.inc
@@ -151,7 +151,7 @@ UniqueID file_status::getUniqueID() const {
return UniqueID(VolumeSerialNumber, FileID);
}
-ErrorOr<space_info> disk_space(const Twine Path) {
+ErrorOr<space_info> disk_space(const Twine &Path) {
PULARGE_INTEGER Avail, Total, Free;
if (!::GetDiskFreeSpaceExA(Path.str().c_str(), &Avail, &Total, &Free))
return mapWindowsError(::GetLastError());
OpenPOWER on IntegriCloud