[PATCH] D66731: [Driver] Add an option for createInvocationFromCommandLine to recover on errors

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 26 03:17:13 PDT 2019


gribozavr added a comment.

It does seem reasonable for Clangd to recover when it sees unknown command line flags (after all, in compiler_commands.json we can see command line flags from past and future versions of Clang, GCC and other compilers -- whatever the build system decided to write there). However I have two requests:

- In the doc comment for `CompilerInvocation::CreateFromArgs`, could you add a note that it does a best effort to provide a CompilerInvocation even if it returns false? Right now the doc comment reads like there are no guarantees at all if it returns false.

- (can be a separate patch) Could we produce a diagnostic in the affected TU notifying the user that the compiler commands could not be parsed and we did our best to recover, but it may be completely wrong?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66731/new/

https://reviews.llvm.org/D66731





More information about the cfe-commits mailing list