r185164 - Use the multiple argument form of path::append.
Benjamin Kramer
benny.kra at googlemail.com
Fri Jun 28 09:25:46 PDT 2013
Author: d0k
Date: Fri Jun 28 11:25:46 2013
New Revision: 185164
URL: http://llvm.org/viewvc/llvm-project?rev=185164&view=rev
Log:
Use the multiple argument form of path::append.
Modified:
cfe/trunk/lib/Driver/ToolChains.cpp
cfe/trunk/lib/Frontend/CompilerInvocation.cpp
cfe/trunk/lib/Lex/ModuleMap.cpp
Modified: cfe/trunk/lib/Driver/ToolChains.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/ToolChains.cpp?rev=185164&r1=185163&r2=185164&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/ToolChains.cpp (original)
+++ cfe/trunk/lib/Driver/ToolChains.cpp Fri Jun 28 11:25:46 2013
@@ -222,9 +222,7 @@ void DarwinClang::AddLinkARCArgs(const A
SmallString<128> P(getDriver().ClangExecutable);
llvm::sys::path::remove_filename(P); // 'clang'
llvm::sys::path::remove_filename(P); // 'bin'
- llvm::sys::path::append(P, "lib");
- llvm::sys::path::append(P, "arc");
- llvm::sys::path::append(P, "libarclite_");
+ llvm::sys::path::append(P, "lib", "arc", "libarclite_");
// Mash in the platform.
if (isTargetIOSSimulator())
P += "iphonesimulator";
@@ -242,9 +240,7 @@ void DarwinClang::AddLinkRuntimeLib(cons
const char *DarwinStaticLib,
bool AlwaysLink) const {
SmallString<128> P(getDriver().ResourceDir);
- llvm::sys::path::append(P, "lib");
- llvm::sys::path::append(P, "darwin");
- llvm::sys::path::append(P, DarwinStaticLib);
+ llvm::sys::path::append(P, "lib", "darwin", DarwinStaticLib);
// For now, allow missing resource libraries to support developers who may
// not have compiler-rt checked out or integrated into their build (unless
@@ -539,9 +535,7 @@ void DarwinClang::AddCXXStdlibLibArgs(co
// Check in the sysroot first.
if (const Arg *A = Args.getLastArg(options::OPT_isysroot)) {
SmallString<128> P(A->getValue());
- llvm::sys::path::append(P, "usr");
- llvm::sys::path::append(P, "lib");
- llvm::sys::path::append(P, "libstdc++.dylib");
+ llvm::sys::path::append(P, "usr", "lib", "libstdc++.dylib");
if (!llvm::sys::fs::exists(P.str())) {
llvm::sys::path::remove_filename(P);
@@ -577,8 +571,7 @@ void DarwinClang::AddCCKextLibArgs(const
// only present in the gcc lib dir, which makes it hard to find).
SmallString<128> P(getDriver().ResourceDir);
- llvm::sys::path::append(P, "lib");
- llvm::sys::path::append(P, "darwin");
+ llvm::sys::path::append(P, "lib", "darwin");
// Use the newer cc_kext for iOS ARM after 6.0.
if (!isTargetIPhoneOS() || isTargetIOSSimulator() ||
Modified: cfe/trunk/lib/Frontend/CompilerInvocation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CompilerInvocation.cpp?rev=185164&r1=185163&r2=185164&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CompilerInvocation.cpp (original)
+++ cfe/trunk/lib/Frontend/CompilerInvocation.cpp Fri Jun 28 11:25:46 2013
@@ -852,9 +852,7 @@ std::string CompilerInvocation::GetResou
llvm::sys::path::remove_filename(P); // Remove /bin from foo/bin
// Get foo/lib/clang/<version>/include
- llvm::sys::path::append(P, "lib");
- llvm::sys::path::append(P, "clang");
- llvm::sys::path::append(P, CLANG_VERSION_STRING);
+ llvm::sys::path::append(P, "lib", "clang", CLANG_VERSION_STRING);
}
return P.str();
Modified: cfe/trunk/lib/Lex/ModuleMap.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/ModuleMap.cpp?rev=185164&r1=185163&r2=185164&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/ModuleMap.cpp (original)
+++ cfe/trunk/lib/Lex/ModuleMap.cpp Fri Jun 28 11:25:46 2013
@@ -507,8 +507,7 @@ ModuleMap::inferFrameworkModule(StringRe
// Look for an umbrella header.
SmallString<128> UmbrellaName = StringRef(FrameworkDir->getName());
- llvm::sys::path::append(UmbrellaName, "Headers");
- llvm::sys::path::append(UmbrellaName, ModuleName + ".h");
+ llvm::sys::path::append(UmbrellaName, "Headers", ModuleName + ".h");
const FileEntry *UmbrellaHeader = FileMgr.getFile(UmbrellaName);
// FIXME: If there's no umbrella header, we could probably scan the
@@ -1324,10 +1323,8 @@ static void appendSubframeworkPaths(Modu
return;
// Add Frameworks/Name.framework for each subframework.
- for (unsigned I = Paths.size() - 1; I != 0; --I) {
- llvm::sys::path::append(Path, "Frameworks");
- llvm::sys::path::append(Path, Paths[I-1] + ".framework");
- }
+ for (unsigned I = Paths.size() - 1; I != 0; --I)
+ llvm::sys::path::append(Path, "Frameworks", Paths[I-1] + ".framework");
}
/// \brief Parse a header declaration.
@@ -1378,15 +1375,13 @@ void ModuleMapParser::parseHeaderDecl(MM
appendSubframeworkPaths(ActiveModule, PathName);
// Check whether this file is in the public headers.
- llvm::sys::path::append(PathName, "Headers");
- llvm::sys::path::append(PathName, FileName);
+ llvm::sys::path::append(PathName, "Headers", FileName);
File = SourceMgr.getFileManager().getFile(PathName);
if (!File) {
// Check whether this file is in the private headers.
PathName.resize(PathLength);
- llvm::sys::path::append(PathName, "PrivateHeaders");
- llvm::sys::path::append(PathName, FileName);
+ llvm::sys::path::append(PathName, "PrivateHeaders", FileName);
File = SourceMgr.getFileManager().getFile(PathName);
}
} else {
More information about the cfe-commits
mailing list