[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-03 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: lib/Tooling/Core/Replacement.cpp:578 + continue; +ProcessedFileEntries.insert(FE); +Result[Entry.first] = std::move(Entry.second); alexshap wrote: > (saves 2 lines of code) (although not particularly importan

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-03 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 76888. ioeric added a comment. - Kill a few lines. https://reviews.llvm.org/D26288 Files: include/clang/Tooling/Core/Replacement.h lib/Tooling/Core/Replacement.cpp lib/Tooling/Refactoring.cpp unittests/Tooling/RefactoringTest.cpp Index: unittests/To

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-03 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 76894. ioeric added a comment. - Addressed comments: handle non-existing files. https://reviews.llvm.org/D26288 Files: include/clang/Tooling/Core/Replacement.h lib/Tooling/Core/Replacement.cpp lib/Tooling/Refactoring.cpp unittests/Tooling/Refactoring

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-03 Thread Eric Liu via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D26288#586902, @klimek wrote: > If the files do not exist, how does this work? Won't that potentially give > different results if the files exist locally vs if they don't? This would be problematic. Thanks for the catch! https://reviews.llv

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-05 Thread Eric Liu via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D26288#587513, @klimek wrote: > In https://reviews.llvm.org/D26288#586932, @ioeric wrote: > > > - Addressed comments: handle non-existing files. > > > We're not really handling them now though? We're just printing an error? > > My point is that

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-05 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 76975. ioeric added a comment. - addressed comments. https://reviews.llvm.org/D26288 Files: include/clang/Tooling/Core/Replacement.h lib/Tooling/Core/Replacement.cpp lib/Tooling/Refactoring.cpp unittests/Tooling/RefactoringTest.cpp Index: unittests/

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-06 Thread Eric Liu via cfe-commits
ioeric added a comment. Since Manuel's comment has been addressed, I'd like to land this if there is no objection. https://reviews.llvm.org/D26288 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-06 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77008. ioeric added a comment. - Merge with origin/master https://reviews.llvm.org/D26288 Files: include/clang/Tooling/Core/Replacement.h lib/Tooling/Core/Replacement.cpp lib/Tooling/Refactoring.cpp unittests/Tooling/RefactoringTest.cpp Index: unitt

r286096 - Deduplicate replacements by FileEntry instead of file names.

2016-11-06 Thread Eric Liu via cfe-commits
Author: ioeric Date: Mon Nov 7 00:08:23 2016 New Revision: 286096 URL: http://llvm.org/viewvc/llvm-project?rev=286096&view=rev Log: Deduplicate replacements by FileEntry instead of file names. Summary: The current version does not deduplicate equivalent file paths correctly. For example, a relat

[PATCH] D26288: Deduplicate replacements by FileEntry instead of file names.

2016-11-06 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286096: Deduplicate replacements by FileEntry instead of file names. (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D26288?vs=77008&id=77009#toc Repository: rL LLVM https://

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-07 Thread Eric Liu via cfe-commits
ioeric marked an inline comment as done. ioeric added a comment. ping. https://reviews.llvm.org/D25771 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: r286096 - Deduplicate replacements by FileEntry instead of file names.

2016-11-07 Thread Eric Liu via cfe-commits
cc:82 > #1 0xc83f64 in > clang::tooling::DeduplicateByFileTest_NonExistingFilePath_Test::TestBody() > /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/unittests/Tooling/Re > > > On Sun, Nov 6, 2016 at 10:08 PM, Eric Liu via cfe-commits < > c

r286132 - Fix memory leak caused by r286096.

2016-11-07 Thread Eric Liu via cfe-commits
Author: ioeric Date: Mon Nov 7 12:40:41 2016 New Revision: 286132 URL: http://llvm.org/viewvc/llvm-project?rev=286132&view=rev Log: Fix memory leak caused by r286096. Modified: cfe/trunk/unittests/Tooling/RefactoringTest.cpp Modified: cfe/trunk/unittests/Tooling/RefactoringTest.cpp URL: ht

Re: r286096 - Deduplicate replacements by FileEntry instead of file names.

2016-11-07 Thread Eric Liu via cfe-commits
/asan/asan_new_delete.cc:82 #1 0xc83f64 in clang::tooling::DeduplicateByFileTest_NonExistingFilePath_Test::TestBody() /mnt/b/sanitizer-buildbot2/sanitizer-x86_64-linux-bootstrap/build/llvm/tools/clang/unittests/Tooling/Re On Sun, Nov 6, 2016 at 10:08 PM, Eric Liu via cfe-commits < cfe

[PATCH] D26236: [clang-move] Move all codes from old.h/cc if old.h only contains one moved declaration.

2016-11-07 Thread Eric Liu via cfe-commits
ioeric added a comment. First round of comments. The patch summary says "one moved declaration." Why it is just one moved declaration? Doesn't this also support moving all classes in one file? Maybe also mention the new behavior in the class comment. Comment at: clang-move/

[PATCH] D26236: [clang-move] Move all code from old.h/cc directly when moving all class declarations from old.h.

2016-11-07 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: unittests/clang-move/ClangMoveTests.cpp:278 + const char Code[] = "#include \"foo.h\"\nint A::f() { return 0; }"; + Spec.Names = {std::string("A")}; + Spec.OldHeader = "foo.h"; hokein wrote: > ioeric wrote: > > Maybe j

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-07 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77114. ioeric marked 2 inline comments as done. ioeric added a comment. - Ignore using decls in old ns but not the inner-most old ns. - Add a missing test case. - Addressed comments https://reviews.llvm.org/D25771 Files: change-namespace/ChangeNamespace.cp

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-07 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: change-namespace/ChangeNamespace.cpp:277 + auto IsVisibleInOldNs = + anyOf(IsInMovedNs, unless(hasAncestor(namespaceDecl(hasName(Prefix); + // Match using declarations. hokein wrote: > Ignoring using-decls in `

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-07 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77115. ioeric added a comment. - Get rid of redundant PrefixRef https://reviews.llvm.org/D25771 Files: change-namespace/ChangeNamespace.cpp change-namespace/ChangeNamespace.h unittests/change-namespace/ChangeNamespaceTests.cpp Index: unittests/change-

[PATCH] D26236: [clang-move] Move all code from old.h/cc directly when moving all class declarations from old.h.

2016-11-08 Thread Eric Liu via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. Lg with a few nits. Comment at: clang-move/ClangMove.cpp:539 + const FileEntry *FE = SM.getFileManager().getFile( + MakeAbsolutePath(OriginalRunningDirectory, OldFile))

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-08 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77228. ioeric marked 2 inline comments as done. ioeric added a comment. - Addressed comments. https://reviews.llvm.org/D25771 Files: change-namespace/ChangeNamespace.cpp change-namespace/ChangeNamespace.h unittests/change-namespace/ChangeNamespaceTests

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-08 Thread Eric Liu via cfe-commits
ioeric marked an inline comment as done. ioeric added inline comments. Comment at: change-namespace/ChangeNamespace.cpp:275 + (DiffOldNsSplitted.empty() ? "-" : DiffOldNsSplitted.front())) + .str(); + auto IsInMovedNs = hokein wrote: > Using an in

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-08 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77270. ioeric marked an inline comment as done. ioeric added a comment. - Addressed comment. https://reviews.llvm.org/D25771 Files: change-namespace/ChangeNamespace.cpp change-namespace/ChangeNamespace.h unittests/change-namespace/ChangeNamespaceTests.

[clang-tools-extra] r286307 - [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-08 Thread Eric Liu via cfe-commits
Author: ioeric Date: Tue Nov 8 16:44:17 2016 New Revision: 286307 URL: http://llvm.org/viewvc/llvm-project?rev=286307&view=rev Log: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl. Summary: when replacing symbol references in moved namespaces, trying to

[PATCH] D25771: [change-namespace] shorten namespace qualifier based on UsingDecl and UsingDirectiveDecl.

2016-11-08 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286307: [change-namespace] shorten namespace qualifier based on UsingDecl and… (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D25771?vs=77270&id=77272#toc Repository: rL LLVM

[PATCH] D26423: [clang-move] Support template class.

2016-11-08 Thread Eric Liu via cfe-commits
ioeric added a comment. Nice! First round of comments. Comment at: clang-move/ClangMove.cpp:414 RemovedDecls.push_back(MovedDecls.back()); + if (const auto *FTD = CMD->getDescribedFunctionTemplate()) { +UnremovedDeclsInOldHeader.erase(FTD);

[PATCH] D26456: Handle adding new nested namespace in old namespace.

2016-11-09 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added a reviewer: hokein. ioeric added a subscriber: cfe-commits. https://reviews.llvm.org/D26456 Files: change-namespace/ChangeNamespace.cpp unittests/change-namespace/ChangeNamespaceTests.cpp Index: unittests/change-namespace/ChangeNamespaceTests.cpp =

[PATCH] D26456: Handle adding new nested namespace in old namespace.

2016-11-09 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77380. ioeric added a comment. - Added a test case with type references. https://reviews.llvm.org/D26456 Files: change-namespace/ChangeNamespace.cpp unittests/change-namespace/ChangeNamespaceTests.cpp Index: unittests/change-namespace/ChangeNamespaceTes

[PATCH] D26423: [clang-move] Support template class.

2016-11-09 Thread Eric Liu via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. Lg with a few nits. Comment at: clang-move/ClangMove.cpp:417 + if (const auto *FTD = CMD->getDescribedFunctionTemplate()) +UnremovedDeclsInOldHeader.erase(FTD);

[PATCH] D26423: [clang-move] Support template class.

2016-11-09 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: clang-move/ClangMove.cpp:417 + if (const auto *FTD = CMD->getDescribedFunctionTemplate()) +UnremovedDeclsInOldHeader.erase(FTD); + else hokein wrote: > ioeric wrote: > > `erase(FTD ? FTD : CMD)` > We can

[clang-tools-extra] r286485 - [change-namespace] dyn_cast -> cast.

2016-11-10 Thread Eric Liu via cfe-commits
Author: ioeric Date: Thu Nov 10 12:15:34 2016 New Revision: 286485 URL: http://llvm.org/viewvc/llvm-project?rev=286485&view=rev Log: [change-namespace] dyn_cast -> cast. Modified: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp Modified: clang-tools-extra/trunk/change-namespace/

[PATCH] D24183: A clang tool for changing surrouding namespaces of class/function definitions.

2016-11-10 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/trunk/change-namespace/ChangeNamespace.cpp:396 + // Calculate the name of the `NsDecl` after it is moved to new namespace. + std::string OldNs = NsDecl->getQualifiedNameAsString(); + llvm::StringRef Postfix = OldNs; -

[PATCH] D26456: Handle adding new nested namespace in old namespace.

2016-11-10 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77509. ioeric added a comment. - Address comments. https://reviews.llvm.org/D26456 Files: change-namespace/ChangeNamespace.cpp unittests/change-namespace/ChangeNamespaceTests.cpp Index: unittests/change-namespace/ChangeNamespaceTests.cpp ===

[PATCH] D26456: Handle adding new nested namespace in old namespace.

2016-11-10 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 77511. ioeric added a comment. - Merged origin/master https://reviews.llvm.org/D26456 Files: change-namespace/ChangeNamespace.cpp unittests/change-namespace/ChangeNamespaceTests.cpp Index: unittests/change-namespace/ChangeNamespaceTests.cpp

[clang-tools-extra] r286486 - Handle adding new nested namespace in old namespace.

2016-11-10 Thread Eric Liu via cfe-commits
Author: ioeric Date: Thu Nov 10 12:29:01 2016 New Revision: 286486 URL: http://llvm.org/viewvc/llvm-project?rev=286486&view=rev Log: Handle adding new nested namespace in old namespace. Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26456 Modified:

[PATCH] D26456: Handle adding new nested namespace in old namespace.

2016-11-10 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL286486: Handle adding new nested namespace in old namespace. (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D26456?vs=77511&id=77513#toc Repository: rL LLVM https://reviews.

[PATCH] D26493: [clang-move] Make the output code look more pretty.

2016-11-10 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: clang-move/ClangMove.cpp:273 } +bool IsNamespaceStart = false; while (DeclIt != DeclNamespaces.end()) { It's been a while since the last time I reviewed this, and I need to struggle to understand what Curre

[PATCH] D26515: [clang-move] Abstract a ClassMather for matching class declarations.

2016-11-10 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: clang-move/ClangMove.cpp:144 + void run(const ast_matchers::MatchFinder::MatchResult &Result) override { +if (const auto *CMD = +Result.Nodes.getNodeAs("class_method")) { It'd be more readable if you pull

[PATCH] D26515: [clang-move] Abstract a ClassMather for matching class declarations.

2016-11-10 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: clang-move/ClangMove.cpp:144 + void run(const ast_matchers::MatchFinder::MatchResult &Result) override { +if (const auto *CMD = +Result.Nodes.getNodeAs("class_method")) { hokein wrote: > ioeric wrote: > >

[PATCH] D26515: [clang-move] Abstract a ClassMather for matching class declarations.

2016-11-14 Thread Eric Liu via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. Lg with a few comments. (There are two empty comments that can't be deleted due to a phabricator bugs...) Comment at: clang-move/ClangMove.cpp:407 + auto MovedClass = +

[PATCH] D26493: [clang-move] Make the output code look more pretty.

2016-11-14 Thread Eric Liu via cfe-commits
ioeric added a comment. Lg with one nit. Comment at: clang-move/ClangMove.cpp:280 assert(It < CurrentNamespaces.rend()); - NewCode += "} // namespace " + *It + "\n"; + NewCode += "} // namespace " + *It + "\n\n"; } Wouldn't this create som

[PATCH] D26609: [clang-move] Fix an incorrect range for the functions whose returned value is a macro

2016-11-14 Thread Eric Liu via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. Lg. Nice! Now I realize what I really meant was "ExpansionLoc" when I said "SpellingLoc" :P https://reviews.llvm.org/D26609 ___ cfe-commits mai

[PATCH] D26592: [change-namespace] consider typedef/using alias decls in the moved namespace.

2016-11-14 Thread Eric Liu via cfe-commits
ioeric marked an inline comment as done. ioeric added inline comments. Comment at: unittests/change-namespace/ChangeNamespaceTests.cpp:829 "void f() {\n" - " using na::CA;\n" - " CA ca;\n" + " us

[clang-tools-extra] r286873 - [change-namespace] consider typedef/using alias decls in the moved namespace.

2016-11-14 Thread Eric Liu via cfe-commits
Author: ioeric Date: Mon Nov 14 13:37:55 2016 New Revision: 286873 URL: http://llvm.org/viewvc/llvm-project?rev=286873&view=rev Log: [change-namespace] consider typedef/using alias decls in the moved namespace. Summary: If a TypeLoc refers to a type alias defined in the moved namespace, we do no

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-07-20 Thread Eric Liu via cfe-commits
ioeric added a comment. Ping https://reviews.llvm.org/D21748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-07-20 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 64675. ioeric marked 5 inline comments as done. ioeric added a comment. - Addressed review comments. https://reviews.llvm.org/D21748 Files: include/clang/Tooling/Core/Replacement.h include/clang/Tooling/Refactoring.h lib/Format/Format.cpp lib/Format/

Re: [PATCH] D22567: [include-fixer] Add mising qualifiers to all instances of an unidentified symbol.

2016-07-20 Thread Eric Liu via cfe-commits
ioeric added a subscriber: ioeric. Comment at: include-fixer/tool/ClangIncludeFixer.cpp:365 @@ +364,3 @@ + for (const auto &Info : Context.getQuerySymbolInfos()) { +Replacements->insert({FilePath, Info.Range.getOffset(), + Info.Range.getLength(),

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-07-25 Thread Eric Liu via cfe-commits
ioeric added a comment. ping :) https://reviews.llvm.org/D21748 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D22808: [Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace.

2016-07-26 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added a reviewer: bkramer. ioeric added a subscriber: cfe-commits. Herald added a subscriber: klimek. [Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace. https://reviews.llvm.org/D22808 Fil

r276754 - [Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace.

2016-07-26 Thread Eric Liu via cfe-commits
Author: ioeric Date: Tue Jul 26 09:53:05 2016 New Revision: 276754 URL: http://llvm.org/viewvc/llvm-project?rev=276754&view=rev Log: [Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace. Summary: [Tooling] skip anonymous namespa

Re: [PATCH] D22808: [Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace.

2016-07-26 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL276754: [Tooling] skip anonymous namespaces when checking if typeLoc references a… (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D22808?vs=65511&id=65520#toc Repository: rL

Re: [PATCH] D21749: Changes related to new implementation of tooling::Replacements as class.

2016-07-27 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 65685. ioeric added a comment. - Merged with origin/master. https://reviews.llvm.org/D21749 Files: clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp clang-a

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-07-27 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 65686. ioeric added a comment. - Moved ReplacementTest and toReplacements to ReplacementTest.h - Merge branch 'master' of http://llvm.org/git/clang into replace https://reviews.llvm.org/D21748 Files: include/clang/Tooling/Core/Replacement.h include/clang

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-07-27 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 65687. ioeric added a comment. - Clean up ReplacemenTest.h header a bit. https://reviews.llvm.org/D21748 Files: include/clang/Tooling/Core/Replacement.h include/clang/Tooling/Refactoring.h lib/Format/Format.cpp lib/Format/SortJavaScriptImports.cpp

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-07-27 Thread Eric Liu via cfe-commits
ioeric marked an inline comment as done. Comment at: unittests/Tooling/RefactoringTest.cpp:112 @@ -111,4 +111,3 @@ -TEST_F(ReplacementTest, CanApplyReplacements) { - FileID ID = Context.createInMemoryFile("input.cpp", - "line1\nline2\nlin

Re: [PATCH] D22854: change Vim key binding for include-fixer and clang-rename

2016-07-27 Thread Eric Liu via cfe-commits
ioeric added a comment. Could you briefly explain what is and how to lookup/set it in the doc, or at least provide reference? https://reviews.llvm.org/D22854 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mai

Re: [PATCH] D21749: Changes related to new implementation of tooling::Replacements as class.

2016-07-27 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 65712. ioeric added a comment. - Minor cleanup/ https://reviews.llvm.org/D21749 Files: clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp clang-apply-replace

Re: [PATCH] D22854: change Vim key binding for include-fixer and clang-rename

2016-07-27 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: docs/clang-rename.rst:98 @@ +97,3 @@ + +Once installed, you can point your cursor to the symbols you want to rename, +press ``cr`` and print new desired name. The s/the symbols/symbols/ Comment at: docs/c

Re: [PATCH] D22854: change Vim key binding for include-fixer and clang-rename

2016-07-27 Thread Eric Liu via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Comment at: docs/clang-rename.rst:101 @@ +100,3 @@ +[`` key``](http://vim.wikia.com/wiki/Mapping_keys_in_Vim_-_Tutorial_(Part_3)#Map_leader) +is a reference to a specifi

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-07-29 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 66093. ioeric marked an inline comment as done. ioeric added a comment. - getShiftedCodePosition: do not minus 1 when there is no replacement text. https://reviews.llvm.org/D21748 Files: include/clang/Tooling/Core/Replacement.h include/clang/Tooling/Refa

Re: [PATCH] D21749: Changes related to new implementation of tooling::Replacements as class.

2016-08-01 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 66295. ioeric added a comment. - merged with origin/master https://reviews.llvm.org/D21749 Files: clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp clang-ap

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-08-01 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 66294. ioeric added a comment. - Merge branch 'master' of http://llvm.org/git/clang into replace https://reviews.llvm.org/D21748 Files: include/clang/Tooling/Core/Replacement.h include/clang/Tooling/Refactoring.h lib/Format/Format.cpp lib/Format/Sort

r277335 - Implement tooling::Replacements as a class.

2016-08-01 Thread Eric Liu via cfe-commits
Author: ioeric Date: Mon Aug 1 05:16:37 2016 New Revision: 277335 URL: http://llvm.org/viewvc/llvm-project?rev=277335&view=rev Log: Implement tooling::Replacements as a class. Summary: - Implement clang::tooling::Replacements as a class to provide interfaces to control how replacements for a s

[clang-tools-extra] r277336 - Changes related to new implementation of tooling::Replacements as class.

2016-08-01 Thread Eric Liu via cfe-commits
Author: ioeric Date: Mon Aug 1 05:16:39 2016 New Revision: 277336 URL: http://llvm.org/viewvc/llvm-project?rev=277336&view=rev Log: Changes related to new implementation of tooling::Replacements as class. Summary: See http://reviews.llvm.org/D21748 for details. Reviewers: djasper, klimek Subsc

Re: [PATCH] D21749: Changes related to new implementation of tooling::Replacements as class.

2016-08-01 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL277336: Changes related to new implementation of tooling::Replacements as class. (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D21749?vs=66295&id=66298#toc Repository: rL LL

Re: [PATCH] D21748: Implement tooling::Replacements as a class.

2016-08-01 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL277335: Implement tooling::Replacements as a class. (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D21748?vs=66294&id=66297#toc Repository: rL LLVM https://reviews.llvm.org/

Re: [PATCH] D23119: Fix quadratic runtime when adding items to tooling::Replacements.

2016-08-03 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: cfe/trunk/lib/Tooling/Core/Replacement.cpp:169 @@ +168,3 @@ + // starts after R is (I+1). + if (I != Replaces.end() && *I == R) +++I; I think we should ignore replacement text when checking equality between `*I` and

[PATCH] D23257: Fix clang-tidy crash when a single fix is applied on multiple files.

2016-08-08 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added reviewers: alexfh, hokein. ioeric added a subscriber: cfe-commits. tooling::Replacements only holds replacements for a single file, so this patch makes Fix a map from file paths to tooling::Replacements so that it can be applied on multiple files. https:

[PATCH] D23264: Fixes calculateRangesAfterReplacements crash when Replacements is empty.

2016-08-08 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added reviewers: klimek, djasper. ioeric added a subscriber: cfe-commits. Herald added a subscriber: klimek. https://reviews.llvm.org/D23264 Files: lib/Tooling/Core/Replacement.cpp unittests/Tooling/RefactoringTest.cpp Index: unittests/Tooling/Refactoring

r278004 - Fixes calculateRangesAfterReplacements crash when Replacements is empty.

2016-08-08 Thread Eric Liu via cfe-commits
Author: ioeric Date: Mon Aug 8 08:37:39 2016 New Revision: 278004 URL: http://llvm.org/viewvc/llvm-project?rev=278004&view=rev Log: Fixes calculateRangesAfterReplacements crash when Replacements is empty. Reviewers: klimek, djasper Subscribers: cfe-commits, klimek Differential Revision: https:

Re: [PATCH] D23264: Fixes calculateRangesAfterReplacements crash when Replacements is empty.

2016-08-08 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278004: Fixes calculateRangesAfterReplacements crash when Replacements is empty. (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D23264?vs=67155&id=67156#toc Repository: rL LL

Re: [PATCH] D23257: Fix clang-tidy crash when a single fix is applied on multiple files.

2016-08-08 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 67164. ioeric marked 4 inline comments as done. ioeric added a comment. - Addressed reviewers' comments. https://reviews.llvm.org/D23257 Files: clang-tidy/ClangTidy.cpp clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h

[PATCH] D23274: Add an option to clang-format to remove duplicate headers.

2016-08-08 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added a reviewer: djasper. ioeric added a subscriber: cfe-commits. Herald added a subscriber: klimek. https://reviews.llvm.org/D23274 Files: include/clang/Format/Format.h lib/Format/Format.cpp test/Format/remove-duplicate-includes.cpp tools/clang-forma

Re: [PATCH] D23274: Add an option to clang-format to remove duplicate headers.

2016-08-08 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 67191. ioeric added a comment. - Check code that is not in affected range is not reformatted in lit test. https://reviews.llvm.org/D23274 Files: include/clang/Format/Format.h lib/Format/Format.cpp test/Format/remove-duplicate-includes.cpp tools/clang

Re: [PATCH] D23257: Fix clang-tidy crash when a single fix is applied on multiple files.

2016-08-08 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 67193. ioeric marked 2 inline comments as done. ioeric added a comment. - Update test to not use https://reviews.llvm.org/D23257 Files: clang-tidy/ClangTidy.cpp clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h test

Re: [PATCH] D23257: Fix clang-tidy crash when a single fix is applied on multiple files.

2016-08-09 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 67292. ioeric marked 4 inline comments as done. ioeric added a comment. - Nits fixed https://reviews.llvm.org/D23257 Files: clang-tidy/ClangTidy.cpp clang-tidy/ClangTidyDiagnosticConsumer.cpp clang-tidy/ClangTidyDiagnosticConsumer.h test/clang-tidy/I

[clang-tools-extra] r278101 - Fix clang-tidy crash when a single fix is applied on multiple files.

2016-08-09 Thread Eric Liu via cfe-commits
Author: ioeric Date: Tue Aug 9 02:54:49 2016 New Revision: 278101 URL: http://llvm.org/viewvc/llvm-project?rev=278101&view=rev Log: Fix clang-tidy crash when a single fix is applied on multiple files. Summary: tooling::Replacements only holds replacements for a single file, so this patch makes F

Re: [PATCH] D23257: Fix clang-tidy crash when a single fix is applied on multiple files.

2016-08-09 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278101: Fix clang-tidy crash when a single fix is applied on multiple files. (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D23257?vs=67292&id=67293#toc Repository: rL LLVM

Re: [PATCH] D23274: Add an style option "DeduplicateIncludes" to clang-format to remove duplicate headers when sorting #includes.

2016-08-10 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 67483. ioeric marked an inline comment as done. ioeric added a comment. - Addressed review comments. https://reviews.llvm.org/D23274 Files: include/clang/Format/Format.h lib/Format/Format.cpp test/Format/remove-duplicate-includes.cpp tools/clang-form

Re: [PATCH] D23274: Add an style option "DeduplicateIncludes" to clang-format to remove duplicate headers when sorting #includes.

2016-08-10 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: include/clang/Format/Format.h:551 @@ +550,3 @@ + /// sorting ``#includes``. + bool DeduplicateIncludes; + Sounds good to me. I'll get rid of the option then. https://reviews.llvm.org/D23274 _

Re: [PATCH] D23274: Add an style option "DeduplicateIncludes" to clang-format to remove duplicate headers when sorting #includes.

2016-08-10 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 67484. ioeric added a comment. - Always deduplicate when sorting includes. Get rid of the option. https://reviews.llvm.org/D23274 Files: lib/Format/Format.cpp test/Format/remove-duplicate-includes.cpp tools/clang-format/ClangFormat.cpp unittests/Form

Re: [PATCH] D23274: Make clang-format remove duplicate headers when sorting #includes.

2016-08-10 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 67489. ioeric marked 3 inline comments as done. ioeric added a comment. - Addressed review comments. https://reviews.llvm.org/D23274 Files: lib/Format/Format.cpp test/Format/remove-duplicate-includes.cpp tools/clang-format/ClangFormat.cpp unittests/F

r278206 - Make clang-format remove duplicate headers when sorting #includes.

2016-08-10 Thread Eric Liu via cfe-commits
Author: ioeric Date: Wed Aug 10 04:32:23 2016 New Revision: 278206 URL: http://llvm.org/viewvc/llvm-project?rev=278206&view=rev Log: Make clang-format remove duplicate headers when sorting #includes. Summary: When sorting #includes, #include directives that have the same text will be deduplicate

Re: [PATCH] D23274: Make clang-format remove duplicate headers when sorting #includes.

2016-08-10 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL278206: Make clang-format remove duplicate headers when sorting #includes. (authored by ioeric). Changed prior to commit: https://reviews.llvm.org/D23274?vs=67489&id=67492#toc Repository: rL LLVM ht

[PATCH] D19587: Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.

2016-04-27 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added reviewers: djasper, klimek. ioeric added a subscriber: cfe-commits. Herald added a subscriber: klimek. Make SourceManager in Environment, WhitespaceManager, and FormatTokenAnalyzer etc constant members. http://reviews.llvm.org/D19587 Files: lib/Forma

Re: [PATCH] D18551: Added Fixer implementation and fix() interface in clang-format for removing redundant code.

2016-04-27 Thread Eric Liu via cfe-commits
ioeric marked 6 inline comments as done. Comment at: cfe/trunk/lib/Format/Format.cpp:1355 @@ -1352,2 +1354,3 @@ std::find(ForEachMacros.begin(), ForEachMacros.end(), -FormatTok->Tok.getIdentifierInfo()) != ForEachMacros.end()) { +

Re: [PATCH] D19587: Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.

2016-04-28 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 55382. ioeric added a comment. - removed redundant '#' http://reviews.llvm.org/D19587 Files: lib/Format/AffectedRangeManager.h lib/Format/ContinuationIndenter.cpp lib/Format/ContinuationIndenter.h lib/Format/Format.cpp lib/Format/WhitespaceManager.

r267859 - Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.

2016-04-28 Thread Eric Liu via cfe-commits
Author: ioeric Date: Thu Apr 28 02:52:03 2016 New Revision: 267859 URL: http://llvm.org/viewvc/llvm-project?rev=267859&view=rev Log: Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551. Summary: Make SourceManager in Environment, WhitespaceManager, and FormatTokenA

r267858 - Addressed review's comments.

2016-04-28 Thread Eric Liu via cfe-commits
Author: ioeric Date: Thu Apr 28 02:51:47 2016 New Revision: 267858 URL: http://llvm.org/viewvc/llvm-project?rev=267858&view=rev Log: Addressed review's comments. Modified: cfe/trunk/lib/Format/AffectedRangeManager.h cfe/trunk/lib/Format/Format.cpp Modified: cfe/trunk/lib/Format/AffectedR

r267860 - removed redundant '#'

2016-04-28 Thread Eric Liu via cfe-commits
Author: ioeric Date: Thu Apr 28 02:52:06 2016 New Revision: 267860 URL: http://llvm.org/viewvc/llvm-project?rev=267860&view=rev Log: removed redundant '#' Modified: cfe/trunk/lib/Format/AffectedRangeManager.h Modified: cfe/trunk/lib/Format/AffectedRangeManager.h URL: http://llvm.org/viewvc/

Re: [PATCH] D19587: Addressed reviewer's post-submission comments from http://reviews.llvm.org/D18551.

2016-04-28 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL267859: Addressed reviewer's post-submission comments from http://reviews.llvm. (authored by ioeric). Changed prior to commit: http://reviews.llvm.org/D19587?vs=55382&id=55383#toc Repository: rL LLVM

[PATCH] D19804: Make clang-format cleaner remove redundant commas/colons in constructor initializer list.

2016-05-02 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added reviewers: djasper, klimek. ioeric added a subscriber: cfe-commits. Herald added a subscriber: klimek. Make clang-format cleaner remove redundant commas/colons in constructor initializer list. http://reviews.llvm.org/D19804 Files: lib/Format/Format.c

Re: [PATCH] D19869: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.

2016-05-03 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 56026. ioeric marked an inline comment as done. ioeric added a comment. - Addressed reviewer comment. http://reviews.llvm.org/D19869 Files: include-fixer/CMakeLists.txt include-fixer/InMemoryXrefsDB.cpp include-fixer/InMemoryXrefsDB.h include-fixer/I

Re: [PATCH] D19869: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.

2016-05-03 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: include-fixer/InMemoryXrefsDB.cpp:24-26 @@ +23,5 @@ +for (const auto &Header : Entry.second) { + SymbolInfo Info; + Info.Name = Names.back(); + Info.FilePath = Header; + for (auto IdentiferContext = Names.rbegin() +

Re: [PATCH] D19869: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.

2016-05-03 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: include-fixer/IncludeFixer.h:34-35 @@ -33,3 +33,4 @@ IncludeFixerActionFactory( - XrefsDB &Xrefs, std::vector &Replacements, + XrefsDBManager &XrefsDBMgr, + std::vector &Replacements, bool MinimizeIncludePaths = tr

Re: [PATCH] D19869: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.

2016-05-04 Thread Eric Liu via cfe-commits
ioeric updated this revision to Diff 56104. ioeric marked 8 inline comments as done. ioeric added a comment. - Added FIXMEs and fixed a nit. http://reviews.llvm.org/D19869 Files: include-fixer/CMakeLists.txt include-fixer/InMemoryXrefsDB.cpp include-fixer/InMemoryXrefsDB.h include-fixer

[clang-tools-extra] r268480 - Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.

2016-05-04 Thread Eric Liu via cfe-commits
Author: ioeric Date: Wed May 4 03:22:35 2016 New Revision: 268480 URL: http://llvm.org/viewvc/llvm-project?rev=268480&view=rev Log: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo. Summary: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo. R

Re: [PATCH] D19869: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.

2016-05-04 Thread Eric Liu via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL268480: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo. (authored by ioeric). Changed prior to commit: http://reviews.llvm.org/D19869?vs=56104&id=56105#toc Repository: rL

[PATCH] D19913: Added static creators that create complete instances of SymbolInfo.

2016-05-04 Thread Eric Liu via cfe-commits
ioeric created this revision. ioeric added reviewers: klimek, hokein. ioeric added a subscriber: cfe-commits. Added static creators that create complete instances of SymbolInfo. http://reviews.llvm.org/D19913 Files: include-fixer/InMemoryXrefsDB.cpp include-fixer/find-all-symbols/SymbolInfo.

Re: [PATCH] D19913: Added static creators that create complete instances of SymbolInfo.

2016-05-04 Thread Eric Liu via cfe-commits
ioeric added inline comments. Comment at: include-fixer/find-all-symbols/SymbolInfo.h:90-93 @@ +89,6 @@ + + static SymbolInfo + CreateFunctionSymbolInfo(const std::string &Name, const std::string &FilePath, + const std::vector &Contexts, int LineNumbe

<    2   3   4   5   6   7   8   9   10   >