summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-move
Commit message (Collapse)AuthorAgeFilesLines
...
* [clang-move] Fix buildbot failuresAlexander Shaposhnikov2016-12-121-1/+2
| | | | | | Fix the buildbot failures introduced by D27669 llvm-svn: 289465
* [clang-move] Use appendArgumentsAdjuster for adding extra argumentsAlexander Shaposhnikov2016-12-121-25/+17
| | | | | | | | | | | 1. Remove some boilerplate code for appending -fparse-all-comments to the list of arguments. 2. Run clang-format -i against ClangMoveMain.cpp. Test plan: make check-all Differential revision: https://reviews.llvm.org/D27669 llvm-svn: 289464
* [clang-move] ignore unsupported symbol kinds when checking if all symbols ↵Eric Liu2016-12-062-2/+21
| | | | | | are moved. llvm-svn: 288791
* [clang-move] don't miss ',' in json output when there are duplicate elements.Eric Liu2016-12-031-10/+8
| | | | llvm-svn: 288586
* [clang-move] some tweaks.Haojian Wu2016-12-022-71/+61
| | | | | | | | | * Don't save SourceManager for each declarations. * Rename some out-dated methods. No functionality change. llvm-svn: 288498
* [clang-move] Enable dump all declarations in old header.Haojian Wu2016-11-243-121/+202
| | | | | | | | | | | | | | | | | | | Summary: * Add -dump_dels option to dump all declarations from old header. It will allow clang-move used as a frontend to get declarations from header. Further more, this will make debugging stuff easier. Currently only class/function types are supported. * Refactoring code a little bit by creating a ClangMoveContext which holds all options for ClangMoveTool, which can simplify the code in some degree. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27059 llvm-svn: 287863
* [clang-move] Add some options allowing to add old/new.h to new/old.h ↵Haojian Wu2016-11-233-13/+81
| | | | | | | | | | | | | | | | respectively. Summary: * --new_depend_on_old: new header will include old header * --old_depend_on_new: old header will include new header. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26966 llvm-svn: 287752
* [clang-move] Fix not moving using-decls in global namespace in old.ccHaojian Wu2016-11-181-9/+12
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26844 llvm-svn: 287330
* [clang-move] Support moving function.Haojian Wu2016-11-161-11/+38
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26665 llvm-svn: 287101
* [clang-move] Make the output code look more pretty.Haojian Wu2016-11-151-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add decent blank lines between declarations: * Add extra blank line after #define or #includes. * Add extra blank line between declarations. * Add extra blank line in front of #endif. Previously, the new generated code is quite tight: ``` #ifndef FOO_H #define FOO_H namespace a { class A { public: int f(); }; int A::f() { return 0; } } // namespace a #endif // FOO_H ``` After this patch, the code looks like: ``` #ifndef FOO_H #define FOO_H namespace a { class A { public: int f(); }; int A::f() { return 0; } } // namespace a #endif // FOO_H ``` Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26493 llvm-svn: 286943
* [clang-move] Fix an incorrect range for the functions whose returned value ↵Haojian Wu2016-11-141-2/+2
| | | | | | | | | | | | | | | | | | | is a macro Summary: Fix an incorrect range for the functions whose returned value is a macro (e.g. `bool`). This incorrect range can lead to modifications of an unexpected file where the macro is in. We should use expansion location instead of spelling location. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26609 llvm-svn: 286833
* [clang-move] Abstract a ClassMather for matching class declarations.Haojian Wu2016-11-142-50/+95
| | | | | | | | | | | | | | | | Summary: No functionality change. This is a refactoring patch, which makes the code more readable and easy to extend it to support more types. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26515 llvm-svn: 286825
* Fix -Wdocumentation warningSimon Pilgrim2016-11-101-1/+1
| | | | llvm-svn: 286449
* [clang-move] Support template class.Haojian Wu2016-11-101-11/+21
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26423 llvm-svn: 286427
* [clang-move] Move all code from old.h/cc directly when moving all class ↵Haojian Wu2016-11-082-19/+102
| | | | | | | | | | | | | | declarations from old.h. Summary: When moving all code to new.h/cc, these code also will be formatted based on the given code style. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26236 llvm-svn: 286281
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-083-48/+41
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 llvm-svn: 286221
* [clang-move] Support moving template class forward declarations.Haojian Wu2016-10-211-2/+7
| | | | llvm-svn: 284859
* [clang-move] Move using-decl in old cc.Haojian Wu2016-10-191-14/+27
| | | | | | | | | | | | | | Summary: Another fix is to move the whole anonymous namespace declaration completely instead of moving fun/var declarations only. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25762 llvm-svn: 284592
* [clang-move] Fix generating illegal header guard.Haojian Wu2016-10-171-4/+4
| | | | | | | | The filepath might contain some characters (i.e. '@') which are not illegal in c identifiers. This patch changes all non-alphanumeric characters to '_'. llvm-svn: 284391
* [clang-move] Use cl::list for the list of namesAlexander Shaposhnikov2016-10-143-11/+8
| | | | | | | | | | This diff replaces manual parsing of the comma-separated list of names with cl::list and cl::CommaSeparated. Test plan: make -j8 check-clang-tools Differential revision: https://reviews.llvm.org/D25586 llvm-svn: 284291
* [clang-move] Don't overuse Replacements::add.Haojian Wu2016-10-141-58/+20
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25613 llvm-svn: 284236
* [clang-move] Add header guard for the new header.Haojian Wu2016-10-141-2/+22
| | | | | | | | | | | | | | | | | | Summary: The header guard generated by clang-move isn't always a perfect style, just avoid getting the header included multiple times during compiling period. Also, we can use llvm-Header-guard clang-tidy check to correct the guard automatically. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25610 llvm-svn: 284233
* [clang-move] Matching static class member more correctly.Haojian Wu2016-10-141-1/+7
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25598 llvm-svn: 284221
* [clang-move] error out when fail to create new files.Eric Liu2016-10-131-4/+16
| | | | llvm-svn: 284155
* Print stack trace for clang-move tool.Eric Liu2016-10-131-1/+3
| | | | llvm-svn: 284148
* [clang-move] Better support enclosing class.Haojian Wu2016-10-131-6/+32
| | | | | | | | | | | | | | | Summary: * When moving an outermost enclosing class, all its nested classes should also be moved together. * Add a test for not moving nested class. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25369 llvm-svn: 284111
* Recommit r283538 "[clang-move] Support moving multiple classes in one run."Haojian Wu2016-10-133-10/+25
| | | | llvm-svn: 284109
* [clang-move] Compare with real paths of symlinksHaojian Wu2016-10-121-9/+22
| | | | | | | | | | | | Summary: MakeAbsolutePath does wrong things with symlinks previously. When comparing with a symlink, we need to compare with the real path of it. This fixes issues when the build directory is a symlink. Reviewers: ioeric Subscribers: beanz, mgorny, cfe-commits, bkramer Differential Revision: https://reviews.llvm.org/D25508 llvm-svn: 284020
* Revert "[clang-move] Support moving multiple classes in one run."Renato Golin2016-10-073-25/+10
| | | | | | | | | | | This reverts commit r283526 et al as it keeps randomly breaking bots, even after the commit has gone, on other people's commit ranges. Revert "[clang-move] Simplify lint tests" (r283545). Revert "Fix buildbot error." (r283534). Revert "Revert "fix buildbot error" since it is not right fix." (r283538). llvm-svn: 283553
* [clang-move] Support moving multiple classes in one run.Haojian Wu2016-10-073-10/+25
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25309 llvm-svn: 283526
* [clang-move] Move comments which are associated with the moved class.Haojian Wu2016-10-063-27/+82
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25227 llvm-svn: 283425
* [clang-move] Cleanup around replacements.Haojian Wu2016-10-063-15/+36
| | | | | | | | | | | | | | Summary: cleanup the remaining empty namespace after moving out the class defintitions. Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25282 llvm-svn: 283424
* Fix a documentation warning.Haojian Wu2016-10-041-1/+1
| | | | llvm-svn: 283211
* Fix windows builtbot error.Haojian Wu2016-10-041-0/+2
| | | | llvm-svn: 283205
* [clang-move] Make it support both relative and absolute file path arguments.Haojian Wu2016-10-043-38/+142
| | | | | | | | | | Reviewers: ioeric Subscribers: beanz, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D24922 llvm-svn: 283202
* [clang-move] Use isStaticStorageClass matcher.Haojian Wu2016-09-271-9/+3
| | | | llvm-svn: 282477
* [clang-move] The new.cc file should include new_header.h instead of old_header.hHaojian Wu2016-09-232-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, all #includes (includeing old_header.h) in old.cc will be copied to new.cc, however, the new.cc should include new_header.h instead of the old_header.h Before applying the patch, the new.cc looks like: ``` #include "old_header.h" ... ``` The new.cc looks like with this patch: ``` #include "new_header" ... ``` Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24828 llvm-svn: 282247
* [clang-move] A prototype tool for moving class definition to new file.Haojian Wu2016-09-215-0/+618
Summary: This patch introduces a new tool which moves a specific class definition from files (.h, .cc) to new files (.h, .cc), which mostly acts like "Extract class defintion". In the long term, this tool should be merged in to clang-refactoring as a subtool. clang-move not only moves class definition, but also moves all the forward declarations, functions defined in anonymous namespace and #include headers to new files, to make sure the new files are compliable as much as possible. To move `Foo` from old.[h/cc] to new.[h/cc], use: ``` clang-move -name=Foo -old_header=old.h -old_cc=old.cc -new_header=new.h -new_cc=new.cc old.cc ``` To move `Foo` from old.h to new.h, use: ``` clang-move -name=Foo -old_header=old.h -new_header=new.h old.cc ``` Reviewers: klimek, djasper, ioeric Subscribers: mgorny, beanz, Eugene.Zelenko, bkramer, omtcyfz, cfe-commits Differential Revision: https://reviews.llvm.org/D24243 llvm-svn: 282070
OpenPOWER on IntegriCloud