[PATCH] D50462: Try building complete AST after a fatal error was emitted if further diagnostics are expected

Volodymyr Sapsai via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 10 14:05:17 PDT 2018


vsapsai added a comment.

Agree that fatal/non-fatal error is too coarse and tooling/IDEs need more details and more control to provide better experience. But I don't think we are in a state to claim that all errors are recoverable (in theory and in current implementation). Instead of continuing on all errors, I prefer to select errors that are important for tooling and improve those first.

Regarding the current patch, I don't like creating coupling between `hasFatalErrorOccurred` and `shouldRecoverAfterFatalErrors`. Looks like after this patch you'll need to call these methods together in many cases. For example, probably `Sema::makeTypoCorrectionConsumer` in

  if (Diags.hasFatalErrorOccurred() || !getLangOpts().SpellChecking ||
      DisableTypoCorrection)
    return nullptr;

should check `shouldRecoverAfterFatalErrors` too.


Repository:
  rC Clang

https://reviews.llvm.org/D50462





More information about the cfe-commits mailing list