diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2019-02-23 23:48:47 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2019-02-23 23:48:47 +0000 |
commit | e7b9464943e1a1c590c238008b4b30fd2a376b10 (patch) | |
tree | ae3c61a15341eea62d3c8b1b66eb3c86f1ff258c /llvm/include | |
parent | dc185522fbdec75490cacfaa15966c4a2a7505d2 (diff) | |
download | bcm5719-llvm-e7b9464943e1a1c590c238008b4b30fd2a376b10.tar.gz bcm5719-llvm-e7b9464943e1a1c590c238008b4b30fd2a376b10.zip |
VFS: Avoid some unnecessary std::string copies
Thread Twine a little deeper through the VFS to avoid unnecessarily
constructing the same std::string twice in a parameter sequence:
Twine -> std::string -> StringRef -> std::string
Changing a few parameters from StringRef to Twine avoids the early call
to `Twine::str()`.
llvm-svn: 354739
Diffstat (limited to 'llvm/include')
-rw-r--r-- | llvm/include/llvm/Support/VirtualFileSystem.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/include/llvm/Support/VirtualFileSystem.h b/llvm/include/llvm/Support/VirtualFileSystem.h index 7c57dd3a31e..0bb574e1b12 100644 --- a/llvm/include/llvm/Support/VirtualFileSystem.h +++ b/llvm/include/llvm/Support/VirtualFileSystem.h @@ -58,15 +58,15 @@ public: Status() = default; Status(const llvm::sys::fs::file_status &Status); - Status(StringRef Name, llvm::sys::fs::UniqueID UID, + Status(const Twine &Name, llvm::sys::fs::UniqueID UID, llvm::sys::TimePoint<> MTime, uint32_t User, uint32_t Group, uint64_t Size, llvm::sys::fs::file_type Type, llvm::sys::fs::perms Perms); /// Get a copy of a Status with a different name. - static Status copyWithNewName(const Status &In, StringRef NewName); + static Status copyWithNewName(const Status &In, const Twine &NewName); static Status copyWithNewName(const llvm::sys::fs::file_status &In, - StringRef NewName); + const Twine &NewName); /// Returns the name that should be used for this file or directory. StringRef getName() const { return Name; } |