[PATCH] D38772: [refactor] allow the use of refactoring diagnostics

2017-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Looks good. Comment at: lib/Basic/DiagnosticIDs.cpp:46 unsigned WarnShowInSystemHeader : 1; - unsigned Category : 5; + unsigned Category : 6; arphaman

[PATCH] D38835: [refactor] selection: new CodeRangeASTSelection represents a set of selected consecutive statements

2017-10-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: include/clang/Tooling/Refactoring/ASTSelection.h:74 +/// An AST selection value that corresponds to a selection of a set of +/// statements that belong to one body of code (like one function). +/// I see all your tests ar

[PATCH] D34272: [Tooling] A new framework for executing clang frontend actions.

2017-10-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. This is a good start, a few comments. Also I'd suggest running clang-format on this patch -- I saw a few places violate the code style. Comment at: include/clang/Tooling/CommonOptionsParser.h:90 /// - /// This constructor exits program in case of er

[PATCH] D38882: [clang-rename] Add function unit tests.

2017-10-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: mgorny, klimek. Also contain some fixes: - Get rid of the "TranslationUnitDecl" special case in RenameClass, as we switch to use USR instead of AST matcher to find symbols. A bonus point is that now the test cases make more sense. - Fix a

[PATCH] D38893: [change-namespace] do not change type locs in defaulted functions.

2017-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM https://reviews.llvm.org/D38893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[PATCH] D38882: [clang-rename] Add function unit tests.

2017-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 119121. hokein added a comment. Update, and add one unfixed testcase. https://reviews.llvm.org/D38882 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/CMakeLists.txt unittests/Rename/RenameClassTest.cpp unittests/Rename/RenameF

[PATCH] D38882: [clang-rename] Add function unit tests.

2017-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Sorry, I thought I have run all the tests. The previous version broke one test in RenameClass. We still need the workaround for the `std::function` special case. I added it back, and also added a corresponding test case for renaming function, but it is currently not su

[PATCH] D38882: [clang-rename] Add function unit tests.

2017-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 119128. hokein marked an inline comment as done. hokein added a comment. Remove the FIXME. https://reviews.llvm.org/D38882 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/CMakeLists.txt unittests/Rename/RenameClassTest.cpp uni

[PATCH] D38882: [clang-rename] Add function unit tests.

2017-10-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp:469 + // name. + // FIXME: Consider using using-decls to shorten the namespace + // qualifers. ioeric wrote: > The current behavior looks fine to

[PATCH] D38882: [clang-rename] Add function unit tests.

2017-10-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315898: [clang-rename] Add function unit tests. (authored by hokein). Repository: rL LLVM https://reviews.llvm.org/D38882 Files: cfe/trunk/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp cfe/trunk

[PATCH] D38989: [clang-rename] Rename enum.

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: mgorny, klimek. - Add unit tests for renaming enum. - Support unscoped enum constants in expressions. https://reviews.llvm.org/D38989 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/CMakeLists.txt unittests/Re

[PATCH] D38989: [clang-rename] Rename enum.

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 119274. hokein marked 2 inline comments as done. hokein added a comment. address review comments, and add FIXME https://reviews.llvm.org/D38989 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/CMakeLists.txt unittests/Rename/Rena

[PATCH] D38989: [clang-rename] Rename enum.

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp:212 + // Ignore the case where there is no prefix qualifer for the enum constant + // expression like `a = Green`. + if (!Expr->hasQualifier()) ioeric wrote:

[PATCH] D38985: [refactor] Add support for editor commands that connect IDEs/editors to the refactoring actions

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. +sammccall who is currently working on clangD, he might have ideas on the clangD/refactor integration. Repository: rL LLVM https://reviews.llvm.org/D38985 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lis

[PATCH] D38989: [clang-rename] Rename enum.

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 119309. hokein added a comment. Use getQualifierLoc. https://reviews.llvm.org/D38989 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/CMakeLists.txt unittests/Rename/RenameEnumTest.cpp Index: unittests/Rename/RenameEnumTest.cpp

[PATCH] D38989: [clang-rename] Rename enum.

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp:212 + // Ignore the case where there is no prefix qualifer for the enum constant + // expression like `a = Green`. + if (!Expr->hasQualifier()) ioeric wrote:

