diff options
author | Alex Lorenz <arphaman@gmail.com> | 2019-08-31 01:26:04 +0000 |
---|---|---|
committer | Alex Lorenz <arphaman@gmail.com> | 2019-08-31 01:26:04 +0000 |
commit | bd94a6e73a36a4c70b09eb4d6a689e03c2d9a010 (patch) | |
tree | f357fd64281d4edf8e45983474cfa594ddbe3e0f /unittests/Lex | |
parent | ad57483a9ff0c36ca642528b81fbb05641e5d7f1 (diff) | |
download | clang-bd94a6e73a36a4c70b09eb4d6a689e03c2d9a010.tar.gz |
Introduce a DirectoryEntryRef that stores both a reference and an
accessed name to the directory entry
This commit introduces a parallel API that returns a DirectoryEntryRef
to the FileManager, similar to the parallel FileEntryRef API. All
uses will have to be update in follow-up patches. The immediate use of the new API in this
patch fixes the issue where a file manager was reused in clang-scan-deps,
but reported an different file path whenever a framework lookup was done through a symlink.
Differential Revision: https://reviews.llvm.org/D67026
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@370562 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'unittests/Lex')
-rw-r--r-- | unittests/Lex/HeaderSearchTest.cpp | 2 | ||||
-rw-r--r-- | unittests/Lex/PPCallbacksTest.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/unittests/Lex/HeaderSearchTest.cpp b/unittests/Lex/HeaderSearchTest.cpp index b013cac85f..abd392477f 100644 --- a/unittests/Lex/HeaderSearchTest.cpp +++ b/unittests/Lex/HeaderSearchTest.cpp @@ -39,7 +39,7 @@ protected: void addSearchDir(llvm::StringRef Dir) { VFS->addFile(Dir, 0, llvm::MemoryBuffer::getMemBuffer(""), /*User=*/None, /*Group=*/None, llvm::sys::fs::file_type::directory_file); - auto DE = FileMgr.getDirectory(Dir); + auto DE = FileMgr.getOptionalDirectoryRef(Dir); assert(DE); auto DL = DirectoryLookup(*DE, SrcMgr::C_User, /*isFramework=*/false); Search.AddSearchPath(DL, /*isAngled=*/false); diff --git a/unittests/Lex/PPCallbacksTest.cpp b/unittests/Lex/PPCallbacksTest.cpp index 5de17103d9..5581f9fb82 100644 --- a/unittests/Lex/PPCallbacksTest.cpp +++ b/unittests/Lex/PPCallbacksTest.cpp @@ -145,7 +145,7 @@ protected: // Add header's parent path to search path. StringRef SearchPath = llvm::sys::path::parent_path(HeaderPath); - auto DE = FileMgr.getDirectory(SearchPath); + auto DE = FileMgr.getOptionalDirectoryRef(SearchPath); DirectoryLookup DL(*DE, SrcMgr::C_User, false); HeaderInfo.AddSearchPath(DL, IsSystemHeader); } |