]> granicus.if.org Git - clang/commit
[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested...
authorSimon Marchi <simon.marchi@ericsson.com>
Mon, 6 Aug 2018 21:48:20 +0000 (21:48 +0000)
committerSimon Marchi <simon.marchi@ericsson.com>
Mon, 6 Aug 2018 21:48:20 +0000 (21:48 +0000)
commit89aa7f45a1f728144935289d4ce69d8522999de0
tree905bcca116f58cb3a85a79b1f1a95b52e7aeb4c6
parent28b93f39ebc37be83c21fb3114075a4664232af2
[VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

Summary:
InMemoryFileSystem::status behaves differently than
RealFileSystem::status.  The Name contained in the Status returned by
RealFileSystem::status will be the path as requested by the caller,
whereas InMemoryFileSystem::status returns the normalized path.

For example, when requested the status for "../src/first.h",
RealFileSystem returns a Status with "../src/first.h" as the Name.
InMemoryFileSystem returns "/absolute/path/to/src/first.h".

The reason for this change is that I want to make a unit test in the
clangd testsuite (where we use an InMemoryFileSystem) to reproduce a
bug I get with the clangd program (where a RealFileSystem is used).
This difference in behavior "hides" the bug in the unit test version.

An indirect impact of this change is that a -Wnonportable-include-path
warning is now emitted in test PCH/case-insensitive-include.c.  This is
because the real path of the included file (with the wrong case) was not
available previously, whereas it is now.

Reviewers: malaperle, ilya-biryukov, bkramer

Reviewed By: ilya-biryukov

Subscribers: eric_niebler, malaperle, omtcyfz, hokein, bkramer, ilya-biryukov, ioeric, cfe-commits

Differential Revision: https://reviews.llvm.org/D48903

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339063 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Basic/FileManager.cpp
lib/Basic/VirtualFileSystem.cpp
test/PCH/case-insensitive-include.c
unittests/Basic/VirtualFileSystemTest.cpp
unittests/Driver/ToolChainTest.cpp