[cfe-commits] r122117 - in /cfe/trunk: lib/Checker/HTMLDiagnostics.cpp lib/Driver/Driver.cpp lib/Driver/Tools.cpp tools/driver/driver.cpp tools/libclang/CIndexUSRs.cpp
Michael J. Spencer
bigcheesegs at gmail.com
Fri Dec 17 16:19:12 PST 2010
Author: mspencer
Date: Fri Dec 17 18:19:12 2010
New Revision: 122117
URL: http://llvm.org/viewvc/llvm-project?rev=122117&view=rev
Log:
Replace all uses of PathV1::getLast with PathV2::filename.
Modified:
cfe/trunk/lib/Checker/HTMLDiagnostics.cpp
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/lib/Driver/Tools.cpp
cfe/trunk/tools/driver/driver.cpp
cfe/trunk/tools/libclang/CIndexUSRs.cpp
Modified: cfe/trunk/lib/Checker/HTMLDiagnostics.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Checker/HTMLDiagnostics.cpp?rev=122117&r1=122116&r2=122117&view=diff
==============================================================================
--- cfe/trunk/lib/Checker/HTMLDiagnostics.cpp (original)
+++ cfe/trunk/lib/Checker/HTMLDiagnostics.cpp Fri Dec 17 18:19:12 2010
@@ -300,7 +300,7 @@
}
if (FilesMade)
- FilesMade->push_back(H.getLast());
+ FilesMade->push_back(llvm::sys::path::filename(H.str()));
// Emit the HTML to disk.
for (RewriteBuffer::iterator I = Buf->begin(), E = Buf->end(); I!=E; ++I)
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=122117&r1=122116&r2=122117&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Dec 17 18:19:12 2010
@@ -1195,8 +1195,8 @@
return C.addTempFile(C.getArgs().MakeArgString(TmpName.c_str()));
}
- llvm::sys::Path BasePath(BaseInput);
- std::string BaseName(BasePath.getLast());
+ llvm::SmallString<128> BasePath(BaseInput);
+ llvm::StringRef BaseName = llvm::sys::path::filename(BasePath);
// Determine what the derived output name should be.
const char *NamedOutput;
@@ -1217,11 +1217,11 @@
// As an annoying special case, PCH generation doesn't strip the pathname.
if (JA.getType() == types::TY_PCH) {
- BasePath.eraseComponent();
- if (BasePath.isEmpty())
+ llvm::sys::path::remove_filename(BasePath);
+ if (BasePath.empty())
BasePath = NamedOutput;
else
- BasePath.appendComponent(NamedOutput);
+ llvm::sys::path::append(BasePath, NamedOutput);
return C.addResultFile(C.getArgs().MakeArgString(BasePath.c_str()));
} else {
return C.addResultFile(NamedOutput);
Modified: cfe/trunk/lib/Driver/Tools.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Tools.cpp?rev=122117&r1=122116&r2=122117&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Tools.cpp (original)
+++ cfe/trunk/lib/Driver/Tools.cpp Fri Dec 17 18:19:12 2010
@@ -167,11 +167,9 @@
// Otherwise derive from the base input.
//
// FIXME: This should use the computed output file location.
- llvm::sys::Path P(Inputs[0].getBaseInput());
-
- P.eraseSuffix();
- P.appendSuffix("o");
- DepTarget = Args.MakeArgString(P.getLast());
+ llvm::SmallString<128> P(Inputs[0].getBaseInput());
+ llvm::sys::path::replace_extension(P, "o");
+ DepTarget = Args.MakeArgString(llvm::sys::path::filename(P));
}
CmdArgs.push_back("-MT");
@@ -1926,8 +1924,8 @@
const char *darwin::CC1::getBaseInputName(const ArgList &Args,
const InputInfoList &Inputs) {
- llvm::sys::Path P(Inputs[0].getBaseInput());
- return Args.MakeArgString(P.getLast());
+ return Args.MakeArgString(
+ llvm::sys::path::filename(Inputs[0].getBaseInput()));
}
const char *darwin::CC1::getBaseInputStem(const ArgList &Args,
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=122117&r1=122116&r2=122117&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Dec 17 18:19:12 2010
@@ -312,9 +312,9 @@
llvm::sys::Path InstalledPath(argv[0]);
// Do a PATH lookup, if there are no directory components.
- if (InstalledPath.getLast() == InstalledPath.str()) {
- llvm::sys::Path Tmp =
- llvm::sys::Program::FindProgramByName(InstalledPath.getLast());
+ if (llvm::sys::path::filename(InstalledPath.str()) == InstalledPath.str()) {
+ llvm::sys::Path Tmp = llvm::sys::Program::FindProgramByName(
+ llvm::sys::path::filename(InstalledPath.str()));
if (!Tmp.empty())
InstalledPath = Tmp;
}
Modified: cfe/trunk/tools/libclang/CIndexUSRs.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndexUSRs.cpp?rev=122117&r1=122116&r2=122117&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndexUSRs.cpp (original)
+++ cfe/trunk/tools/libclang/CIndexUSRs.cpp Fri Dec 17 18:19:12 2010
@@ -488,8 +488,7 @@
const std::pair<FileID, unsigned> &Decomposed = SM.getDecomposedLoc(L);
const FileEntry *FE = SM.getFileEntryForID(Decomposed.first);
if (FE) {
- llvm::sys::Path P(FE->getName());
- Out << P.getLast();
+ Out << llvm::sys::path::filename(FE->getName());
}
else {
// This case really isn't interesting.
More information about the cfe-commits
mailing list