summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/change-namespace/ChangeNamespace.h
Commit message (Collapse)AuthorAgeFilesLines
* Rename directory housing clang-change-namespace to be eponymousNico Weber2019-03-151-175/+0
| | | | | | | | | Makes the name of this directory consistent with the names of the other directories in clang-tools-extra. Differential Revision: https://reviews.llvm.org/D59382 llvm-svn: 356254
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [change-namepsace] make it possible to whitelist symbols so they don't get ↵Eric Liu2017-02-241-0/+4
| | | | | | | | | | | | | | updated. Reviewers: hokein Reviewed By: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30328 llvm-svn: 296110
* [change-namespace] consider namespace aliases to shorten qualified names.Eric Liu2016-12-231-0/+3
| | | | | | | | | | Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28052 llvm-svn: 290421
* [change-namespace] do not fix calls to overloaded operator functions.Eric Liu2016-12-201-0/+4
| | | | | | | | | | | | Summary: Also make sure one function reference is only processed once. Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27982 llvm-svn: 290176
* [change-namespace] always add a '::' prefix when a symbol reference needs to ↵Eric Liu2016-12-071-1/+4
| | | | | | be fully-qualified. llvm-svn: 288969
* [change-namespace] move template class forward-declarations and don't move ↵Eric Liu2016-12-071-1/+1
| | | | | | | | | | | | | | | | | | fwd-decls in classes. Summary: Forward declarations in moved namespaces should be moved back to the old namespaces. We should also move template class forward declarations. Also fix a bug that moves forward declarations of nested classes. Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27515 llvm-svn: 288908
* [change-namespace] don't generate replacements for files that don't match ↵Eric Liu2016-12-011-0/+2
| | | | | | | | | | | | file pattern. Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27302 llvm-svn: 288376
* [change-namespace] fix non-calling function references.Eric Liu2016-11-291-0/+4
| | | | | | | | | | Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27208 llvm-svn: 288139
* [change-namespace] handle constructor initializer: Derived : Base::Base() {} ↵Eric Liu2016-11-161-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | and added conflict detections Summary: namespace nx { namespace ny { class Base { public: Base(i) {}} } } namespace na { namespace nb { class X : public nx::ny { public: X() : Base::Base(1) {} }; } } When changing from na::nb to x::y, "Base::Base" will be changed to "nx::ny::Base" and "Base::" in "Base::Base" will be replaced with "nx::ny::Base" too, which causes conflict. This conflict should've been detected when adding replacements but was hidden by `addOrMergeReplacement`. We now also detect conflict when adding replacements where conflict must not happen. The namespace lookup is tricky here, we simply replace "Base::Base()" with "nx::ny::Base()" as a workaround, which compiles but not perfect. Reviewers: hokein Subscribers: bkramer, cfe-commits Differential Revision: https://reviews.llvm.org/D26637 llvm-svn: 287118
* [change-namespace] shorten namespace qualifier based on UsingDecl and ↵Eric Liu2016-11-081-2/+8
| | | | | | | | | | | | | | | | | UsingDirectiveDecl. Summary: when replacing symbol references in moved namespaces, trying to make the replace name as short as possible by considering UsingDecl (i.e. UsingShadow) and UsingDirectiveDecl (i.e. using namespace decl). Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D25771 llvm-svn: 286307
* [change-namespace] fix name qualifiers in UsingShadowDecl and ↵Eric Liu2016-09-211-0/+3
| | | | | | | | | | | | NestedNameSpecifier. Reviewers: hokein Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D24784 llvm-svn: 282073
* Trying to fix name conflict in change-namespace tool.Eric Liu2016-09-191-2/+2
| | | | llvm-svn: 281920
* A clang tool for changing surrouding namespaces of class/function definitions.Eric Liu2016-09-191-0/+144
Summary: A tool for changing surrouding namespaces of class/function definitions while keeping references to types in the changed namespace correctly qualified by prepending namespace specifiers before them. Example: test.cc namespace na { class X {}; namespace nb { class Y { X x; }; } // namespace nb } // namespace na To move the definition of class Y from namespace "na::nb" to "x::y", run: clang-change-namespace --old_namespace "na::nb" \ --new_namespace "x::y" --file_pattern "test.cc" test.cc -- Output: namespace na { class X {}; } // namespace na namespace x { namespace y { class Y { na::X x; }; } // namespace y } // namespace x Reviewers: alexfh, omtcyfz, hokein Subscribers: mgorny, klimek, djasper, beanz, alexshap, Eugene.Zelenko, cfe-commits Differential Revision: https://reviews.llvm.org/D24183 llvm-svn: 281918
OpenPOWER on IntegriCloud