summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-move/ClangMove.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make clang-move use same file naming convention as other toolsNico Weber2019-03-221-937/+0
| | | | | | | | | | | | In all the other clang-foo tools, the main library file is called Foo.cpp and the file in the tool/ folder is called ClangFoo.cpp. Do this for clang-move too. No intended behavior change. Differential Revision: https://reviews.llvm.org/D59700 llvm-svn: 356780
* 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
* Fix build breakage from llvm r351317Pavel Labath2019-01-161-4/+1
| | | | | | | The two-argument version of llvm::sys::fs::make_absolute no longer returns an error code. llvm-svn: 351319
* [clang-move] Remove clang:: qualifierFangrui Song2018-10-111-69/+54
| | | | | | | | | | | | | | | | Summary: The use sites are enclosed by `namespace clang`, so clang:: is not necessary. Many unqualified names have already been used, e.g. SourceManager SourceLocation LangOptions. This change makes the code terser and more consistent. Reviewers: hokein Reviewed By: hokein Subscribers: ioeric, cfe-commits Differential Revision: https://reviews.llvm.org/D53060 llvm-svn: 344256
* [clang-move] Dump whether a declaration is templated.Eric Liu2018-10-081-7/+7
| | | | llvm-svn: 343982
* [clang-move] Explicitly ignore implicit UsingDirectiveDecls instead of ↵Argyrios Kyrtzidis2018-08-311-1/+2
| | | | | | | | | depending on them missing source locations This is adjustment to allow the logic to work even if implicit UsingDirectiveDecls get actual source locations. There should be no functionality change. llvm-svn: 341161
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-3/+3
| | | | | | | | Subscribers: nemanjai, ioeric, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D50355 llvm-svn: 339401
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-5/+5
| | | | | | | | | | Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 llvm-svn: 339400
* Replace hardcoded format styles in a few tools with the default style in ↵Eric Liu2018-08-021-1/+2
| | | | | | libFormat. llvm-svn: 338696
* Second attempt to fix clang-move tests broken by r332590 on windowsEric Liu2018-05-171-0/+2
| | | | | | | | | | http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/12010 Add back a path conversion removed in a previous attempt. I removed it because it didn't seem necessary. Added it back to see if this would fix the bot. llvm-svn: 332612
* Attempt to fix clang-move tests broken by r332590 on windowsEric Liu2018-05-171-8/+10
| | | | | | http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/12007 llvm-svn: 332603
* [clang-move] Fix a potential bug where realpath doesn't work on VFS.Eric Liu2018-05-161-5/+9
| | | | llvm-svn: 332518
* [clang-tools-extra] Update uses of DEBUG macro to LLVM_DEBUG.Nicola Zaghen2018-05-151-9/+9
| | | | | | | | | | | The DEBUG() macro is very generic so it might clash with other projects. The renaming was done as follows: - git grep -l 'DEBUG' | xargs sed -i 's/\bDEBUG\s\?(/LLVM_DEBUG(/g' - git diff -U0 master | ../clang/tools/clang-format/clang-format-diff.py -i -p1 -style LLVM Differential Revision: https://reviews.llvm.org/D44976 llvm-svn: 332371
* Reland "[tools] Updating PPCallbacks::InclusionDirective calls"Julie Hockett2018-05-101-1/+2
| | | | | | | | | This commit relands r331905. r331904 added SrcMgr::CharacteristicKind to the InclusionDirective callback, this revision updates instances of it in clang-tools-extra. llvm-svn: 332023
* Revert "[tools] Updating PPCallbacks::InclusionDirective calls"Julie Hockett2018-05-091-2/+1
| | | | | | This reverts commit r331905, since it's dependent on reverted r331905. llvm-svn: 331931
* [tools] Updating PPCallbacks::InclusionDirective callsJulie Hockett2018-05-091-1/+2
| | | | | | | | | [revision] added SrcMgr::CharacteristicKind to the InclusionDirective callback, this revision updates instances of it in clang-tools-extra. Differential Revision: https://reviews.llvm.org/D46615 llvm-svn: 331905
* Fix up after clang r331155.Richard Smith2018-04-301-1/+4
| | | | llvm-svn: 331156
* [clang-move] Fix the incorrect expansion end location.Haojian Wu2018-02-121-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: Before the fix, if clang-move decides to move the following macro statement, it only moves the first line `DEFINE(A,`. ``` DEFINE(A, B); ``` Reviewers: ioeric Reviewed By: ioeric Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43174 llvm-svn: 324886
* [clang-move] Don't dump macro symbols.Haojian Wu2018-02-091-4/+4
| | | | | | | | | | Reviewers: ioeric Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43075 llvm-svn: 324742
* [clang-move] Clever on handling header file which includes itself.Haojian Wu2018-01-311-14/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, we assume only old.cc includes "old.h", which would introduce incorrect fixes for the cases where old.h also includes `#include "old.h"` Although it should not be occurred in real projects, clang-move should handle this. Old.h: ``` class Foo {}; ``` after moving to a new old.h: ``` class Foo {}; ``` Reviewers: ioeric Reviewed By: ioeric Subscribers: cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D42639 llvm-svn: 323865
* [clang-move] Find template class forward declarations more precisely.Haojian Wu2017-05-021-6/+8
| | | | | | | | | | | | Reviewers: ioeric Reviewed By: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D32741 llvm-svn: 301914
* [clang-move] Extend clang-move to support moving global variable.Haojian Wu2017-02-271-1/+25
| | | | | | | | | | | | | | Summary: Also support dumping global variables. Reviewers: ioeric Reviewed By: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D30337 llvm-svn: 296337
* Remove dead code.Haojian Wu2017-01-171-3/+0
| | | | llvm-svn: 292218
* [clang-move] Handle helpers with forward declarations.Haojian Wu2017-01-171-10/+22
| | | | | | | | | | | | Reviewers: ioeric Reviewed By: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28801 llvm-svn: 292215
* [clang-move] Ignore using decls which are defined in macros.Haojian Wu2017-01-171-9/+13
| | | | | | | | | | | | | | | | | Summary: 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 behavior of clang-move more correct. Reviewers: ioeric Reviewed By: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28774 llvm-svn: 292207
* Update tools to use new getStyle APIAntonio Maiorano2017-01-171-3/+6
| | | | | | | | Depends on https://reviews.llvm.org/D28081 Differential Revision: https://reviews.llvm.org/D28315 llvm-svn: 292175
* [clang-move] Dump enum and type alias declarations.Haojian Wu2017-01-161-0/+6
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28293 llvm-svn: 292098
* [clang-move] Support moving type alias declarations.Haojian Wu2017-01-041-1/+34
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28279 llvm-svn: 290967
* [clang-move] Support moving enum declarations.Haojian Wu2017-01-031-14/+40
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D28228 llvm-svn: 290891
* [clang-move] Only move used helper declarations.Haojian Wu2017-01-031-29/+108
| | | | | | | | | | | | | | | | | Summary: Instead of moving all the helper declarations blindly, this patch implements an AST-based call graph solution to make clang-move only move used helper decls to new.cc and remove unused decls in old.cc. Depends on D27674. Reviewers: ioeric Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D27673 llvm-svn: 290873
* [clang-move] Fix incorrect EndLoc for declarations in macros.Haojian Wu2016-12-131-2/+3
| | | | | | | | | | Reviewers: ioeric Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D27713 llvm-svn: 289541
* [clang-move] ignore unsupported symbol kinds when checking if all symbols ↵Eric Liu2016-12-061-1/+18
| | | | | | are moved. llvm-svn: 288791
* [clang-move] some tweaks.Haojian Wu2016-12-021-54/+55
| | | | | | | | | * 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-241-59/+82
| | | | | | | | | | | | | | | | | | | 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-231-12/+44
| | | | | | | | | | | | | | | | 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-141-50/+83
| | | | | | | | | | | | | | | | 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
* [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-081-19/+84
| | | | | | | | | | | | | | 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-081-40/+35
| | | | | | | | | | | | | | | | 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-141-3/+1
| | | | | | | | | | 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
OpenPOWER on IntegriCloud