[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-09 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. sammccall marked an inline comment as done. Closed by commit rC329580: [Tooling] A CompilationDatabase wrapper that infers header commands. (authored by sammccall, committed by ). Changed prior to commit: https://reviews.

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-09 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL329580: [Tooling] A CompilationDatabase wrapper that infers header commands. (authored by sammccall, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llv

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-09 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LGTM with a small nit. Really excited about this landing! Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:353 + } + Best = Candidate.firs

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-05 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 141172. sammccall added a comment. Address cross-language issues in a more comprehensive way. Prefers (potentially) same-language over cross-language, handles cross-language flag transfers correctly using -x and handling (dropping) -std. Repository: rC C

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:308 + llvm::sys::path::extension(Filename).substr(1)); + if (OldLang && NewLang != OldLang) { +Base.CommandLine.push_back("-x"); ilya-biryukov

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-04 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 140941. sammccall marked 3 inline comments as done. sammccall added a comment. Address comments, except cross-language flag transfer which needs more thought. Repository: rC Clang https://reviews.llvm.org/D45006 Files: include/clang/Tooling/Compilati

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-04 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:96 +// Sort input for determinism (index is used as a tiebreaker). +llvm::sort(OriginalPaths.begin(), OriginalPaths.end()); +for (size_t I = 0; I < Filenames.size(); ++I)

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 140802. sammccall added a comment. Add more tests, and only add -x when actually needed. Repository: rC Clang https://reviews.llvm.org/D45006 Files: include/clang/Tooling/CompilationDatabase.h lib/Tooling/CMakeLists.txt lib/Tooling/InterpolatingC

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 140792. sammccall added a comment. clang-format Repository: rC Clang https://reviews.llvm.org/D45006 Files: include/clang/Tooling/CompilationDatabase.h lib/Tooling/CMakeLists.txt lib/Tooling/InterpolatingCompilationDatabase.cpp unittests/Toolin

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 140791. sammccall marked 6 inline comments as done. sammccall added a comment. Address review comments. Repository: rC Clang https://reviews.llvm.org/D45006 Files: include/clang/Tooling/CompilationDatabase.h lib/Tooling/CMakeLists.txt lib/Tooling

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-03 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:115 +for (auto F : getAllFiles()) + Paths.emplace_back(Strings.save(F), 0); +finalizeIndex(); ilya-biryukov wrote: > This class seems to do two somewhat ort

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-04-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: lib/Tooling/InterpolatingCompilationDatabase.cpp:26 +// their compile commands. If getAllFilenames() is empty, no inference occurs. +// +//===--===// -

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-03-29 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 140349. sammccall added a comment. Add tests, fix minor bugs, add lots of comments and structure. Repository: rC Clang https://reviews.llvm.org/D45006 Files: include/clang/Tooling/CompilationDatabase.h lib/Tooling/CMakeLists.txt lib/Tooling/Inter

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-03-28 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 140160. sammccall added a comment. Handle the case where no points are awarded (e.g. system headers) and document awards better. Repository: rC Clang https://reviews.llvm.org/D45006 Files: include/clang/Tooling/CompilationDatabase.h lib/Tooling/CM

[PATCH] D45006: [Tooling] A CompilationDatabase wrapper that infers header commands.

2018-03-28 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. Herald added subscribers: cfe-commits, mgorny, klimek. The wrapper finds the closest matching compile command using filename heuristics and makes minimal tweaks so it can be used with the header. (This is WIP and needs tests) Repository: rC Clang https://revi