From 0f599acfd685437d1344f82ce363f994b0729a2f Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Wed, 11 Sep 2013 11:23:15 +0000 Subject: [PATCH] Simplify code with the in place path::native. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190515 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/ModuleMap.cpp | 6 ++---- lib/Tooling/Tooling.cpp | 5 ++--- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index b2698b1877..df80a93e4d 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/lib/Lex/ModuleMap.cpp @@ -541,11 +541,9 @@ ModuleMap::inferFrameworkModule(StringRef ModuleName, SmallString<128> SubframeworksDirName = StringRef(FrameworkDir->getName()); llvm::sys::path::append(SubframeworksDirName, "Frameworks"); - SmallString<128> SubframeworksDirNameNative; - llvm::sys::path::native(SubframeworksDirName.str(), - SubframeworksDirNameNative); + llvm::sys::path::native(SubframeworksDirName); for (llvm::sys::fs::directory_iterator - Dir(SubframeworksDirNameNative.str(), EC), DirEnd; + Dir(SubframeworksDirName.str(), EC), DirEnd; Dir != DirEnd && !EC; Dir.increment(EC)) { if (!StringRef(Dir->path()).endswith(".framework")) continue; diff --git a/lib/Tooling/Tooling.cpp b/lib/Tooling/Tooling.cpp index 6f7e7b6c1c..b420ba934d 100644 --- a/lib/Tooling/Tooling.cpp +++ b/lib/Tooling/Tooling.cpp @@ -134,9 +134,8 @@ std::string getAbsolutePath(StringRef File) { llvm::error_code EC = llvm::sys::fs::make_absolute(AbsolutePath); assert(!EC); (void)EC; - SmallString<1024> PathStorage; - llvm::sys::path::native(Twine(AbsolutePath), PathStorage); - return PathStorage.str(); + llvm::sys::path::native(AbsolutePath); + return AbsolutePath.str(); } ToolInvocation::ToolInvocation( -- 2.40.0