r190515 - Simplify code with the in place path::native. No functionality change.

Benjamin Kramer benny.kra at googlemail.com
Wed Sep 11 04:23:15 PDT 2013


Author: d0k
Date: Wed Sep 11 06:23:15 2013
New Revision: 190515

URL: http://llvm.org/viewvc/llvm-project?rev=190515&view=rev
Log:
Simplify code with the in place path::native. No functionality change.

Modified:
    cfe/trunk/lib/Lex/ModuleMap.cpp
    cfe/trunk/lib/Tooling/Tooling.cpp

Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=190515&r1=190514&r2=190515&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Wed Sep 11 06:23:15 2013
@@ -541,11 +541,9 @@ ModuleMap::inferFrameworkModule(StringRe
   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;

Modified: cfe/trunk/lib/Tooling/Tooling.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/Tooling.cpp?rev=190515&r1=190514&r2=190515&view=diff
==============================================================================
--- cfe/trunk/lib/Tooling/Tooling.cpp (original)
+++ cfe/trunk/lib/Tooling/Tooling.cpp Wed Sep 11 06:23:15 2013
@@ -134,9 +134,8 @@ std::string getAbsolutePath(StringRef Fi
   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(





More information about the cfe-commits mailing list