[PATCH] D30210: [include-fixer] Add usage count to find-all-symbols.

2017-02-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the contributions! Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:244 - const auto *ND = Result.Nodes.getNodeAs("decl"); - assert(ND && "Matched declaration must be a NamedDecl!"); + auto report = ::reportSymbol; + const

[PATCH] D30210: [include-fixer] Add usage count to find-all-symbols.

2017-02-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp:40 + void reportSymbols(llvm::StringRef FileName, + SymbolInfo::SignalMap NewSymbols) override { +for (const auto : NewSymbols) A

[PATCH] D30210: [include-fixer] Add usage count to find-all-symbols.

2017-02-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks, still LGTM with one nit. Comment at: include-fixer/find-all-symbols/FindAllSymbols.cpp:262 + if (Filename != "") { +Reporter->reportSymbols(Filename, std::move(FileSymbols)); +FileSymbols = {}; We don't need `std::move`

[PATCH] D30328: [change-namepsace] make it possible to whitelist symbols so they don't get updated.

2017-02-24 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: change-namespace/tool/ClangChangeNamespace.cpp:78 +// changing namespaces around them. +constexpr const char *WhiteListedSymbolPatterns[] = {"^std::.*$"};

[PATCH] D30328: [change-namepsace] make it possible to whitelist symbols so they don't get updated.

2017-02-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: change-namespace/tool/ClangChangeNamespace.cpp:82 + +llvm::ErrorOr GetWhiteListedSymbolPatterns() { + llvm::SmallVector Lines; Instead `std::vector`, maybe std::vector is better, with that we

[PATCH] D30337: [clang-move] Extend clang-move to support moving global variable.

2017-02-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 89659. hokein added a comment. No accident changes. https://reviews.llvm.org/D30337 Files: clang-move/ClangMove.cpp test/clang-move/Inputs/var_test.cpp test/clang-move/Inputs/var_test.h test/clang-move/move-var.cpp

[PATCH] D30337: [clang-move] Extend clang-move to support moving global variable.

2017-02-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Also support dumping global variables. https://reviews.llvm.org/D30337 Files: clang-move/ClangMove.cpp test/clang-move/Inputs/var_test.cpp test/clang-move/Inputs/var_test.h test/clang-move/move-var.cpp unittests/clang-move/ClangMoveTests.cpp Index:

[PATCH] D30210: [include-fixer] Add usage count to find-all-symbols.

2017-02-23 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. I'd wait to see whether @bkramer has more comments before commit it. Comment at: include-fixer/find-all-symbols/SymbolInfo.h:50 + // used.

[PATCH] D30210: [include-fixer] Add usage count to find-all-symbols.

2017-02-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: include-fixer/InMemorySymbolIndex.h:27 - std::vector + std::vector search(llvm::StringRef Identifier) override; sammccall wrote: > hokein wrote: > > There are many places using > > `std::vector`. Maybe we can use

[PATCH] D30210: [include-fixer] Add usage count to find-all-symbols.

2017-02-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: include-fixer/InMemorySymbolIndex.h:27 - std::vector + std::vector search(llvm::StringRef Identifier) override; There are many places using `std::vector`. Maybe we can use a type alias for it, so that we can

[PATCH] D29928: [clang-tidy] Improve diagnostic message for misc-definitions-in-header.

2017-02-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: JDevlieghere. Users might get confused easily when they see the check's message on full template function speciliations. Add a note to the output message, which mentions these kind of function specializations are treated as regular

[PATCH] D29928: [clang-tidy] Improve diagnostic message for misc-definitions-in-header.

2017-02-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tidy/misc/DefinitionsInHeadersCheck.cpp:131-135 +if (FD->getTemplateSpecializationKind() != TSK_Undeclared) + diag(FD->getLocation(), "this is a full function template specilization

[PATCH] D29928: [clang-tidy] Improve diagnostic message for misc-definitions-in-header.

2017-02-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 88336. hokein added a comment. Address review comment. https://reviews.llvm.org/D29928 Files: clang-tidy/misc/DefinitionsInHeadersCheck.cpp test/clang-tidy/misc-definitions-in-headers.hpp Index: test/clang-tidy/misc-definitions-in-headers.hpp

[PATCH] D29928: [clang-tidy] Improve diagnostic message for misc-definitions-in-header.

2017-02-14 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 rL295048: [clang-tidy] Improve diagnostic message for misc-definitions-in-header. (authored by hokein). Changed prior to commit:

[PATCH] D29957: [clang-tidy] Ignore instantiated functions and static data members of classes in misc-definitions-in-headers.

2017-02-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: JDevlieghere. https://reviews.llvm.org/D29957 Files: clang-tidy/misc/DefinitionsInHeadersCheck.cpp test/clang-tidy/misc-definitions-in-headers.hpp Index: test/clang-tidy/misc-definitions-in-headers.hpp

[PATCH] D29893: [change-namespace] add an option to dump changed files in YAML.

2017-02-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: change-namespace/tool/ClangChangeNamespace.cpp:68 +cl::opt +DumpYAML("dump_yaml", + cl::desc("Dump new file content in YAML, if specified."), `dump_result` maybe a clearer name, which also is consistent with

[PATCH] D29893: [change-namespace] add an option to dump changed files in YAML.

2017-02-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: change-namespace/tool/ClangChangeNamespace.cpp:68 +cl::opt +DumpYAML("dump_yaml", + cl::desc("Dump new file content in YAML, if specified."),

[PATCH] D29957: [clang-tidy] Ignore instantiated functions and static data members of classes in misc-definitions-in-headers.

2017-02-15 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL295178: [clang-tidy] Ignore instantiated functions and static data members of classes… (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D29957?vs=88413=88520#toc Repository:

[PATCH] D28895: [clang-move] Also move using decls which are defined in header file.

2017-01-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. https://reviews.llvm.org/D28895 Files: clang-move/ClangMove.cpp test/clang-move/Inputs/multiple_class_test.h test/clang-move/move-multiple-classes.cpp Index: test/clang-move/move-multiple-classes.cpp

[PATCH] D28293: [clang-move] Dump enum and type alias declarations.

2017-01-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292098: [clang-move] Dump enum and type alias declarations. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D28293?vs=83054=84525#toc Repository: rL LLVM

[PATCH] D28774: [clang-move] Ignore using decls which are defined in macros.

2017-01-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. hokein added a subscriber: cfe-commits. Also ignore helpers which are defined in macro. Currently clang-move doesn't handle macro well enough, especiall for complex macros. This patch will ignore declarations in macros to make the

[PATCH] D28774: [clang-move] Ignore using decls which are defined in macros.

2017-01-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 84639. hokein marked 2 inline comments as done. hokein added a comment. Add more tests. https://reviews.llvm.org/D28774 Files: clang-move/ClangMove.cpp test/clang-move/Inputs/macro_helper_test.cpp test/clang-move/Inputs/macro_helper_test.h

[PATCH] D28801: [clang-move] Handle helpers with forward declarations.

2017-01-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. https://reviews.llvm.org/D28801 Files: clang-move/ClangMove.cpp clang-move/HelperDeclRefGraph.cpp test/clang-move/Inputs/helper_decls_test.cpp test/clang-move/Inputs/helper_decls_test.h test/clang-move/move-used-helper-decls.cpp Index:

[PATCH] D28801: [clang-move] Handle helpers with forward declarations.

2017-01-17 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292215: [clang-move] Handle helpers with forward declarations. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D28801?vs=84655=84659#toc Repository: rL LLVM

[PATCH] D28774: [clang-move] Ignore using decls which are defined in macros.

2017-01-17 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL292207: [clang-move] Ignore using decls which are defined in macros. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D28774?vs=84639=84643#toc Repository: rL LLVM

[PATCH] D30337: [clang-move] Extend clang-move to support moving global variable.

2017-02-27 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296337: [clang-move] Extend clang-move to support moving global variable. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D30337?vs=89659=89869#toc Repository: rL LLVM

[PATCH] D30412: [clang-tidy] Fix a false positive on modernize-use-nullptr check.

2017-02-28 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL296479: [clang-tidy] Fix a false positive on modernize-use-nullptr check. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D30412?vs=89894=90032#toc Repository: rL LLVM

[PATCH] D30493: [change-namespace] avoid adding leading '::' when possible.

2017-03-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I like removing the leading "::" when possible. :) Comment at: change-namespace/ChangeNamespace.cpp:291 + assert(!SymbolSplitted.empty()); + SymbolSplitted.pop_back(); + Is this needed? Looks like you are removing the name of the

[PATCH] D30412: [clang-tidy] Fix a false positive on modernize-use-nullptr check.

2017-02-27 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: JDevlieghere. The false positive happens on two neighbour CXXDefaultArgExpr AST nodes. like below: CXXFunctionalCastExpr 0x85c9670 'struct ZZ' functional cast to struct ZZ `-CXXConstructExpr 0x85c9518

[PATCH] D30490: [change-namespace] get insertion points of forward declarations correct.

2017-03-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: unittests/change-namespace/ChangeNamespaceTests.cpp:354 "namespace nb {\n" + "\n" "class FWD;\n" I'd create a new test for the fix instead of modifying the

[PATCH] D27758: [change-namespace] don't crash when type reference is in function type parameter list.

2016-12-14 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/D27758 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 81741. hokein marked 15 inline comments as done. hokein added a comment. - address code review comments - add more tests https://reviews.llvm.org/D27673 Files: clang-move/CMakeLists.txt clang-move/ClangMove.cpp clang-move/ClangMove.h

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-move/ClangMove.cpp:492 + isDefinition(), unless(InMovedClass), InOldCC, + anyOf(isStaticStorageClass(), hasParent(namespaceDecl(isAnonymous(); + auto HelperFuncOrVar =

[PATCH] D27713: [clang-move] Fix incorrect EndLoc for declarations in macros.

2016-12-13 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL289541: [clang-move] Fix incorrect EndLoc for declarations in macros. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D27713?vs=81231=81234#toc Repository: rL LLVM

[PATCH] D27713: [clang-move] Fix incorrect EndLoc for declarations in macros.

2016-12-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. hokein added a subscriber: cfe-commits. https://reviews.llvm.org/D27713 Files: clang-move/ClangMove.cpp unittests/clang-move/ClangMoveTests.cpp Index: unittests/clang-move/ClangMoveTests.cpp

[PATCH] D27674: [StaticAnalysis] Remove unnecessary parameter in CallGraphNode::addCallee.

2016-12-12 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL289431: [StaticAnalysis] Remove unnecessary parameter in CallGraphNode::addCallee. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D27674?vs=81078=81081#toc Repository: rL

[PATCH] D27669: [clang-move] Use appendArgumentsAdjuster for adding extra arguments

2016-12-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. LGTM, Thanks! Comment at: clang-move/tool/ClangMoveMain.cpp:109 OptionsParser.getSourcePathList()); + // Add "-fparse-all-comments" compile

[PATCH] D27674: [StaticAnalysis] Remove unnecessary parameter in CallGraphNode::addCallee.

2016-12-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: bkramer. hokein added subscribers: ioeric, cfe-commits. Remove the CallGraph in addCallee as it is not used in addCallee. It decouples addCallee from CallGraph, so that we can use CallGraphNode within our customized CallGraph.

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 81079. hokein added a comment. Fix code style. https://reviews.llvm.org/D27673 Files: clang-move/CMakeLists.txt clang-move/ClangMove.cpp clang-move/ClangMove.h clang-move/UsedHelperDeclFinder.cpp clang-move/UsedHelperDeclFinder.h

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. hokein added a subscriber: cfe-commits. Herald added a subscriber: mgorny. Instead of moving all the helper declarations blindly, this patch implement an AST-based call graph solution to make clang-move only move used helper decls to

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-move/ClangMove.cpp:492 + isDefinition(), unless(InMovedClass), InOldCC, + anyOf(isStaticStorageClass(), hasParent(namespaceDecl(isAnonymous(); + auto HelperFuncOrVar =

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-14 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 81413. hokein marked 18 inline comments as done. hokein added a comment. - Address review comments. - Add more test cases. https://reviews.llvm.org/D27673 Files: clang-move/CMakeLists.txt clang-move/ClangMove.cpp clang-move/ClangMove.h

[PATCH] D27801: [change-namespace] handling templated type aliases correctly.

2016-12-15 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: change-namespace/ChangeNamespace.cpp:730 + // Make `FromDecl` the immediate declaration that `Type` refers to, i.e. if + // `Type` is an alias type, we

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the awesome suggestions on the names. I refactored the patch, hope it is clearer now. Comment at: clang-move/UsedHelperDeclFinder.cpp:30 + Result = FD; + if (const auto *RD = dyn_cast(FD->getParent())) +Result = RD;

[PATCH] D27520: [clang-tidy] Add check for redundant function pointer dereferences

2016-12-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. Nice, the patch looks good to me. Comment at: docs/clang-tidy/checks/readability-redundant-function-ptr-dereference.rst:25 + int i = (*p)(10, 50); + Nit:

[PATCH] D28671: [ASTMatchers] add typeAliasTemplateDecl matcher.

2017-01-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. You also need to add a new generated document (`docs/LibASTMatchersReference.html`) for that. Please run `clang/docs/tools/dump_ast_matchers.py`, it will do the stuff for you. https://reviews.llvm.org/D28671 ___

[PATCH] D27920: [find-all-symbols] Index partial template specializations.

2017-01-11 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL291669: [find-all-symbols] Index partial template specializations. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D27920?vs=83944=83951#toc Repository: rL LLVM

[PATCH] D27920: [find-all-symbols] Index partial template specializations.

2017-01-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 83944. hokein marked an inline comment as done. hokein added a comment. Fix code style nit. https://reviews.llvm.org/D27920 Files: include-fixer/find-all-symbols/FindAllSymbols.cpp unittests/include-fixer/find-all-symbols/FindAllSymbolsTests.cpp

[PATCH] D27302: [change-namespace] don't generate replacements for files that don't match file pattern.

2016-12-01 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 two nits. Comment at: change-namespace/ChangeNamespace.cpp:786 + for (auto : FileToReplacements) +if (!FilePatternRE.match(Entry.first)) +

[PATCH] D27208: [change-namespace] fix non-calling function references.

2016-11-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 few nits. Comment at: change-namespace/ChangeNamespace.cpp:434 +assert(Func); +const Decl *Context = Result.Nodes.getNodeAs("dc"); +assert(Context &&

[PATCH] D27248: [clang-tidy] Do not trigger unnecessary-value-param check on methods marked as final

2016-11-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. LGTM. Repository: rL LLVM https://reviews.llvm.org/D27248 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D21298: [Clang-tidy] delete null check

2016-12-01 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a reviewer: hokein. hokein added a comment. It looks good to me, but you'd better wait for the approval from @aaron.ballman. Comment at: clang-tidy/readability/DeleteNullPointerCheck.cpp:55 + "'if' statement is unnecessary;

[PATCH] D28315: Update tools to use new getStyle API

2017-01-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D28315#636821, @amaiorano wrote: > Is there a way to run tests without ninja? I'm on Windows. If not, I'll use > my Linux VM. It is not related to the build system. There should be a `check-clang-tools` project, you can run tests by

[PATCH] D28279: [clang-move] Support moving type alias declarations.

2017-01-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. hokein added a subscriber: cfe-commits. https://reviews.llvm.org/D28279 Files: clang-move/ClangMove.cpp test/clang-move/Inputs/type_alias.h test/clang-move/move-type-alias.cpp unittests/clang-move/ClangMoveTests.cpp Index:

[PATCH] D27673: [clang-move] Only move used helper declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL290873: [clang-move] Only move used helper declarations. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D27673?vs=82804=82847#toc Repository: rL LLVM

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. hokein added a subscriber: cfe-commits. https://reviews.llvm.org/D28228 Files: clang-move/ClangMove.cpp test/clang-move/Inputs/enum.h test/clang-move/move-enum-decl.cpp unittests/clang-move/ClangMoveTests.cpp Index:

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 82872. hokein marked an inline comment as done. hokein added a comment. Address review comment. https://reviews.llvm.org/D28228 Files: clang-move/ClangMove.cpp clang-move/ClangMove.h test/clang-move/Inputs/enum.h test/clang-move/move-enum-decl.cpp

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D28228#633863, @ioeric wrote: > Do we consider enum helpers? This patch excludes enum helpers, only considers the enum declarations which are defined in old.h. Ideally, we should support enum helpers which are defined in old.cc, but that's

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 82875. hokein added a comment. Remove forgot-deleted code. https://reviews.llvm.org/D28228 Files: clang-move/ClangMove.cpp clang-move/ClangMove.h test/clang-move/Inputs/enum.h test/clang-move/move-enum-decl.cpp

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 82874. hokein marked an inline comment as done. hokein added a comment. Refine function name and add a comment for enum helpers. https://reviews.llvm.org/D28228 Files: clang-move/ClangMove.cpp clang-move/ClangMove.h test/clang-move/Inputs/enum.h

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 82876. hokein marked an inline comment as done. hokein added a comment. Not change in ClangMove.h https://reviews.llvm.org/D28228 Files: clang-move/ClangMove.cpp test/clang-move/Inputs/enum.h test/clang-move/move-enum-decl.cpp

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL290891: [clang-move] Support moving enum declarations. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D28228?vs=82876=82879#toc Repository: rL LLVM

[PATCH] D28228: [clang-move] Support moving enum declarations.

2017-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D28228#633930, @ioeric wrote: > I mean, if a enum helper used in say only old cc, will it be moved? The > question is related to https://reviews.llvm.org/D27673. You don't need to > support enum helper now, but it would be nice to drop a

[PATCH] D28279: [clang-move] Support moving type alias declarations.

2017-01-04 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL290967: [clang-move] Support moving type alias declarations. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D28279?vs=83016=83053#toc Repository: rL LLVM

[PATCH] D28282: [change-namespace] get whitespaces right when moving old namespaces.

2017-01-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. LGTM with some nits. Would be clearer to elaborate more descriptions in the commit message. Looks like the patch actually resolves newline character "\n" rather than whitespace...

[PATCH] D28315: Update tools to use new getStyle API

2017-01-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D28315#635865, @amaiorano wrote: > I made these changes, and they build, but I didn't really test them. Are > there unit tests for these tools that I can run? If you use ninja build, you can run `ninja check-clang-tools` to run all tests.

[PATCH] D28293: [clang-move] Dump enum and type alias declarations.

2017-01-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. hokein added a subscriber: cfe-commits. https://reviews.llvm.org/D28293 Files: clang-move/ClangMove.cpp unittests/clang-move/ClangMoveTests.cpp Index: unittests/clang-move/ClangMoveTests.cpp

[PATCH] D27673: [clang-move] Only move used helper declarations.

2017-01-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 82804. hokein marked 3 inline comments as done. hokein added a comment. Add more test cases. https://reviews.llvm.org/D27673 Files: clang-move/CMakeLists.txt clang-move/ClangMove.cpp clang-move/ClangMove.h clang-move/HelperDeclRefGraph.cpp

[PATCH] D27920: [find-all-symbols] Index partial template specializations.

2016-12-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ioeric. hokein added subscribers: bkramer, cfe-commits. Fix no std::function index. https://reviews.llvm.org/D27920 Files: include-fixer/find-all-symbols/FindAllSymbols.cpp

[PATCH] D27920: [find-all-symbols] Index partial template specializations.

2016-12-21 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In https://reviews.llvm.org/D27920#628586, @ioeric wrote: > Why do we allow partially specialization but fully specialization now? Could > you elaborate in the cl description? Done. https://reviews.llvm.org/D27920 ___

[PATCH] D27982: [change-namespace] do not fix calls to overloaded operator functions.

2016-12-20 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/change-namespace/ChangeNamespaceTests.cpp:578 +// FIXME: function calls to overloaded operators are not fixed now even if they +// are

[PATCH] D28052: [change-namespace] consider namespace aliases to shorten qualified names.

2016-12-23 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/D28052 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D28052: [change-namespace] consider namespace aliases to shorten qualified names.

2016-12-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: change-namespace/ChangeNamespace.cpp:719 +// The alias is defined in some namespace. +assert(AliasQualifiedName.size() >= AliasName.size() + 2); +llvm::StringRef AliasNs = maybe

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 81762. hokein marked 3 inline comments as done. hokein added a comment. refactoring the patch. https://reviews.llvm.org/D27673 Files: clang-move/CMakeLists.txt clang-move/ClangMove.cpp clang-move/ClangMove.h clang-move/HelperDeclRefGraph.cpp

[PATCH] D27673: [clang-move] Only move used helper declarations.

2016-12-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 81763. hokein added a comment. Update outdated comment. https://reviews.llvm.org/D27673 Files: clang-move/CMakeLists.txt clang-move/ClangMove.cpp clang-move/ClangMove.h clang-move/HelperDeclRefGraph.cpp clang-move/HelperDeclRefGraph.h

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 92636. hokein marked 14 inline comments as done. hokein added a comment. Address review comments. https://reviews.llvm.org/D31176 Files: clang-rename/RenamingAction.cpp clang-rename/RenamingAction.h clang-rename/USRFinder.cpp

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-rename/USRLocFinder.cpp:157 +clang::NestedNameSpecifierLoc nested_name_specifier = +TL.castAs().getQualifierLoc(); +if (nested_name_specifier.getNestedNameSpecifier()) ioeric wrote: > Is this cast

[PATCH] D31492: Add `replace` interface with range in AtomicChange.

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 93467. hokein added a comment. Rebase to master. https://reviews.llvm.org/D31492 Files: include/clang/Tooling/Refactoring/AtomicChange.h lib/Tooling/Refactoring/AtomicChange.cpp Index: lib/Tooling/Refactoring/AtomicChange.cpp

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 93469. hokein marked an inline comment as done. hokein added a comment. update comments. https://reviews.llvm.org/D31176 Files: clang-rename/CMakeLists.txt clang-rename/RenamingAction.cpp clang-rename/RenamingAction.h clang-rename/USRFinder.cpp

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-rename/USRLocFinder.cpp:359 + + // Returns a list of using declarations which are needed to update. + const std::vector () const { ioeric wrote: > hokein wrote: > > ioeric wrote: > > > I think these are using

[PATCH] D31492: Add `replace` interface with range in AtomicChange.

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL299073: Add `replace` interface with range in AtomicChange. (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D31492?vs=93472=93473#toc Repository: rL LLVM

[PATCH] D31492: Add `replace` interface with range in AtomicChange.

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > are the tools like clang-rename, change-namespace and clang-reorder-fields > supposed to use AtomicChange (via the methods insert, replace etc) ? Yeah. We are using AtomicChange in clang-rename refinement (https://reviews.llvm.org/D31176). Repository: rL LLVM

[PATCH] D31492: Add `replace` interface with range in AtomicChange.

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 93472. hokein added a comment. Add unittest. https://reviews.llvm.org/D31492 Files: include/clang/Tooling/Refactoring/AtomicChange.h lib/Tooling/Refactoring/AtomicChange.cpp unittests/Tooling/RefactoringTest.cpp Index:

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 93474. hokein marked 2 inline comments as done. hokein added a comment. Fix a few nits. https://reviews.llvm.org/D31176 Files: clang-rename/CMakeLists.txt clang-rename/RenamingAction.cpp clang-rename/RenamingAction.h clang-rename/USRFinder.cpp

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 93468. hokein marked 2 inline comments as done. hokein added a comment. Use AtomicChange. https://reviews.llvm.org/D31176 Files: clang-rename/CMakeLists.txt clang-rename/RenamingAction.cpp clang-rename/RenamingAction.h clang-rename/USRFinder.cpp

[PATCH] D31492: Add `addReplacement` interface in AtomicChange.

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: klimek. https://reviews.llvm.org/D31492 Files: include/clang/Tooling/Refactoring/AtomicChange.h lib/Tooling/Refactoring/AtomicChange.cpp Index: lib/Tooling/Refactoring/AtomicChange.cpp

[PATCH] D31492: Add `addReplacement` interface in AtomicChange.

2017-03-30 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 93456. hokein added a comment. Get rid of Replacement, and implement "replace" interface with range. https://reviews.llvm.org/D31492 Files: include/clang/Tooling/Refactoring/AtomicChange.h lib/Tooling/Refactoring/AtomicChange.cpp Index:

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 92954. hokein marked 3 inline comments as done. hokein added a comment. Add comments and polish tests. https://reviews.llvm.org/D31176 Files: clang-rename/RenamingAction.cpp clang-rename/RenamingAction.h clang-rename/USRFinder.cpp

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-03-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-rename/USRLocFinder.cpp:195 +// Find all locations identified by the given USRs. Traverse the AST and find +// every AST node whose USR is in the given USRs' set. +class RenameLocFinder ioeric wrote: > I think this

[PATCH] D31076: [change-namespace] do not rename specialized template parameters.

2017-03-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. https://reviews.llvm.org/D31076 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D30493: [change-namespace] avoid adding leading '::' when possible.

2017-03-21 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. Sorry, I missed this patch. LGTM with one nit. Comment at: change-namespace/ChangeNamespace.cpp:296 +assert(!NsSplitted.empty()); +for (auto I = NsSplitted.begin()

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 94734. hokein marked 7 inline comments as done. hokein added a comment. Address review comments. https://reviews.llvm.org/D31757 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/InefficientVectorOperationCheck.cpp

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:22 +void InefficientVectorOperationCheck::registerMatchers(MatchFinder *Finder) { + const auto VectorDecl = cxxRecordDecl(hasName("std::vector")); + const auto

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:53-54 +PushBackCall)), + hasParent(compoundStmt(unless(has(ReserveCall)), + has(VectorVarDefStmt +

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:53-54 +PushBackCall)), + hasParent(compoundStmt(unless(has(ReserveCall)), + has(VectorVarDefStmt +

[PATCH] D31176: [clang-rename] Support renaming qualified symbol

2017-04-04 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL299419: [clang-rename] Support renaming qualified symbol (authored by hokein). Changed prior to commit: https://reviews.llvm.org/D31176?vs=93474=94021#toc Repository: rL LLVM

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 94969. hokein added a comment. Improve the way of detecting pre-allocation usage before the loop. https://reviews.llvm.org/D31757 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/InefficientVectorOperationCheck.cpp

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added a comment. friendly ping @alexfh. Comment at: clang-tidy/performance/InefficientVectorOperationCheck.cpp:53-54 +PushBackCall)), + hasParent(compoundStmt(unless(has(ReserveCall)), +

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 94356. hokein added a comment. Fix a small nit. https://reviews.llvm.org/D31757 Files: clang-tidy/performance/CMakeLists.txt clang-tidy/performance/InefficientVectorOperationCheck.cpp clang-tidy/performance/InefficientVectorOperationCheck.h

[PATCH] D31757: [clang-tidy] Add a clang-tidy check for possible inefficient vector operations

2017-04-06 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added a subscriber: mgorny. The "performance-inefficient-vector-operation" check finds vector oprations in for-loop statements which may cause multiple memory reallocations. This is the first version, only detects typical for-loop: std::vector v; for

  1   2   3   4   5   6   7   8   9   10   >