diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 12:57:14 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 12:57:14 +0000 |
commit | cbb70ce070d220642b038ea101d9c0f9fbf860d6 (patch) | |
tree | d2b61ce94e654cb01a254d2195259db5f9cc3f3c /lib/CompilerDriver/Main.cpp | |
parent | 4ace901e87dac5bbbac78ed325e75462e48e386e (diff) | |
download | FreeBSD-src-cbb70ce070d220642b038ea101d9c0f9fbf860d6.zip FreeBSD-src-cbb70ce070d220642b038ea101d9c0f9fbf860d6.tar.gz |
Vendor import of llvm trunk r126079:
http://llvm.org/svn/llvm-project/llvm/trunk@126079
Diffstat (limited to 'lib/CompilerDriver/Main.cpp')
-rw-r--r-- | lib/CompilerDriver/Main.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/CompilerDriver/Main.cpp b/lib/CompilerDriver/Main.cpp index 0a6613a..7120027 100644 --- a/lib/CompilerDriver/Main.cpp +++ b/lib/CompilerDriver/Main.cpp @@ -16,8 +16,9 @@ #include "llvm/CompilerDriver/CompilationGraph.h" #include "llvm/CompilerDriver/Error.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/raw_ostream.h" -#include "llvm/System/Path.h" +#include "llvm/Support/Path.h" #include <sstream> #include <string> @@ -43,15 +44,15 @@ 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). return 0; } - if (!tempDir.exists()) { + bool Exists; + if (llvm::sys::fs::exists(tempDir.str(), Exists) || !Exists) { std::string ErrMsg; if (tempDir.createDirectoryOnDisk(true, &ErrMsg)) { PrintError(ErrMsg); |