summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2013-06-26 04:32:59 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2013-06-26 04:32:59 +0000
commit399ab33a37ab0cf08c0e35052820ea2b7e1d2e24 (patch)
treec80329fdc5ecb1e2990e84d3a8b27a7c37a945f7 /clang/lib/Frontend/CompilerInstance.cpp
parentf5e5bc4703391922f255da4316d512330fa95e89 (diff)
downloadbcm5719-llvm-399ab33a37ab0cf08c0e35052820ea2b7e1d2e24.tar.gz
bcm5719-llvm-399ab33a37ab0cf08c0e35052820ea2b7e1d2e24.zip
Remove PathV1.h from CompilerInstance.cpp.
llvm-svn: 184913
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 8011a8b6799..4bd398e9cc0 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -39,7 +39,6 @@
#include "llvm/Support/LockFileManager.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/Path.h"
-#include "llvm/Support/PathV1.h"
#include "llvm/Support/Program.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/Timer.h"
@@ -446,7 +445,7 @@ void CompilerInstance::clearOutputFiles(bool EraseFiles) {
}
}
} else if (!it->Filename.empty() && EraseFiles)
- llvm::sys::Path(it->Filename).eraseFromDisk();
+ llvm::sys::fs::remove(it->Filename);
}
OutputFiles.clear();
@@ -510,9 +509,8 @@ CompilerInstance::createOutputFile(StringRef OutputPath,
} else if (InFile == "-") {
OutFile = "-";
} else if (!Extension.empty()) {
- llvm::sys::Path Path(InFile);
- Path.eraseSuffix();
- Path.appendSuffix(Extension);
+ SmallString<128> Path(InFile);
+ llvm::sys::path::replace_extension(Path, Extension);
OutFile = Path.str();
} else {
OutFile = "-";
@@ -527,7 +525,7 @@ CompilerInstance::createOutputFile(StringRef OutputPath,
// otherwise we want to fail early.
SmallString<256> AbsPath(OutputPath);
llvm::sys::fs::make_absolute(AbsPath);
- llvm::sys::Path OutPath(AbsPath);
+ StringRef OutPath = AbsPath;
bool ParentExists = false;
if (llvm::sys::fs::exists(llvm::sys::path::parent_path(AbsPath.str()),
ParentExists))
@@ -535,7 +533,7 @@ CompilerInstance::createOutputFile(StringRef OutputPath,
bool Exists;
if ((CreateMissingDirectories || ParentExists) &&
((llvm::sys::fs::exists(AbsPath.str(), Exists) || !Exists) ||
- (OutPath.isRegularFile() &&
+ (llvm::sys::fs::is_regular_file(OutPath) &&
llvm::sys::fs::can_write(AbsPath.c_str())))) {
// Create a temporary file.
SmallString<128> TempPath;
@@ -897,7 +895,7 @@ static void compileModule(CompilerInstance &ImportingInstance,
// doesn't make sense for all clients, so clean this up manually.
Instance.clearOutputFiles(/*EraseFiles=*/true);
if (!TempModuleMapFileName.empty())
- llvm::sys::Path(TempModuleMapFileName).eraseFromDisk();
+ llvm::sys::fs::remove(TempModuleMapFileName.str());
// We've rebuilt a module. If we're allowed to generate or update the global
// module index, record that fact in the importing compiler instance.
OpenPOWER on IntegriCloud