[VFS] Implement `RedirectingFileSystem::getRealPath`.
authorVolodymyr Sapsai <vsapsai@apple.com>
Fri, 16 Nov 2018 01:15:54 +0000 (01:15 +0000)
committerVolodymyr Sapsai <vsapsai@apple.com>
Fri, 16 Nov 2018 01:15:54 +0000 (01:15 +0000)
commit7610033f56a9e7b04138774334590f0bdd3f79db
tree26cc17013470ad6388d0ee742d9181c4929dbf5a
parentcac749ac884cfab87a0b2a805b43530c26a627c8
[VFS] Implement `RedirectingFileSystem::getRealPath`.

It fixes the case when Objective-C framework is added as a subframework
through a symlink. When parent framework infers a module map and fails
to detect a symlink, it would add a subframework as a submodule. And
when we parse module map for the subframework, we would encounter an
error like

> error: umbrella for module 'WithSubframework.Foo' already covers this directory

By implementing `getRealPath` "an egregious but useful hack" in
`ModuleMap::inferFrameworkModule` works as expected.

rdar://problem/45821279

Reviewers: bruno, benlangmuir, erik.pilkington

Reviewed By: bruno

Subscribers: hiraditya, dexonsmith, JDevlieghere, cfe-commits, llvm-commits

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

llvm-svn: 347009
llvm/lib/Support/VirtualFileSystem.cpp
llvm/unittests/Support/VirtualFileSystemTest.cpp