From 4f63507d054afab14e759f046db5f42e3b96f6fb Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Sat, 18 Dec 2010 04:13:36 +0000 Subject: Support/PathV1: Deprecate get{Basename,Dirname,Suffix}. llvm-svn: 122141 --- llvm/lib/CompilerDriver/CompilationGraph.cpp | 2 +- llvm/lib/CompilerDriver/Main.cpp | 3 +-- llvm/lib/CompilerDriver/Tool.cpp | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CompilerDriver') diff --git a/llvm/lib/CompilerDriver/CompilationGraph.cpp b/llvm/lib/CompilerDriver/CompilationGraph.cpp index 87a2c4817a8..0e8f5d599c2 100644 --- a/llvm/lib/CompilerDriver/CompilationGraph.cpp +++ b/llvm/lib/CompilerDriver/CompilationGraph.cpp @@ -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()) { diff --git a/llvm/lib/CompilerDriver/Main.cpp b/llvm/lib/CompilerDriver/Main.cpp index 4f8794041b9..88cfdb21230 100644 --- a/llvm/lib/CompilerDriver/Main.cpp +++ b/llvm/lib/CompilerDriver/Main.cpp @@ -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). diff --git a/llvm/lib/CompilerDriver/Tool.cpp b/llvm/lib/CompilerDriver/Tool.cpp index 232bd41c4ba..876759aa72b 100644 --- a/llvm/lib/CompilerDriver/Tool.cpp +++ b/llvm/lib/CompilerDriver/Tool.cpp @@ -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; } -- cgit v1.2.3