sepavloff added a comment.

Thank you!

I put updated fix here. If it is OK, I'll commit it tomorrow.



================
Comment at: lib/Tooling/CompilationDatabase.cpp:292
+  if (Argc == 0) {
+    ErrorMsg = "error: no arguments specified\n";
+    return nullptr;
----------------
alexfh wrote:
> 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).
What if error message contains a prefix that indicates if this is error or 
warning? Errors could be printed and warnings ignored in 
`CommonOptionsParser.cpp:122`. Such solution would allow clients to investigate 
failures in more details.



https://reviews.llvm.org/D33272



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to