diff options
| author | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-21 16:45:57 +0000 |
|---|---|---|
| committer | Michael J. Spencer <bigcheesegs@gmail.com> | 2010-12-21 16:45:57 +0000 |
| commit | 740857fa10e0e70b2145acb7164b9b526da89a0a (patch) | |
| tree | a1435900132a2617e54d6667c4c1ac0dc9538171 /clang/lib/Frontend | |
| parent | bc721825e8503fcb6fdcdb4ba900047b1d45b3ec (diff) | |
| download | bcm5719-llvm-740857fa10e0e70b2145acb7164b9b526da89a0a.tar.gz bcm5719-llvm-740857fa10e0e70b2145acb7164b9b526da89a0a.zip | |
Replace all uses of PathV1::makeAbsolute with PathV2::fs::make_absolute.
llvm-svn: 122340
Diffstat (limited to 'clang/lib/Frontend')
| -rw-r--r-- | clang/lib/Frontend/CacheTokens.cpp | 5 | ||||
| -rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CacheTokens.cpp b/clang/lib/Frontend/CacheTokens.cpp index cd5723aa82c..aae572cb980 100644 --- a/clang/lib/Frontend/CacheTokens.cpp +++ b/clang/lib/Frontend/CacheTokens.cpp @@ -23,6 +23,7 @@ #include "clang/Lex/Preprocessor.h" #include "llvm/ADT/StringExtras.h" #include "llvm/ADT/StringMap.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/raw_ostream.h" #include "llvm/Support/Path.h" @@ -540,9 +541,9 @@ void clang::CacheTokens(Preprocessor &PP, llvm::raw_fd_ostream* OS) { // Get the name of the main file. const SourceManager &SrcMgr = PP.getSourceManager(); const FileEntry *MainFile = SrcMgr.getFileEntryForID(SrcMgr.getMainFileID()); - llvm::sys::Path MainFilePath(MainFile->getName()); + llvm::SmallString<128> MainFilePath(MainFile->getName()); - MainFilePath.makeAbsolute(); + llvm::sys::fs::make_absolute(MainFilePath); // Create the PTHWriter. PTHWriter PW(*OS, PP); diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index 1f155560228..d0111a5d26a 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/lib/Frontend/InitPreprocessor.cpp @@ -22,6 +22,7 @@ #include "clang/Basic/FileManager.h" #include "clang/Basic/SourceManager.h" #include "llvm/ADT/APFloat.h" +#include "llvm/Support/FileSystem.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/Path.h" using namespace clang; @@ -55,9 +56,10 @@ std::string clang::NormalizeDashIncludePath(llvm::StringRef File) { // it has not file entry. For now, workaround this by using an // absolute path if we find the file here, and otherwise letting // header search handle it. - llvm::sys::Path Path(File); - Path.makeAbsolute(); - if (!Path.exists()) + llvm::SmallString<128> Path(File); + llvm::sys::fs::make_absolute(Path); + bool exists; + if (llvm::sys::fs::exists(Path.str(), exists) || !exists) Path = File; return Lexer::Stringify(Path.str()); |

