aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/FileManager.cpp
diff options
context:
space:
mode:
authorEric Liu <ioeric@google.com>2018-07-11 18:43:07 +0000
committerEric Liu <ioeric@google.com>2018-07-11 18:43:07 +0000
commitb71e6f412ff5bd0bd2c8b69ad47072dbe80a7771 (patch)
tree58e8a83105e0360c87554618cd3076f3fd4bfbbb /clang/lib/Basic/FileManager.cpp
parentedf338856cc6e542e515d7537090ebbbccbdce9f (diff)
downloadllvm-b71e6f412ff5bd0bd2c8b69ad47072dbe80a7771.zip
llvm-b71e6f412ff5bd0bd2c8b69ad47072dbe80a7771.tar.gz
llvm-b71e6f412ff5bd0bd2c8b69ad47072dbe80a7771.tar.bz2
Revert "[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name"
This reverts commit r336807. This breaks users of ClangTool::mapVirtualFile. Will try to investigate a fix. See also the discussion on https://reviews.llvm.org/D48903 llvm-svn: 336831
Diffstat (limited to 'clang/lib/Basic/FileManager.cpp')
-rw-r--r--clang/lib/Basic/FileManager.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Basic/FileManager.cpp b/clang/lib/Basic/FileManager.cpp
index 0a79800..7e2d01c 100644
--- a/clang/lib/Basic/FileManager.cpp
+++ b/clang/lib/Basic/FileManager.cpp
@@ -315,11 +315,9 @@ const FileEntry *FileManager::getFile(StringRef Filename, bool openFile,
UFE.InPCH = Data.InPCH;
UFE.File = std::move(F);
UFE.IsValid = true;
-
- SmallString<128> RealPathName;
- if (!FS->getRealPath(InterndFileName, RealPathName))
- UFE.RealPathName = RealPathName.str();
-
+ if (UFE.File)
+ if (auto RealPathName = UFE.File->getName())
+ UFE.RealPathName = *RealPathName;
return &UFE;
}