[PATCH] D33272: Method loadFromCommandLine should be able to report errors

Alexander Kornienko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon May 22 06:27:25 PDT 2017


alexfh accepted this revision.
alexfh added a comment.
This revision is now accepted and ready to land.

Thank you! This looks good with one nit (see the inline comment).



================
Comment at: lib/Tooling/CompilationDatabase.cpp:292
+  if (Argc == 0) {
+    ErrorMsg = "error: no arguments specified\n";
+    return nullptr;
----------------
The lack of the arguments (or the `--` below) shouldn't be treated as an error (at least an error that is worth showing to the user). The caller will just move on to trying the next kind of a compilation database. The only actual errors we can get here may be coming from `stripPositionalArgs`.

The caller should be modified accordingly (i.e. not output anything when both the return value is `nullptr` and `ErrorMsg` is empty).


https://reviews.llvm.org/D33272





More information about the cfe-commits mailing list