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

2017-05-24 Thread Serge Pavlov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL303741: Method loadFromCommandLine should be able to report errors (authored by sepavloff). Changed prior to commit: https://reviews.llvm.org/D33272?vs=99919&id=100069#toc Repository: rL LLVM https:

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

2017-05-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. Thanks, LG! https://reviews.llvm.org/D33272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-05-23 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99919. sepavloff added a comment. Updated patch https://reviews.llvm.org/D33272 Files: include/clang/Tooling/CompilationDatabase.h lib/Frontend/CreateInvocationFromCommandLine.cpp lib/Tooling/CommonOptionsParser.cpp lib/Tooling/CompilationDatabase

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

2017-05-23 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. I see your reasons. Updated the patch accordingly. Thank you! https://reviews.llvm.org/D33272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-05-23 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: lib/Tooling/CommonOptionsParser.cpp:122 + FixedCompilationDatabase::loadFromCommandLine(argc, argv, ErrorMessage); + if (!Compilations && StringRef(ErrorMessage).startswith("error")) +llvm::errs() << ErrorMessage; --

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

2017-05-22 Thread Serge Pavlov via Phabricator via cfe-commits
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: >

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

2017-05-22 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99786. sepavloff marked an inline comment as done. sepavloff added a comment. Addressed reviewer's notes. https://reviews.llvm.org/D33272 Files: include/clang/Tooling/CompilationDatabase.h lib/Frontend/CreateInvocationFromCommandLine.cpp lib/Tooling

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

2017-05-22 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added inline comments. Comment at: lib/Tooling/CompilationDatabase.cpp:164 +// to user. +} else if (DiagLevel >= DiagnosticsEngine::Error) + Other.HandleDiagnostic(DiagLevel, Info); Another couple of nits: 1. the comment below would probably b

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

2017-05-22 Thread Alexander Kornienko via Phabricator via cfe-commits
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

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

2017-05-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff updated this revision to Diff 99600. sepavloff added a comment. Change loadFromCommandLine so that it returns std::unique_ptr as methods of CompilationDatabase does https://reviews.llvm.org/D33272 Files: include/clang/Tooling/CompilationDatabase.h lib/Frontend/CreateInvocationFro

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

2017-05-19 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff added a comment. In https://reviews.llvm.org/D33272#758616, @joerg wrote: > Can this use ErrorOr? It makes sense if constructing methods of `CompilationDatabase` were also changed to return `ErrorOr`, as there is no need to have different interfaces for the similar functionality. On

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

2017-05-18 Thread Joerg Sonnenberger via Phabricator via cfe-commits
joerg added a comment. Can this use ErrorOr? https://reviews.llvm.org/D33272 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-05-17 Thread Serge Pavlov via Phabricator via cfe-commits
sepavloff created this revision. Now FixedCompilationDatabase::loadFromCommandLine has no means to report which error occurred if it fails to create compilation object. This is a block for implementing https://reviews.llvm.org/D33013, because after that change driver refuses to create compilation