[PATCH] D38835: [refactor] selection: new CodeRangeASTSelection represents a set of selected consecutive statements

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Comment at: unittests/Tooling/ASTSelectionTest.cpp:688 + Source, {2, 2}, None, + [](SourceRange SelectionRange, Optional Node) { +EXPECT_TRUE(Node); -

[PATCH] D38989: [clang-rename] Rename enum.

2017-10-17 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315999: [clang-rename] Rename enum. (authored by hokein). Repository: rL LLVM https://reviews.llvm.org/D38989 Files: cfe/trunk/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp cfe/trunk/unittests/Re

[PATCH] D39043: [clang-rename] Rename alias.

2017-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: mgorny, klimek. - Support rename alias. - Add unittests for renaming alias. - Don't generate fixes for the SourceLocations that are invalid or in temporary buffer, otherwise crash would be happened when generating AtomicChanges. https://re

[PATCH] D39042: [Tooling] Add a factory method for CommonOptionsParser

2017-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: include/clang/Tooling/CommonOptionsParser.h:95 + static llvm::Expected> + create(int &argc, const char **argv, llvm::cl::OptionCategory &Category, worth some documentation? Comment at: include/clang

[PATCH] D39043: [clang-rename] Rename alias.

2017-10-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316074: [clang-rename] Rename alias. (authored by hokein). Repository: rL LLVM https://reviews.llvm.org/D39043 Files: cfe/trunk/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp cfe/trunk/unittests/R

[PATCH] D39042: [Tooling] Add a factory method for CommonOptionsParser

2017-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Looks good from my side. You might want @klimek to take a look before committing. Comment at: include/clang/Tooling/CommonOptionsParser.h:90 - /// - /// This constructor e

[PATCH] D39027: [docs][refactor] Add a new tutorial that talks about how one can implement refactoring actions

2017-10-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Awesome, thanks for the very well-illustrated tutorial! Comment at: docs/RefactoringActionTutorial.rst:7 + + This tutorial talks about a work-in-progress library in Clang. + Some of the described features might not be available yet in trunk, but shoul

[PATCH] D39092: [clang-refactor] Add "-Inplace" option to the commandline tool.

2017-10-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Change clang-refactor default behavior to print the new code after refactoring (instead of editing the source files), which would make it easier to use and debug the refactoring action. https://reviews.llvm.org/D39092 Files: test/Refactor/tool-apply-replacements.

[PATCH] D39042: [Tooling] Add a factory method for CommonOptionsParser

2017-10-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. Still LGTM. https://reviews.llvm.org/D39042 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D39120: [rename] Don't overwrite the template argument when renaming a template function.

2017-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: klimek. https://reviews.llvm.org/D39120 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/RenameFunctionTest.cpp Index: unittests/Rename/RenameFunctionTest.cpp

[PATCH] D39092: [clang-refactor] Add "-Inplace" option to the commandline tool.

2017-10-20 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316212: [clang-refactor] Add "-Inplace" option to the commandline tool. (authored by hokein). Repository: rL LLVM https://reviews.llvm.org/D39092 Files: cfe/trunk/test/Refactor/tool-apply-replacemen

[PATCH] D39120: [rename] Don't overwrite the template argument when renaming a template function.

2017-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp:227 +SourceLocation EndLoc = Expr->hasExplicitTemplateArgs() +? Expr->getLAngleLoc().getLocWithOffset(-1) +: Expr->getLocE

[PATCH] D39120: [rename] Don't overwrite the template argument when renaming a template function.

2017-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 119654. hokein marked an inline comment as done. hokein added a comment. Test for `foo ()`. https://reviews.llvm.org/D39120 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/RenameFunctionTest.cpp Index: unittests/Rename/RenameFu

[PATCH] D39120: [rename] Don't overwrite the template argument when renaming a template function.

2017-10-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp:227 +SourceLocation EndLoc = Expr->hasExplicitTemplateArgs() +? Expr->getLAngleLoc().getLocWithOffset(-1) +: Expr->getLocE

[PATCH] D39120: [rename] Don't overwrite the template argument when renaming a template function.

2017-10-23 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316314: [rename] Don't overwrite the template argument when renaming a template… (authored by hokein). Repository: rL LLVM https://reviews.llvm.org/D39120 Files: cfe/trunk/lib/Tooling/Refactoring/Re

[PATCH] D39120: [rename] Don't overwrite the template argument when renaming a template function.

2017-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: unittests/Rename/RenameFunctionTest.cpp:232 + std::string Expected = R"( + namespace na { + template T Y(); cierpuchaw wrote: > Shouldn't this be `namespace nb {`? It is intended. We don't change the namespace

[PATCH] D39178: [rename] support renaming class member.

2017-10-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: mgorny, klimek. https://reviews.llvm.org/D39178 Files: lib/Tooling/Refactoring/Rename/USRLocFinder.cpp unittests/Rename/CMakeLists.txt unittests/Rename/RenameMemberTest.cpp Index: unittests/Rename/RenameMemberTest.cpp

[PATCH] D39241: [clang-rename] Fix and enable the failing TemplatedClassFunction test.

2017-10-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: klimek. https://reviews.llvm.org/D39241 Files: lib/Tooling/Refactoring/Rename/USRFindingAction.cpp test/clang-rename/TemplatedClassFunction.cpp Index: test/clang-rename/TemplatedClassFunction.cpp ==

[PATCH] D39241: [clang-rename] Fix and enable the failing TemplatedClassFunction test.

2017-10-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 120199. hokein added a comment. improve the code and add more tests. https://reviews.llvm.org/D39241 Files: lib/Tooling/Refactoring/Rename/USRFindingAction.cpp test/clang-rename/TemplatedClassFunction.cpp Index: test/clang-rename/TemplatedClassFunction

[PATCH] D39241: [clang-rename] Fix and enable the failing TemplatedClassFunction test.

2017-10-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316561: [clang-rename] Fix and enable the failing TemplatedClassFunction test. (authored by hokein). Repository: rL LLVM https://reviews.llvm.org/D39241 Files: cfe/trunk/lib/Tooling/Refactoring/Rena

[PATCH] D39178: [rename] support renaming class member.

2017-10-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 120216. hokein marked 2 inline comments as done. hokein added a comment. - remove the code of handling template class methods as it is fixed in another patch. - address review comments. https://reviews.llvm.org/D39178 Files: lib/Tooling/Refactoring/Rename

[PATCH] D39178: [rename] support renaming class member.

2017-10-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I have refined the patch based on the https://reviews.llvm.org/D39241. Please take another look. https://reviews.llvm.org/D39178 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/l

[PATCH] D39178: [rename] support renaming class member.

2017-10-25 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316571: [rename] support renaming class member. (authored by hokein). Repository: rL LLVM https://reviews.llvm.org/D39178 Files: cfe/trunk/lib/Tooling/Refactoring/Rename/USRLocFinder.cpp cfe/trunk

[PATCH] D39290: [rename] Use SymbolOccurrence in RenameLocFinder.

2017-10-25 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: klimek. This is first step to integrate qualified rename into clang-refactor. Also a few changes to SymbolOccurrence: - add more information to SymbolOccurrence - remove the way of using SourceLocation as the array size https://reviews.l

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: docs/clang-tidy/checks/abseil-no-internal-deps.rst:17 + + absl::strings_internal::foo(); + class foo { I think this line is also triggered the warning? Comment at: test/clang-tidy/abseil-no-internal-d

[PATCH] D50385: [clangd] Collect symbol occurrences from AST.

2018-08-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 162611. hokein marked 7 inline comments as done. hokein added a comment. Update the patch based on our new discussion - SymbolOccurrenceSlab for storing underlying occurrence data - reuse SymbolCollector to collect symbol occurrences Repository: rCTE Clang

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. Implement the interface in - FileIndex - MemIndex - MergeIndex Depends on https://reviews.llvm.org/D50385. Repository: rCTE Clang Tools Ex

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Some numbers of memory usage from running this on my machine: | File | Preamble AST | Main AST | | SemaDecl.cpp | 14.5MB | 108.1KB (symbols) + 16.5KB (occurrences) | | CodeComplete.cpp | 15.4MB | 53.9KB (symbols)

[PATCH] D50958: [clangd] WIP: xrefs for dynamic index.

2018-08-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the comments. In https://reviews.llvm.org/D50958#1212221, @sammccall wrote: > I do have some questions there that would be good to discuss. Meanwhile, > @hokein can you rebase this patch against head? Yes, I'd love to, but since this patch is quite large, I

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D51279#1214268, @ilya-biryukov wrote: > Just noticed I'm not on the reviewers list, sorry for chiming in without > invitation. Was really excited about the change :-) Comments are always welcome :) Comment at: clangd/index

[PATCH] D50580: [clang-tidy] Abseil: no namespace check

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein closed this revision. hokein added a comment. I have committed the patch for you, https://reviews.llvm.org/rL340800. Comment at: test/clang-tidy/abseil-no-namespace.cpp:10 +#include "absl/external-file.h" +// CHECK: absl/external-file.h:1:11: warning: namespace 'absl' i

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Please rebase your patch, since the absl matcher patch is submitted. Thanks. Comment at: test/clang-tidy/abseil-no-internal-deps.cpp:8 +#include "absl/external-file.h" +// CHECK: absl/external-file.h:1:23: warning: do not reference any 'internal' namesp

[PATCH] D50385: [clangd] Collect symbol occurrences in SymbolCollector

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 162854. hokein marked 10 inline comments as done. hokein added a comment. Address review comments and fix code style. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50385 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/

[PATCH] D50385: [clangd] Collect symbol occurrences in SymbolCollector

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 162856. hokein added a comment. Minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50385 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests/clangd

[PATCH] D50385: [clangd] Collect symbol occurrences in SymbolCollector

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Index.h:377 + llvm::ArrayRef find(const SymbolID &ID) const { + auto It = Occurrences.find(ID); + if (It == Occurrences.end()) sammccall wrote: > return Occurrences.lookup(ID)? The `DenseMap::lookup

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-28 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: test/clang-tidy/Inputs/absl/external-file.h:1 +void DirectAcess2() { absl::strings_internal::InternalFunction(); } + The file can not self-compile, and we should make it compilable. And put the newly-added code at the en

[PATCH] D50542: [clang-tidy] Add abseil-no-internal-deps check

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM with a nit, thanks for your work. Comment at: clang-tidy/abseil/NoInternalDependenciesCheck.h:20 +/// Finds instances where the user depends on internal details and warn

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163064. hokein marked 16 inline comments as done. hokein added a comment. Herald added a subscriber: mgrang. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/Fil

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163066. hokein added a comment. Minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/Index.cpp clangd/index/Index.h clangd/index/MemIndex.cpp

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the comments. Comment at: clangd/index/FileIndex.cpp:48 + if (TopLevelDecls) { // index main AST, set occurrence flag. +CollectorOpts.OccurrenceFilter = SymbolOccurrenceKind::Declaration | ilya-biryukov wrote: > There i

[PATCH] D51360: [clang-tidy] Use simple string matching instead of Regex

2018-08-29 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks very much for improving it! Comment at: clang-tools-extra/clang-tidy/abseil/AbseilMatcher.h:45 - llvm::Regex RE( - "absl/(algorithm|base|container|debugging|memory|meta|numeric|strings|" - "synchronization|time|types|utility)"); ---

[PATCH] D50958: [clangd] WIP: xrefs for dynamic index.

2018-08-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163284. hokein marked 8 inline comments as done. hokein added a comment. - address review comments - rescope the patch only focus on `findReferences` implementation. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50958 Files: clangd/XRefs.

[PATCH] D50958: [clangd] Implement findReferences function

2018-08-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/XRefs.cpp:666 +std::vector references(ParsedAST &AST, Position Pos, + bool IncludeDeclaration, + const SymbolIndex *Index) { sammccall wrote: > I'm no

[PATCH] D51360: [clang-tidy] Use simple string matching instead of Regex

2018-08-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. In https://reviews.llvm.org/D51360#1219024, @kbobyrev wrote: > Ah, correct. I totally forgot about the `^string$` for the exact match. > > This should not change behavior now. I believe what yo

[PATCH] D50438: [clangd] Sort GoToDefinition results.

2018-08-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Sorry, I just realized I didn't reply the comments in the first review (they were in my draft). Comment at: clangd/XRefs.cpp:71 +struct DeclInfo { + const Decl *D; ilya-biryukov wrote: > NIT: maybe call `Occurence` instead? As this i

[PATCH] D50438: [clangd] Sort GoToDefinition results.

2018-08-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163311. hokein marked 3 inline comments as done. hokein added a comment. Address review comments, return deterministic results. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50438 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp

[PATCH] D51504: [clangd] Flatten out Symbol::Details. It was ill-conceived, sorry.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM, note that this change will break our next internal integration. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51504 ___ c

[PATCH] D51061: [clang-tidy] abseil-str-cat-append

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein closed this revision. hokein added a comment. Thanks @aaron.ballman. I'm closing it now as it is committed in https://reviews.llvm.org/rL340915. https://reviews.llvm.org/D51061 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://l

[PATCH] D50385: [clangd] Collect symbol occurrences in SymbolCollector

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163512. hokein added a comment. Address review comments in https://reviews.llvm.org/D51279. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50385 Files: clangd/index/Index.cpp clangd/index/Index.h clangd/index/SymbolCollector.cpp clan

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 3 inline comments as done. hokein added a comment. Sorry! Just realised I messed up this patch with https://reviews.llvm.org/D50385 (mostly SymbolCollector changes), all the comments about `SymbolCollector` are fixed in https://reviews.llvm.org/D50385. Repository: rCTE Clang To

[PATCH] D50385: [clangd] Collect symbol occurrences in SymbolCollector

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein closed this revision. hokein added a comment. Committed in https://reviews.llvm.org/rL341208. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50385 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163531. hokein marked 4 inline comments as done. hokein added a comment. - rebase - address review comments Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/In

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163532. hokein added a comment. Minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/Index.h clangd/index/MemIndex.cpp clangd/index/MemIndex.h

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/MemIndex.cpp:35 std::unique_ptr MemIndex::build(SymbolSlab Slab) { auto Idx = llvm::make_unique(); sammccall wrote: > This is still implicitly creating an index with no occurrences. Did you mean > to a

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163539. hokein marked 3 inline comments as done. hokein added a comment. address review comments: - build memindex with symbol slab and occurrence slab - remove withAllCode in TestTU Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D51279 File

[PATCH] D51279: [clangd] Implement findOccurrences interface in dynamic index.

2018-08-31 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE341242: [clangd] Implement findOccurrences interface in dynamic index. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D51279?vs=163539&id=163580#toc Repository

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 163654. hokein edited the summary of this revision. hokein added a comment. Rebase Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50958 Files: clangd/XRefs.cpp clangd/XRefs.h unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRe

[PATCH] D51575: [clang-tidy] Implement a clang-tidy check to verify Google Objective-C function naming conventions 📜

2018-09-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Nice! looks mostly good to me. Comment at: clang-tidy/google/FunctionNamingCheck.cpp:57 + functionDecl( + isDefinition(), + unless(anyOf(isMain(), matchesName(validFunctionNameRegex(true)), any reason why we restri

[PATCH] D51605: [clangd] SymbolOccurrences -> Refs and cleanup

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for cleaning it up! I admit that `SymbolOccurrences` is a loong name. A few nits. Comment at: clangd/index/FileIndex.cpp:120 + auto &SymRefs = Sym.second; + std::sort(SymRefs.begin(), SymRefs.end()); + std::copy(SymRefs.begin(), Sy

[PATCH] D51605: [clangd] SymbolOccurrences -> Refs and cleanup

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. LGTM, thanks! Comment at: clangd/index/FileIndex.cpp:120 + auto &SymRefs = Sym.second; + std::sort(SymRefs.begin(), SymRefs.end()); + std::copy(SymRefs.begin(), SymRefs.end(), back_inserter(RefsStorage)); ---

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D50958#149, @sammccall wrote: > Looking forward to using this! > > Unless you object, I'd like to address the remaining comments (and get a > review), so you can make the most of your leave! Thanks, feel free to pick it up. The comments m

[PATCH] D50958: [clangd] Implement findReferences function

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks, looks good from my side. Comment at: clangd/XRefs.cpp:328 + : AST(AST) { +for (const Decl *D : TargetDecls) + Targets.insert(D); nit: w

[PATCH] D51575: [clang-tidy] Implement a clang-tidy check to verify Google Objective-C function naming conventions 📜

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/google/FunctionNamingCheck.cpp:57 + functionDecl( + isDefinition(), + unless(anyOf(isMain(), matchesName(validFunctionNameRegex(true)), stephanemoore wrote: > hokein wrote: > > any reason

[PATCH] D50438: [clangd] Sort GoToDefinition results.

2018-09-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D50438#1224287, @ilya-biryukov wrote: > @hokein, would it be fine if I submit this change for you? > It would be nice to get this fix in before you get back from vacation. Thanks, and sorry for the delay here, I was planning to submit it afte

[PATCH] D50438: [clangd] Sort GoToDefinition results.

2018-09-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 164013. hokein added a comment. Rebase to master. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50438 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRefsTests.cpp ==

[PATCH] D50896: [clangd] Add xrefs LSP boilerplate implementation.

2018-09-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks, LGTM, ship it! Comment at: clangd/Protocol.h:881 +struct ReferenceParams : public TextDocumentPositionParams {}; +bool fromJSON(const llvm::json::Value &, Reference

[PATCH] D50438: [clangd] Sort GoToDefinition results.

2018-09-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 164014. hokein added a comment. Fix code style. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50438 Files: clangd/XRefs.cpp unittests/clangd/XRefsTests.cpp Index: unittests/clangd/XRefsTests.cpp

[PATCH] D50438: [clangd] Sort GoToDefinition results.

2018-09-05 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341463: [clangd] Sort GoToDefinition results. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D50438 Files: clang-tools-ext

[PATCH] D50438: [clangd] Sort GoToDefinition results.

2018-09-05 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE341463: [clangd] Sort GoToDefinition results. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D50438?vs=164014&id=164017#toc Repository: rL LLVM https://revi

[PATCH] D51819: [clang-tidy/ObjC] Update list of acronyms in PropertyDeclarationCheck

2018-09-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. We need to update the documentation http://clang.llvm.org/extra/clang-tidy/checks/objc-property-declaration.html as well. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D5181

[PATCH] D49657: [clangd] Make SymbolLocation => bool conversion explicitly.

2018-07-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. The implicit bool conversion could happen superisingly, e.g. when checking `if (Loc1 == Loc2)`, the compiler will convert SymbolLocation to bool before com

[PATCH] D49658: [clangd] Index Interfaces for Xrefs

2018-07-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: sammccall. Herald added subscribers: arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. This is the first step of implementing Xrefs in clangd: - add index interfaces, and related data structures. - implement a naive in-memory index for symbo

[PATCH] D49862: [clang-tidy] Fix a crash in fuchsia-multiple-inheritance

2018-07-26 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Comment at: test/clang-tidy/fuchsia-multiple-inheritance-crash.cpp:1 +// RUN: clang-tidy -checks='fuchsia-multiple-inheritance' %s -- +template nit: i

[PATCH] D50102: [clang-tidy] Use ExprMutationAnalyzer in performance-unnecessary-value-param

2018-08-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Mostly good. A few nits. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:103 // Do not trigger on non-const value parameters when they are not only used as // const. This comment needs to be updated.

[PATCH] D49657: [clangd] Make SymbolLocation => bool conversion explicitly.

2018-08-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/index/Index.h:45 - operator bool() const { return !FileURI.empty(); } + explicit operator bool() const { return !FileURI.empty(); } + bool operator==(const SymbolLocation& Loc) const {

[PATCH] D49657: [clangd] Make SymbolLocation => bool conversion explicitly.

2018-08-01 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rCTE338517: [clangd] Make SymbolLocation => bool conversion explicitly. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D496

[PATCH] D49658: [clangd] Index Interfaces for Xrefs

2018-08-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 158507. hokein marked 4 inline comments as done. hokein added a comment. Scope the patch to interfaces only. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49658 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/I

[PATCH] D49658: [clangd] Index Interfaces for Xrefs

2018-08-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D49658#1171410, @sammccall wrote: > Mostly LG. > > I think we can simplify in a couple of places, and you should decide if this > patch is *implementing* the new index operation or not. (Currently it > implements it for 1/3 implementations, wh

[PATCH] D50102: [clang-tidy] Use ExprMutationAnalyzer in performance-unnecessary-value-param

2018-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clang-tidy/performance/UnnecessaryValueParamCheck.cpp:108 return; + if (const auto *Ctor = dyn_cast(Function)) { +for (const auto *Init : Ctor->in

[PATCH] D50154: [clangd] capitalize diagnostic messages if '-capitialize-diagnostic-text' is provided

2018-08-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. nit: The patch description needs to be updated. https://reviews.llvm.org/D50154 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D50307: [clang-rename] make clang-rename.py vim integration python3 compatible

2018-08-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks, LGTM. Repository: rC Clang https://reviews.llvm.org/D50307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D49658: [clangd] Index Interfaces for Xrefs

2018-08-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 2 inline comments as done. hokein added inline comments. Comment at: clangd/index/Index.h:288 + Unknown = 0, + Declaration = static_cast(index::SymbolRole::Declaration), + Definition = static_cast(index::SymbolRole::Definition), ilya-biryukov wro

[PATCH] D49658: [clangd] Index Interfaces for Xrefs

2018-08-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 159287. hokein marked 2 inline comments as done. hokein added a comment. Rebase Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49658 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/Index.h clangd/index/MemInde

[PATCH] D49658: [clangd] Index Interfaces for Xrefs

2018-08-06 Thread Haojian Wu via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rL339011: [clangd] Index Interfaces for Xrefs (authored by hokein, committed by ). Herald added a subscriber: llvm-commits.

<    1   2   3   4   5   6   7   8   9   10   >