| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
| |
We would like to extract the full call when just the callee function is
selected
llvm-svn: 318215
|
|
|
|
|
|
|
|
| |
member call expression
We would like to extract the full call when just the callee is selected.
llvm-svn: 318205
|
|
|
|
| |
llvm-svn: 318169
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
The OccurrencesFinder is only used in RenameOccurrences to find symbol
occurrences, there is no need to inherit RefactoringRule.
Replace it with a single utility function to avoid code misleading.
Reviewers: sammccall
Reviewed By: sammccall
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D39796
llvm-svn: 317696
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: Prototype of a new rename rule for renaming qualified symbol.
Reviewers: arphaman, ioeric, sammccall
Reviewed By: arphaman, sammccall
Subscribers: jklaehn, cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D39332
llvm-svn: 317672
|
|
|
|
| |
llvm-svn: 317344
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
when needed
This commit implements the semicolon insertion logic into the extract
refactoring. The following rules are used:
- extracting expression: add terminating ';' to the extracted function.
- extracting statements that don't require terminating ';' (e.g. switch): add
terminating ';' to the callee.
- extracting statements with ';': move (if possible) the original ';' from the
callee and add terminating ';'.
- otherwise, add ';' to both places.
Differential Revision: https://reviews.llvm.org/D39441
llvm-svn: 317343
|
|
|
|
|
|
| |
string literal when possible
llvm-svn: 317224
|
|
|
|
|
|
| |
in a function defined before the outer class
llvm-svn: 317062
|
|
|
|
| |
llvm-svn: 317056
|
|
|
|
| |
llvm-svn: 317054
|
|
|
|
| |
llvm-svn: 316971
|
|
|
|
|
|
| |
NFC
llvm-svn: 316895
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit changes the way that the refactoring operation classes are
structured:
- Users have to call `initiate` instead of constructing an instance of the
class. The `initiate` is now supposed to have custom initiation logic, and
you don't need to subclass the builtin requirements.
- A new `describe` function returns a structure with the id, title and the
description of the refactoring operation.
The refactoring action classes are now placed into one common place in
RefactoringActions.cpp instead of being separate.
Differential Revision: https://reviews.llvm.org/D38985
llvm-svn: 316780
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, cfe-commits, mgorny
Differential Revision: https://reviews.llvm.org/D39178
llvm-svn: 316571
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D39241
llvm-svn: 316561
|
|
|
|
| |
llvm-svn: 316467
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds an initial, skeleton outline of the "extract function"
refactoring. The extracted function doesn't capture variables / rewrite code
yet, it just basically does a simple copy-paste.
The following initiation rules are specified:
- extraction can only be done for executable code in a function/method/block.
This means that you can't extract a global variable initialize into a function
right now.
- simple literals and references are not extractable.
This commit also adds support for full source ranges to clang-refactor's test
mode.
Differential Revision: https://reviews.llvm.org/D38982
llvm-svn: 316465
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function.
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: cierpuchaw, cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D39120
llvm-svn: 316314
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a declaration at location and for class that searches for all occurrences of
a specific declaration
This commit uses a single RecursiveSymbolVisitor class for both
USRLocFindingASTVisitor and NamedDeclOccurrenceFindingVisitor to avoid duplicate
traversal code. It also traverses nested name specifier locs in the new class
and remove the separate matching step.
Differential Revision: https://reviews.llvm.org/D34949
llvm-svn: 307898
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a short-term fix for PR33650 aimed to get the modules build bots green again.
Remove all the places where we use the LLVM_YAML_IS_(FLOW_)?SEQUENCE_VECTOR
macros to try to locally specialize a global template for a global type. That's
not how C++ works.
Instead, we now centrally define how to format vectors of fundamental types and
of string (std::string and StringRef). We use flow formatting for the former
cases, since that's the obvious right thing to do; in the latter case, it's
less clear what the right choice is, but flow formatting is really bad for some
cases (due to very long strings), so we pick block formatting. (Many of the
cases that were using flow formatting for strings are improved by this change.)
Other than the flow -> block formatting change for some vectors of strings,
this should result in no functionality change.
Differential Revision: https://reviews.llvm.org/D34907
Corresponding LLVM change is r306878.
llvm-svn: 306881
|
|
|
|
|
|
|
|
|
|
|
|
| |
The core engine of clang-rename will be used for local and global renames in the
new refactoring engine, as mentioned in
http://lists.llvm.org/pipermail/cfe-dev/2017-June/054286.html.
The clang-rename tool is still supported but might get deprecated in the future.
Differential Revision: https://reviews.llvm.org/D34696
llvm-svn: 306840
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reviewers: ioeric
Reviewed By: ioeric
Subscribers: alexshap, klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D31492
llvm-svn: 299073
|
|
|
|
|
|
|
|
|
| |
This broke GreenDragon:
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-modulesRDA_build/4776/
Reverting this commit and all follow-up commits.
llvm-svn: 298967
|
|
|
|
| |
llvm-svn: 298965
|
|
|
|
| |
llvm-svn: 298921
|