aboutsummaryrefslogtreecommitdiff
path: root/lib/Driver/Tools.cpp
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2010-12-18 00:19:12 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2010-12-18 00:19:12 +0000
commit472ccff00cdbcd095c3ba933b9e3f202719f118f (patch)
treea2e0da6cafcc26882139c047fe98a16e752664ec /lib/Driver/Tools.cpp
parentdf344dfb663f99184e734f5d14b5fc9b2725aec2 (diff)
Replace all uses of PathV1::getLast with PathV2::filename.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@122117 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Tools.cpp')
-rw-r--r--lib/Driver/Tools.cpp12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/Driver/Tools.cpp b/lib/Driver/Tools.cpp
index 7674fdcf38..4e23ed6dda 100644
--- a/lib/Driver/Tools.cpp
+++ b/lib/Driver/Tools.cpp
@@ -167,11 +167,9 @@ void Clang::AddPreprocessingOptions(const Driver &D,
// 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::getCC1Name(types::ID Type) const {
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,