ClangTool using single FileManager might confuse two header files with the same relative path in different CWD(current working directory).
As the cache of previously opened FileEntry in FileManager is indexed by the file name, which is fine to be used in single compiler invocation, ClangTool, however, needs to parse more than one compile command, and the CWD is not assured to be consistent, thus the previous cached FileEntry which uses relative path as index would be invalid.
This patch tries to solve it by using a container named ToolFileManager called, which actually stores different FileManager for different CWD.
All file managers stored in ToolFileManager will be invalidated from where using FileManager::setVirtualFileSystem(), because of possibly unsound file status caches.
The unit test is written by Hao Zhang <email@example.com> in his original but unfinished commit.