From 005c2e57a658bc18529de5027d52619dc4a2a72c Mon Sep 17 00:00:00 2001 From: Ben Langmuir Date: Fri, 23 Mar 2018 17:37:27 +0000 Subject: [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 --- clang/lib/Frontend/CompilerInvocation.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index c9d251f..acbe650 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -3073,16 +3073,15 @@ createVFSFromCompilerInvocation(const CompilerInvocation &CI, BaseFS->getBufferForFile(File); if (!Buffer) { Diags.Report(diag::err_missing_vfs_overlay_file) << File; - return IntrusiveRefCntPtr(); + continue; } IntrusiveRefCntPtr FS = vfs::getVFSFromYAML( std::move(Buffer.get()), /*DiagHandler*/ nullptr, File); - if (!FS.get()) { + if (FS) + Overlay->pushOverlay(FS); + else Diags.Report(diag::err_invalid_vfs_overlay) << File; - return IntrusiveRefCntPtr(); - } - Overlay->pushOverlay(FS); } return Overlay; } -- cgit v1.1