| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GCC tries to shorten system headers in depfiles using its real path
(resolving components like ".." and following symlinks). Mimic this
feature to ensure that the Ninja build tool detects the correct
dependencies when a symlink changes directory levels, see
https://github.com/ninja-build/ninja/issues/1330
An option to disable this feature is added in case "these changed header
paths may conflict with some compilation environments", see
https://gcc.gnu.org/ml/gcc-patches/2012-09/msg00287.html
Note that the original feature request for GCC
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52974) also included paths
preprocessed output (-E) and diagnostics. That is not implemented now
since I am not sure if it breaks something else.
Differential Revision: https://reviews.llvm.org/D37954
llvm-svn: 316193
|
|
|
|
|
|
|
| |
* Add missing override keyword.
* avoid unnecessary copy of std::string.
llvm-svn: 316152
|
|
|
|
|
|
|
|
|
|
|
| |
consecutive statements
This commit adds a CodeRangeASTSelection value to the refactoring library. This
value represents a set of selected statements in one body of code.
Differential Revision: https://reviews.llvm.org/D38835
llvm-svn: 316104
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
* Support rename alias.
* Add unittests for renaming alias.
* Don't generate fixes for the SourceLocations that are invalid or in temporary
buffer, otherwise crash would be happened when generating AtomicChanges.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D39043
llvm-svn: 316074
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
* Add unit tests for renaming enum.
* Support unscoped enum constants in expressions.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D38989
llvm-svn: 315999
|
|
|
|
|
|
|
|
|
| |
This commit allows the refactoring library to use its own set of
refactoring-specific diagnostics to reports things like initiation errors.
Differential Revision: https://reviews.llvm.org/D38772
llvm-svn: 315924
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Also contain a fix:
* Fix a false positive of renaming a using shadow function declaration.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D38882
llvm-svn: 315898
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The recommit fixes a UB bug that occurred only on a small number of bots.
Original message:
This commit adds initial support for refactoring options. One can now use
optional and required std::string options.
This commit also adds a NewNameOption for the local-rename refactoring action to
allow rename to work with custom names.
Differential Revision: https://reviews.llvm.org/D37856
llvm-svn: 315661
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit 4e4ee1c507e2707bb3c208e1e1b6551c3015cbf5.
This is failing due to some code that isn't built on MSVC
so I didn't catch. Not immediately obvious how to fix this
at first glance, so I'm reverting for now.
llvm-svn: 315536
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There's a lot of misuse of Twine scattered around LLVM. This
ranges in severity from benign (returning a Twine from a function
by value that is just a string literal) to pretty sketchy (storing
a Twine by value in a class). While there are some uses for
copying Twines, most of the very compelling ones are confined
to the Twine class implementation itself, and other uses are
either dubious or easily worked around.
This patch makes Twine's copy constructor private, and fixes up
all callsites.
Differential Revision: https://reviews.llvm.org/D38767
llvm-svn: 315530
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
of the renamed symbol.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, cfe-commits, arphaman
Differential Revision: https://reviews.llvm.org/D38723
llvm-svn: 315452
|
|
|
|
|
|
| |
clang-refactor crashes on some bots after this commit
llvm-svn: 315095
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds initial support for refactoring options. One can now use
optional and required std::string options.
This commit also adds a NewNameOption for the local-rename refactoring action to
allow rename to work with custom names.
Differential Revision: https://reviews.llvm.org/D37856
llvm-svn: 315087
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit simplifies the interface for the refactoring action rules and the
refactoring requirements. It merges the selection constraints and the selection
requirements into one class. The refactoring actions rules must now be
implemented using subclassing instead of raw function / lambda pointers. This
change also removes a bunch of template-based traits and other
template definitions that are now redundant.
Differential Revision: https://reviews.llvm.org/D37681
llvm-svn: 314704
|
|
|
|
|
|
|
|
|
| |
This commit ensures that CommonOptionsParser works with subcommands. This allows
clang-refactor to use the CommonOptionsParser.
Differential Revision: https://reviews.llvm.org/D37618
llvm-svn: 313260
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
local-rename action
This commit introduces the clang-refactor tool alongside the local-rename action
which uses the existing renaming engine used by clang-rename. The tool
doesn't actually perform the source transformations yet, it just provides
testing support. This commit also moves only one test from clang-rename over to
test/Refactor. I will continue to move the other tests throughout
development of clang-refactor.
The following options are supported by clang-refactor:
-v: use verbose output
-selection: The source range that corresponds to the portion of the source
that's selected (currently only special command test:<file> is supported).
Please note that a follow-up commit will migrate clang-refactor to
libTooling's common option parser, so clang-refactor will be able to use
the common interface with compilation database and options like -p, -extra-arg,
etc.
The testing support provided by clang-refactor is described below:
When -selection=test:<file> is given, clang-refactor will parse the selection
commands from that file. The selection commands are grouped and the specified
refactoring action invoked by the tool. Each command in a group is expected to
produce an identical result. The precise syntax for the selection commands is
described in a comment in TestSupport.h.
Differential Revision: https://reviews.llvm.org/D36574
llvm-svn: 313244
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The use case is that renaming multiple symbols in a large enough codebase is
much faster if all of these can be done with a single invocation, but
there will be multiple translation units where one or more symbols are
not found.
Old behavior was to exit with an error (default) or exit without
reporting an error (-force). New behavior is that -force results in a
best-effort rename: rename symbols which are found and just ignore the
rest.
The existing help for -force sort of already implies this behavior.
Reviewers: cfe-commits, klimek, arphaman
Reviewed By: klimek
Differential Revision: https://reviews.llvm.org/D37634
llvm-svn: 312942
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
form of PseudoObjectExpr
The new commit adjusts unittest test code compilation options so that the
Objective-C code in the unittest can be parsed on non-macOS platforms.
Original message:
The AST selection finder now constructs a selection tree that contains only the
syntactic form of PseudoObjectExpr. This form of selection tree is more
meaningful when doing downstream analysis as we're interested in the syntactic
features of the AST and the correct lexical parent relation.
llvm-svn: 312132
|
|
|
|
| |
llvm-svn: 312131
|
|
|
|
|
|
|
|
|
|
|
| |
of PseudoObjectExpr
The AST selection finder now constructs a selection tree that contains only the
syntactic form of PseudoObjectExpr. This form of selection tree is more
meaningful when doing downstream analysis as we're interested in the syntactic
features of the AST and the correct lexical parent relation.
llvm-svn: 312127
|
|
|
|
|
|
| |
when computing the AST selection
llvm-svn: 312121
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Information about clang executable name components, such as target and
driver mode, was passes in std::pair. With this change it is passed in
a special structure. It improves readability and makes access to this
information more convenient.
NFC.
Differential Revision: https://reviews.llvm.org/D36057
llvm-svn: 311981
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements the initial support for refactoring action rules. The
first rule that's supported is a "source change" rule that returns a set of
atomic changes. This patch is based on the ideas presented in my RFC:
http://lists.llvm.org/pipermail/cfe-dev/2017-July/054831.html
The following pieces from the RFC are added by this patch:
- `createRefactoringRule` (known as `apply` in the RFC)
- `requiredSelection` refactoring action rule requirement.
- `selection::SourceSelectionRange` selection constraint.
Differential Revision: https://reviews.llvm.org/D36075
llvm-svn: 311884
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: arphaman
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D37002
llvm-svn: 311865
|
|
|
|
|
|
|
|
| |
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D37000
llvm-svn: 311770
|
|
|
|
|
|
|
| |
This should fix
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-incremental_build/41578/
llvm-svn: 311656
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds the base AST source selection component to the refactoring
library. AST selection is represented using a tree of SelectedASTNode values.
Each selected node gets its own selection kind, which can actually be None even
in the middle of tree (e.g. statement in a macro whose child is in a macro
argument). The initial version constructs a "raw" selection tree, without
applying filters and canonicalisation operations to the nodes.
Differential Revision: https://reviews.llvm.org/D35012
llvm-svn: 311655
|
|
|
|
|
|
| |
Handle the case when DeclContext is null.
llvm-svn: 311434
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
If a node referring to a name is within a class or namespace, do not use
the full qualified name, but strip the namespace prefix.
Reviewers: arphaman, bkramer
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36681
llvm-svn: 311433
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Use qualified names if available.
Reviewers: arphaman
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36186
llvm-svn: 311292
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add separate tests for the top-down and the bottom-up phase, as well as
one for the optimal matching.
Reviewers: arphaman
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36185
llvm-svn: 311284
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Ignore macros and implicit AST nodes, as well as anything outside of the
main source file.
Reviewers: arphaman
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36184
llvm-svn: 311280
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Until we find a decent heuristic on how to choose between multiple
identical trees, there is no point in supporting multiple mappings.
This also enables matching of nodes with parents of different types,
because there are many instances where this is appropriate. For
example for and foreach statements; functions in the global or
other namespaces.
Reviewers: arphaman
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36183
llvm-svn: 311251
|
|
|
|
|
|
|
|
|
|
| |
clang-diff""
Fix build by renaming ChangeKind -> Change
This reverts commit 0c78c5729f29315d7945988efd048c0cb86c07ce.
llvm-svn: 311222
|
|
|
|
|
|
|
| |
This reverts commit eac4c13ac9ea8f12bc049e040c7b9c8a517f54e7, the
original commit *should* not have caused the build failure.
llvm-svn: 311216
|
|
|
|
|
|
| |
This reverts commit r311199, it was causing widespread build failures.
llvm-svn: 311211
|
|
|
|
|
|
| |
This reverts commit r311200, it was causing widespread build failures.
llvm-svn: 311210
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
This also changes the output order of the changes. Now the matches are
printed in pre-order, intertwined with insertions, updates, and moves.
Deletions are printed afterwards.
Reviewers: arphaman
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36179
llvm-svn: 311200
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: arphaman
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36178
llvm-svn: 311199
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix to the computation of the rightmost descendant.
Prevents root nodes from being mapped if they are already mapped. This
only makes a difference when we compare AST Nodes other than entire
translation units, a feature which still has to be tested.
Reviewers: arphaman
Subscribers: klimek
Differential Revision: https://reviews.llvm.org/D36176
llvm-svn: 311172
|
|
|
|
|
|
|
| |
This is useful for tools such as clang-diff which do not use
CommonOptionsParser due to the need for multiple compilation databases.
llvm-svn: 311170
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
If assertions are disabled, but LLVM_ABI_BREAKING_CHANGES is enabled,
this will cause an issue with an unchecked Success. Switching to
consumeError() is the correct way to bypass the check.
Reviewers: llvm-commits, cfe-commits, arphaman
Reviewed By: arphaman
Subscribers: arphaman, klimek, pirama
Differential Revision: https://reviews.llvm.org/D36728
llvm-svn: 310958
|
|
|
|
|
|
|
|
|
| |
1. Add missing explicit for SymbolName constructor.
2. Add missing std::move in createRenameReplacements.
Differential revision: https://reviews.llvm.org/D36715
llvm-svn: 310948
|
|
|
|
|
|
|
|
|
|
|
| |
Symbol occurrences store the results of local rename and will also be used for
the global, indexed rename results. Their kind is used to determine whether they
should be renamed automatically or not. They can be converted to a set of
AtomicChanges as well.
Differential Revision: https://reviews.llvm.org/D36156
llvm-svn: 310853
|
|
|
|
|
|
| |
This function will be used by the clang-refactor's rename actions
llvm-svn: 309813
|
|
|
|
| |
llvm-svn: 309738
|
|
|
|
| |
llvm-svn: 309737
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This re-commits r298913.
o See thread http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20170327/189084.html
o Tested with -DLLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY=0.
Summary: ... which applies a set of `AtomicChange`s on code.
Reviewers: klimek, djasper
Reviewed By: djasper
Subscribers: arphaman, mgorny, chapuni, cfe-commits
Differential Revision: https://reviews.llvm.org/D30777
llvm-svn: 309548
|
|
|
|
| |
llvm-svn: 308737
|
|
|
|
|
|
|
| |
std::pair in emplace back couldn't be constructed because SNodeId has an
explicit constructor. Not sure how this even compiled on my machine before.
llvm-svn: 308734
|