From 92e1b62d45aa5a3cbd67eaf5903165d7d8efeada Mon Sep 17 00:00:00 2001 From: Yaron Keren Date: Wed, 18 Mar 2015 10:17:07 +0000 Subject: Remove many superfluous SmallString::str() calls. Now that SmallString is a first-class citizen, most SmallString::str() calls are not required. This patch removes a whole bunch of them, yet there are lots more. There are two use cases where str() is really needed: 1) To use one of StringRef member functions which is not available in SmallString. 2) To convert to std::string, as StringRef implicitly converts while SmallString do not. We may wish to change this, but it may introduce ambiguity. llvm-svn: 232622 --- clang/lib/Frontend/ModuleDependencyCollector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'clang/lib/Frontend/ModuleDependencyCollector.cpp') diff --git a/clang/lib/Frontend/ModuleDependencyCollector.cpp b/clang/lib/Frontend/ModuleDependencyCollector.cpp index 62865e984f6..67852dc0203 100644 --- a/clang/lib/Frontend/ModuleDependencyCollector.cpp +++ b/clang/lib/Frontend/ModuleDependencyCollector.cpp @@ -77,10 +77,10 @@ std::error_code ModuleDependencyListener::copyToRoot(StringRef Src) { if (std::error_code EC = fs::create_directories(path::parent_path(Dest), /*IgnoreExisting=*/true)) return EC; - if (std::error_code EC = fs::copy_file(AbsoluteSrc.str(), Dest.str())) + if (std::error_code EC = fs::copy_file(AbsoluteSrc, Dest)) return EC; // Use the absolute path under the root for the file mapping. - Collector.addFileMapping(AbsoluteSrc.str(), Dest.str()); + Collector.addFileMapping(AbsoluteSrc, Dest); return std::error_code(); } -- cgit v1.2.3