summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-move
Commit message (Collapse)AuthorAgeFilesLines
* NFC: Fix trivial typos in commentsKazuaki Ishizaki2020-01-041-1/+1
|
* Revert "Use InitLLVM to setup a pretty stack printer"Nico Weber2019-11-251-2/+1
| | | | | | | This reverts commit 3f76260dc0674cc0acb25f550a0f0c594cf537ea. Breaks at least these tests on Windows: Clang :: Driver/clang-offload-bundler.c Clang :: Driver/clang-offload-wrapper.c
* Use InitLLVM to setup a pretty stack printerRui Ueyama2019-11-261-1/+2
| | | | | | | | | | | | | | InitLLVM does not only save a few lines from main() but also makes the commands do the right thing for multibyte character pathnames on Windows (i.e. canonicalize argv's to UTF-8) because of the code we have in this file: https://github.com/llvm/llvm-project/blob/master/llvm/lib/Support/InitLLVM.cpp#L32 For many LLVM commands, we already have calls of InitLLVM, but there are still remainings. Differential Revision: https://reviews.llvm.org/D70702
* [clang-tools-extra] [cmake] Link against libclang-cpp whenever possibleMichal Gorny2019-10-041-2/+5
| | | | | | | | | Use clang_target_link_libraries() in order to support linking against libclang-cpp instead of static libraries. Differential Revision: https://reviews.llvm.org/D68448 llvm-svn: 373786
* [clang-tools-extra] [cmake] Use add_clang_tool() to install toolsMichal Gorny2019-10-041-1/+1
| | | | | | | | | | | | Replace add_clang_executable() calls with add_clang_tool() that takes care of creating correct, distribution-friendly install target. While at it, remove redundant install calls. This change also causes clang-move and pp-trace to be installed. Differential Revision: https://reviews.llvm.org/D68423 llvm-svn: 373694
* Changed FrontendActionFactory::create to return a std::unique_ptrDmitri Gribenko2019-08-291-2/+2
| | | | | | | | | | Subscribers: jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66947 llvm-svn: 370379
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-142-7/+7
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* Rename F_{None,Text,Append} to OF_{None,Text,Append}. NFCFangrui Song2019-08-051-1/+1
| | | | | | F_{None,Text,Append} are kept for compatibility since r334221. llvm-svn: 367800
* [clang-tools-extra] Adopt FileManager's error-returning APIsHarlan Haskins2019-08-012-7/+7
| | | | | | | | The FileManager has been updated to return llvm::ErrorOr from getFile and getDirectory, this commit updates all the callers of those APIs from clang. llvm-svn: 367617
* Basic: Return a reference from FileManager::getVirtualFileSystem, NFCDuncan P. N. Exon Smith2019-03-261-2/+1
| | | | | | | | | | FileManager constructs a VFS in its constructor if it isn't passed one, and there's no way to reset it. Make that contract clear by returning a reference from its accessor. https://reviews.llvm.org/D59388 llvm-svn: 357038
* Rename directory housing clang-include-fixer to be eponymousNico Weber2019-03-251-1/+1
| | | | | | | | | | | Makes the name of this directory consistent with the names of the other directories in clang-tools-extra. Similar to r356254. No intended behavior change. Differential Revision: https://reviews.llvm.org/D59750 llvm-svn: 356897
* Make clang-move use same file naming convention as other toolsNico Weber2019-03-226-8/+8
| | | | | | | | | | | | 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
* Fix file headers. NFCFangrui Song2019-03-011-1/+1
| | | | llvm-svn: 355188
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-195-20/+15
| | | | | | | | | | | | | | | | | 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
* Add explicit dependency on clangSerialization after rC348911Fangrui Song2018-12-122-0/+2
| | | | llvm-svn: 348916
* [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] Fix broken json output.Eric Liu2018-10-091-3/+4
| | | | llvm-svn: 344055
* [clang-move] Dump whether a declaration is templated.Eric Liu2018-10-083-19/+29
| | | | 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
* [FileSystem] Split up the OpenFlags enumeration.Zachary Turner2018-06-071-2/+2
| | | | | | | | | | | | | | | | | This breaks the OpenFlags enumeration into two separate enumerations: OpenFlags and CreationDisposition. The first controls the behavior of the API depending on whether or not the target file already exists, and is not a flags-based enum. The second controls more flags-like values. This yields a more easy to understand API, while also allowing flags to be passed to the openForRead api, where most of the values didn't make sense before. This also makes the apis more testable as it becomes easy to enumerate all the configurations which make sense, so I've added many new tests to exercise all the different values. llvm-svn: 334221
* 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-152-15/+15
| | | | | | | | | | | 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
* Revert "[Tooling] [1/1] Refactor FrontendActionFactory::create() to return ↵Roman Lebedev2018-02-271-2/+2
| | | | | | | | | | | | std::unique_ptr<>" This reverts commit rL326202 This broke gcc4.8 builds, compiler just segfaults: http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/14909 http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/22673 llvm-svn: 326203
* [Tooling] [1/1] Refactor FrontendActionFactory::create() to return ↵Roman Lebedev2018-02-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | std::unique_ptr<> Summary: I'm not sure whether there are any principal reasons why it returns raw owning pointer, or it is just a old code that was not updated post-C++11. I'm not too sure what testing i should do, because `check-all` is not error clean here for some reason, but it does not //appear// asif those failures are related to these changes. This is Clang-tools-extra part. Clang part is D43779. Reviewers: klimek, bkramer, alexfh, pcc Reviewed By: alexfh Subscribers: ioeric, jkorous-apple, cfe-commits Tags: #clang, #clang-tools-extra Differential Revision: https://reviews.llvm.org/D43780 llvm-svn: 326202
* [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-312-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* [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] Create ClangMoveActionFactory on stackAlexander Shaposhnikov2017-04-141-4/+3
| | | | | | | | | | | This diff removes unnecessary using of unique_ptr with ClangMoveActionFactory (pico cleanup). NFC Test plan: make check-clang-tools Differential revision: https://reviews.llvm.org/D32063 llvm-svn: 300356
* [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-172-13/+34
| | | | | | | | | | | | 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-035-36/+360
| | | | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud