summaryrefslogtreecommitdiff
path: root/lib/Tooling/Refactoring
Commit message (Collapse)AuthorAgeFilesLines
* [LibTooling] Add `before` and `after` selectors for selecting point-ranges ↵Yitzhak Mandelbaum2019-05-291-0/+22
| | | | | | | | | | | | | | | | | | | | relative to nodes. Summary: The `before` and `after` selectors allow users to specify a zero-length range -- a point -- at the relevant location in an AST-node's source. Point ranges can be useful, for example, to insert a change using an API that takes a range to be modified (e.g. `tooling::change()`). Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62419 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361955 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename clangToolingRefactor to clangToolingRefactoring for consistency with ↵Nico Weber2019-05-251-1/+1
| | | | | | | | | | its directory See "[cfe-dev] The name of clang/lib/Tooling/Refactoring". Differential Revision: https://reviews.llvm.org/D62420 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361684 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Add Explanation parameter to `makeRule`.Yitzhak Mandelbaum2019-05-241-4/+4
| | | | | | | | | | | | | | | | | Summary: Conceptually, a single-case RewriteRule has a matcher, edit(s) and an (optional) explanation. `makeRule` previously only took the matcher and edit(s). This change adds (optional) support for the explanation. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62390 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361643 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Fix dangling references in RangeSelector.Yitzhak Mandelbaum2019-05-231-13/+13
| | | | | | | | | | | | | | | | | | | Summary: RangeSelector had a number of cases of capturing a StringRef in a lambda, which lead to dangling references. This change converts all uses in the API of `StringRef` to `std::string` to avoid this problem. `std::string` in the API is a reasonable choice, because the combinators are always storing the string beyond the life of the combinator construction. Reviewers: ilya-biryukov, gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62328 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361514 91177308-0d34-0410-b5e6-96231b3b80d8
* Work around a Visual C++ bug.Paul Robinson2019-05-231-6/+16
| | | | | | | | | | | | | | | | Using a static function as a template parameter gets a bogus compile-time error with Visual Studio 2017, prior to version 15.8. Our current minimum-version requirement is a particular update to VS2015, and we assume all Visual Studio 2017 versions are usable. This patch makes the code buildable with older versions of VS2017, and can be reverted after we upgrade the minimum version sometime in the future. Description of the Microsoft bug: https://developercommunity.visualstudio.com/content/problem/25334/error-code-c2971-when-specifying-a-function-as-the.html Differential Revision: https://reviews.llvm.org/D62202 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361502 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Update Stencil to use RangeSelectorYitzhak Mandelbaum2019-05-221-43/+18
| | | | | | | | | | | | | | | | | | | Add support for creating a `StencilPart` from any `RangeSelector`, which broadens the scope of `Stencil`. Correspondingly, deprecate Stencil's specialized combinators `node` and `sNode` in favor of using the new `selection` combinator directly (with the appropriate range selector). Reviewers: sbenza Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62160 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361413 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Update Transformer to use RangeSelector instead of NodePart enum.Yitzhak Mandelbaum2019-05-221-89/+13
| | | | | | | | | | | | | | | | | Transformer provides an enum to indicate the range of source text to be edited. That support is now redundant with the new (and more general) RangeSelector library, so we remove the custom enum support in favor of supporting any RangeSelector. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62149 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361392 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Add RangeSelector library for defining source ranges based on ↵Yitzhak Mandelbaum2019-05-202-0/+265
| | | | | | | | | | | | | | | | | | | | | | bound AST nodes. Summary: The RangeSelector library defines a combinator language for specifying source ranges based on bound ids for AST nodes. The combinator approach follows the design of the AST matchers. The RangeSelectors defined here will be used in both RewriteRule, for specifying source affected by edit, and in Stencil for specifying source to use constructively in a replacement. Reviewers: ilya-biryukov Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61774 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361152 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Add support to Transformer for composing rules as an ordered ↵Yitzhak Mandelbaum2019-05-171-8/+105
| | | | | | | | | | | | | | | | | | | | choice. This revision updates `RewriteRule` to support multiple subrules that are interpreted as an ordered-choice (apply the first one that matches). With this feature, users can write the rules that appear later in the list of subrules knowing that previous rules' patterns *have not matched*, freeing them from reasoning about those cases in the current pattern. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61335 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@361037 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Change Transformer's TextGenerator to a partial function.Yitzhak Mandelbaum2019-04-301-19/+21
| | | | | | | | | | | | | | | | | | | | | | Summary: Changes the signature of the TextGenerator std::function to return an Expected<std::string> instead of std::string to allow for (non-fatal) failures. Previously, we expected that any failures would be expressed with assertions. However, that's unfriendly to running the code in servers or other places that don't want their library calls to crash the program. Correspondingly, updates Transformer's handling of failures in TextGenerators and the signature of `ChangeConsumer`. Reviewers: ilya-biryukov Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61015 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359574 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Fix unneeded use of unique_ptr where shared_ptr is expected.Yitzhak Mandelbaum2019-04-291-4/+5
| | | | | | | | | | | | | | Summary: This fixes a few places in the Stencil implementation where a unique_ptr is created at a callsite that expects shared_ptr. Since the former implicitly converts to the latter, the code compiles and runs correctly as is. But, there's no reason to involve unique_ptr -- the current code was leftover from a previous version in which unique_ptr was the expected type. Reviewers: sbenza Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D61005 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@359468 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Fix build breakage from commit 7b7ce6683ee.Yitzhak Mandelbaum2019-04-181-1/+2
| | | | | | | | On configurations with -Werror,-Wmissing-field-initializers, the commit does not compile. This commit fixes the offending line. Original Differential Revision: https://reviews.llvm.org/D60408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358705 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Extend Transformer to support multiple simultaneous changes.Yitzhak Mandelbaum2019-04-181-39/+57
| | | | | | | | | | | | | | | | Summary: This revision allows users to specify independent changes to multiple (related) sections of the input. Previously, only a single section of input could be selected for replacement. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60408 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358697 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Add Stencil library for format-string style codegen.Yitzhak Mandelbaum2019-04-182-0/+200
| | | | | | | | | | | | | | | | | | | | | Summary: This file defines the *Stencil* abstraction: a code-generating object, parameterized by named references to (bound) AST nodes. Given a match result, a stencil can be evaluated to a string of source code. A stencil is similar in spirit to a format string: it is composed of a series of raw text strings, references to nodes (the parameters) and helper code-generation operations. See thread on cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling" for background. Reviewers: sbenza Reviewed By: sbenza Subscribers: ilya-biryukov, mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59371 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358691 91177308-0d34-0410-b5e6-96231b3b80d8
* [Lookup] Invisible decls should not be ambiguous when renaming.Eric Liu2019-04-151-2/+2
| | | | | | | | | | | | | | | | | | Summary: For example, a renamed type in a header file can conflict with declaration in a random file that includes the header, but we should not consider the decl ambiguous if it's not visible at the rename location. This improves consistency of generated replacements when header file is included in different TUs. Reviewers: hokein Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60257 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@358378 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Add Transformer, a library for source-to-source transformations.Yitzhak Mandelbaum2019-04-052-0/+204
| | | | | | | | | | | | | | | | Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling". Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, ABataev, mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59376 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357768 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Add "SourceCode" library for functions relating to source-code ↵Yitzhak Mandelbaum2019-04-052-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | manipulation. Summary: Introduces a utility library in Refactoring/ to collect routines related to source-code manipulation. In this change, we move "extended-range" functions from the FixIt library (in clangTooling) to this new library. We need to use this functionality in Refactoring/ and cannot access it if it resides in Tooling/, because that would cause clangToolingRefactor to depend on clangTooling, which would be a circular dependency. Reviewers: ilya-biryukov, ioeric Reviewed By: ilya-biryukov Subscribers: mgorny, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60269 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357764 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[LibTooling] Add Transformer, a library for source-to-source ↵Alexey Bataev2019-04-032-205/+0
| | | | | | | | | transformations." This reverts commit r357576 to fix the problem with the cyclic dependencies between libTooling and libToolingRefactor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357612 91177308-0d34-0410-b5e6-96231b3b80d8
* [LibTooling] Add Transformer, a library for source-to-source transformations.Yitzhak Mandelbaum2019-04-032-0/+205
| | | | | | | | | | | | | | | | Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations. A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling". Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: mgorny, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59376 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@357576 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1912-48/+36
| | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@351636 91177308-0d34-0410-b5e6-96231b3b80d8
* PR40096: Forwards-compatible with C++20 rule regarding aggregates not having ↵David Blaikie2018-12-191-2/+0
| | | | | | | | | | user-declared ctors Looks like these were in place to make these types move-only. That's generally not a feature that the type should prescribe (unless it's an inherent limitation) - instead leaving it up to the users of a type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349669 91177308-0d34-0410-b5e6-96231b3b80d8
* Port getLocEnd -> getEndLocStephen Kelly2018-08-093-4/+4
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339386 91177308-0d34-0410-b5e6-96231b3b80d8
* Port getLocStart -> getBeginLocStephen Kelly2018-08-093-6/+6
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@339385 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-096-12/+12
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331834 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@329399 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][selection] canonicalize decl ref callee to the call exprAlex Lorenz2017-11-141-13/+48
| | | | | | | | We would like to extract the full call when just the callee function is selected git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318215 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][selection] canonicalize member expr callee to the fullAlex Lorenz2017-11-141-1/+12
| | | | | | | | | member call expression We would like to extract the full call when just the callee is selected. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318205 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][extract] avoid extracting expressions from types in functionsAlex Lorenz2017-11-141-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@318169 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-refactor] Get rid of OccurrencesFinder in RenamingAction, NFCHaojian Wu2017-11-081-18/+9
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317696 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-refactor] Introduce a new rename rule for qualified symbolsHaojian Wu2017-11-082-0/+76
| | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317672 91177308-0d34-0410-b5e6-96231b3b80d8
* Move Extract.cpp that wasn't moved in r317343Alex Lorenz2017-11-031-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317344 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][extract] insert semicolons into extracted/inserted codeAlex Lorenz2017-11-034-4/+173
| | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317343 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][selection] canonicalize selected string literal to objcAlex Lorenz2017-11-021-1/+22
| | | | | | | string literal when possible git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317224 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][extract] code extracted from inline method should be placedAlex Lorenz2017-11-011-2/+7
| | | | | | | in a function defined before the outer class git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317062 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][extract] prohibit extraction of ObjC property settersAlex Lorenz2017-11-011-5/+14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317056 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor][selection] code ranges can be selected in objc methodsAlex Lorenz2017-11-011-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@317054 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] select the entire DeclStmt if one ifs decls is selectedAlex Lorenz2017-10-311-5/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316971 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] Fix a clang-tidy warning.Haojian Wu2017-10-301-1/+2
| | | | | | NFC git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316895 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] Describe refactorings in the operation classesAlex Lorenz2017-10-273-146/+126
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316780 91177308-0d34-0410-b5e6-96231b3b80d8
* [rename] support renaming class member.Haojian Wu2017-10-251-0/+49
| | | | | | | | | | | | Reviewers: ioeric Reviewed By: ioeric Subscribers: klimek, cfe-commits, mgorny Differential Revision: https://reviews.llvm.org/D39178 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316571 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-rename] Fix and enable the failing TemplatedClassFunction test.Haojian Wu2017-10-251-0/+20
| | | | | | | | | | | | Reviewers: ioeric Reviewed By: ioeric Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39241 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316561 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing clangRewrite lib dependency for clangToolingRefactorAlex Lorenz2017-10-241-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316467 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] Initial outline of implementation of "extract function" refactoringAlex Lorenz2017-10-244-0/+319
| | | | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316465 91177308-0d34-0410-b5e6-96231b3b80d8
* [rename] Don't overwrite the template argument when renaming a template ↵Haojian Wu2017-10-231-1/+6
| | | | | | | | | | | | | | function. Reviewers: ioeric Reviewed By: ioeric Subscribers: cierpuchaw, cfe-commits, klimek Differential Revision: https://reviews.llvm.org/D39120 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316314 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a few nits in RenamingAction.Haojian Wu2017-10-191-2/+2
| | | | | | | * Add missing override keyword. * avoid unnecessary copy of std::string. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316152 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] selection: new CodeRangeASTSelection represents a set of selectedAlex Lorenz2017-10-181-0/+105
| | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316104 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-rename] Rename alias.Haojian Wu2017-10-181-60/+59
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@316074 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-rename] Rename enum.Haojian Wu2017-10-171-4/+40
| | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315999 91177308-0d34-0410-b5e6-96231b3b80d8
* [refactor] allow the use of refactoring diagnosticsAlex Lorenz2017-10-161-5/+4
| | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315924 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-rename] Add function unit tests.Haojian Wu2017-10-161-0/+23
| | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315898 91177308-0d34-0410-b5e6-96231b3b80d8