From f6efe58d4585e7fd0b20bac44c3bc027502da121 Mon Sep 17 00:00:00 2001 From: "Michael J. Spencer" Date: Mon, 10 Jan 2011 02:34:13 +0000 Subject: Replace all uses of PathV1::exists with PathV2::fs::exists. llvm-svn: 123150 --- clang/lib/Frontend/CompilerInstance.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'clang/lib/Frontend/CompilerInstance.cpp') diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index d97e8c77277..901f8fa9276 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -28,6 +28,7 @@ #include "clang/Serialization/ASTReader.h" #include "clang/Sema/CodeCompleteConsumer.h" #include "llvm/LLVMContext.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/ADT/Statistic.h" @@ -433,7 +434,8 @@ CompilerInstance::createOutputFile(llvm::StringRef OutputPath, llvm::sys::Path OutPath(OutFile); // Only create the temporary if we can actually write to OutPath, otherwise // we want to fail early. - if (!OutPath.exists() || + bool Exists; + if ((llvm::sys::fs::exists(OutPath.str(), Exists) || !Exists) || (OutPath.isRegularFile() && OutPath.canWrite())) { // Create a temporary file. llvm::sys::Path TempPath(OutFile); -- cgit v1.2.3