diff options
author | Ben Langmuir <blangmuir@apple.com> | 2018-03-23 17:37:27 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2018-03-23 17:37:27 +0000 |
commit | 005c2e57a658bc18529de5027d52619dc4a2a72c (patch) | |
tree | 486d6d2a2869ab09f3065e360b8c7ba0689c5a7e /clang/lib/Frontend/CompilerInstance.cpp | |
parent | a237866faff488edf9c822b38e16af3de13c0e90 (diff) | |
download | bcm5719-llvm-005c2e57a658bc18529de5027d52619dc4a2a72c.tar.gz bcm5719-llvm-005c2e57a658bc18529de5027d52619dc4a2a72c.zip |
[vfs] Don't bail out after a missing -ivfsoverlay file
This make -ivfsoverlay behave more like other fatal errors (e.g. missing
-include file) by skipping the missing file instead of bailing out of
the whole compilation. This makes it possible for libclang to still
provide some functionallity as well as to correctly produce the fatal
error diagnostic (previously we lost the diagnostic in libclang since
there was no TU to tie it to).
rdar://33385423
llvm-svn: 328337
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index bb8b8572fa7..a03e5df63aa 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -302,11 +302,9 @@ CompilerInstance::createDiagnostics(DiagnosticOptions *Opts, FileManager *CompilerInstance::createFileManager() { if (!hasVirtualFileSystem()) { - if (IntrusiveRefCntPtr<vfs::FileSystem> VFS = - createVFSFromCompilerInvocation(getInvocation(), getDiagnostics())) - setVirtualFileSystem(VFS); - else - return nullptr; + IntrusiveRefCntPtr<vfs::FileSystem> VFS = + createVFSFromCompilerInvocation(getInvocation(), getDiagnostics()); + setVirtualFileSystem(VFS); } FileMgr = new FileManager(getFileSystemOpts(), VirtualFileSystem); return FileMgr.get(); |