]> granicus.if.org Git - clang/commit
Use the VFS from the CompilerInvocation by default
authorRaphael Isemann <teemperor@gmail.com>
Tue, 12 Sep 2017 16:54:53 +0000 (16:54 +0000)
committerRaphael Isemann <teemperor@gmail.com>
Tue, 12 Sep 2017 16:54:53 +0000 (16:54 +0000)
commit7b30399eefaa0491f80963acf3ba44468e5c71c2
tree380334e81e6db9badfac557781cb1f5bdaa7ca4d
parent995f76732604b0527735026439ea396312e3de38
Use the VFS from the CompilerInvocation by default

Summary:
The CompilerInstance should create its default VFS from its CompilerInvocation. Right now the
user has to manually create the VFS before creating the FileManager even though
`-ivfsoverlay file.yaml` was passed via the CompilerInvocation (which is exactly how we worked
around this issue in `FrontendAction.cpp` so far).

This patch uses the invocation's VFS by default and also tests this behavior now from the
point of view of a program that uses the clang API.

Reviewers: benlangmuir, v.g.vassilev

Reviewed By: v.g.vassilev

Subscribers: mgorny, cfe-commits, v.g.vassilev

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313049 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Frontend/CompilerInstance.h
lib/Frontend/CompilerInstance.cpp
lib/Frontend/FrontendAction.cpp
unittests/Frontend/CMakeLists.txt
unittests/Frontend/CompilerInstanceTest.cpp [new file with mode: 0644]