Support/PathV1: Deprecate get{Basename,Dirname,Suffix}.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122141 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael J. Spencer
2010-12-18 04:13:36 +00:00
parent f705a7ed27
commit b9c767cce5
7 changed files with 17 additions and 19 deletions

View File

@ -32,7 +32,7 @@ using namespace llvmc;
namespace llvmc {
const std::string* LanguageMap::GetLanguage(const sys::Path& File) const {
StringRef suf = File.getSuffix();
StringRef suf = sys::path::extension(File.str());
LanguageMap::const_iterator Lang =
this->find(suf.empty() ? "*empty*" : suf);
if (Lang == this->end()) {

View File

@ -43,8 +43,7 @@ namespace {
return 0;
}
else if (SaveTemps == SaveTempsEnum::Obj && !OutputFilename.empty()) {
tempDir = OutputFilename;
tempDir = tempDir.getDirname();
tempDir = sys::path::parent_path(OutputFilename);
}
else {
// SaveTemps == Cwd --> use current dir (leave tempDir empty).

View File

@ -61,7 +61,7 @@ sys::Path Tool::OutFilename(const sys::Path& In,
Out.appendSuffix(OutputSuffix);
}
else {
Out.set(In.getBasename());
Out.set(sys::path::stem(In.str()));
Out.appendSuffix(OutputSuffix);
}
}
@ -69,7 +69,7 @@ sys::Path Tool::OutFilename(const sys::Path& In,
if (IsJoin())
Out = MakeTempFile(TempDir, "tmp", OutputSuffix);
else
Out = MakeTempFile(TempDir, In.getBasename(), OutputSuffix);
Out = MakeTempFile(TempDir, sys::path::stem(In.str()), OutputSuffix);
}
return Out;
}