summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/Refactoring.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-1/+1
| | | | llvm-svn: 210780
* [C++11] Use 'nullptr'. Tooling edition.Craig Topper2014-05-201-2/+2
| | | | llvm-svn: 209192
* Added a const qualifier to SourceManager& parameters.Alexander Kornienko2014-03-051-5/+7
| | | | llvm-svn: 202964
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-071-1/+1
| | | | | | | encodes the canonical rules for LLVM's style. I noticed this had drifted quite a bit when cleaning up LLVM, so wanted to clean up Clang as well. llvm-svn: 198686
* Use Rewriter::overwriteChangedFiles() directlyAlp Toker2013-10-291-17/+1
| | | | | | | | | | | | | This replaces the custom code in RefactoringTool::saveRewrittenFiles() which lacked atomic file saving and error diagnostics, resolving an old FIXME from r157331. Landing this time with the proper return code, plus a very unhelpful comment cleared up. Rubber-stamped by Manuel Klimek. llvm-svn: 193594
* Revert "Use Rewriter::overwriteChangedFiles() directly"Alp Toker2013-10-291-1/+17
| | | | | | | | This wasn't ready for prime time yet, seems to break tools-extra. This reverts commit r193590. llvm-svn: 193592
* Use Rewriter::overwriteChangedFiles() directlyAlp Toker2013-10-291-17/+1
| | | | | | | | | The old code in RefactoringTool::saveRewrittenFiles() lacked atomic moves and diagnostics and had FIXME to this effect. Rubber-stamped by Manuel Klimek. llvm-svn: 193590
* Reverted r192992 broke windows and freebsd builds.Ariel J. Bernal2013-10-181-10/+4
| | | | llvm-svn: 192997
* This patch fixes replacements that are not applied when relative paths areAriel J. Bernal2013-10-181-4/+10
| | | | | | | | | | specified. In particular it makes sure that relative paths for non-virtual files aren't made absolute. Added unittest. llvm-svn: 192992
* Revert commit r192299 until find a way to account for simlinks in OS X.Ariel J. Bernal2013-10-091-10/+4
| | | | llvm-svn: 192313
* This patch fixes replacements that are not applied when relative paths areAriel J. Bernal2013-10-091-7/+12
| | | | | | | | | | specified. In particular it makes sure that relative paths for non-virtual files aren't made absolute. Added unittest test. llvm-svn: 192299
* Fixed replacements for files with relative paths are not applied.Ariel J. Bernal2013-10-011-1/+12
| | | | | | | | Replacements were no applied when using a compilation database with paths in the compilation command relative to the compile directory. This patch makes those paths abosulte. llvm-svn: 191776
* Adding a vector version of clang::tooling::shiftedCodePosition().Edwin Vane2013-08-271-0/+17
| | | | | | | | | During the transition of clang::tooling::Replacements from std::set to std::vector, functions such as clang::tooling::applyAllReplacements() have been duplicated to take a std::vector<Replacement>. Applying this same temporary duplication to clang::tooling::shiftedCodePosition(). llvm-svn: 189358
* Tweak Replacement comparisonsEdwin Vane2013-08-161-13/+14
| | | | | | | | * Introduce operator< to replace Replacement::Less * Make operator== and operator< on Replacements non-member functions * Change order of comparisons in operator< to do string comparisons last llvm-svn: 188550
* Adding a vector version of tooling::applyAllReplacementsEdwin Vane2013-08-131-0/+17
| | | | | | | | | | | One day soon, tooling::Replacements will be changed from being implemented as an std::set to being implemented as an std::vector. Until then, some new code using vectors of Replacements would enjoy having a version of applyAllReplacements that takes a vector. Differential Revision: http://llvm-reviews.chandlerc.com/D1380 llvm-svn: 188295
* Fixing a conflict detection bug in tooling::deduplicateEdwin Vane2013-08-131-2/+3
| | | | | | | | If a Replacment is contained within the conflict range being built, the conflict range would be erroneously shortened. Now fixed. Tests updated to catch this case. llvm-svn: 188287
* Introduce Replacement deduplication and conflict detection functionEdwin Vane2013-08-081-0/+44
| | | | | | | | | | Summary: This patch adds tooling::deduplicate() which removes duplicates from and looks for conflicts in a vector of Replacements. Differential Revision: http://llvm-reviews.chandlerc.com/D1314 llvm-svn: 187979
* Constify Replacements parameter to applyAllReplacements.David Blaikie2013-07-171-4/+4
| | | | | | | | http://llvm-reviews.chandlerc.com/D1169 Patch by Guillaume Papin. llvm-svn: 186526
* Update for llvm API change.Rafael Espindola2013-07-161-2/+2
| | | | llvm-svn: 186448
* Let clang-format move the cursor appropriately.Daniel Jasper2013-05-211-0/+13
| | | | | | | | | With this patch, clang-format will try to keep the cursor at the original code position in editor integrations (implemented for emacs and vim). This means, after formatting, clang-format will try to keep the cursor on the same character of the same token. llvm-svn: 182373
* Add a more convenient interface to use clang-format.Daniel Jasper2013-05-161-13/+44
| | | | | | | | | | | | It turns out that several implementations go through the trouble of setting up a SourceManager and Lexer and abstracting this into a function makes usage easier. Also abstracts SourceManager-independent ranges out of tooling::Refactoring and provides a convenience function to create them from line ranges. llvm-svn: 181997
* Remove useless 'llvm::' qualifier from names like StringRef and others that areDmitri Gribenko2013-01-121-7/+7
| | | | | | brought into 'clang' namespace by clang/Basic/LLVM.h llvm-svn: 172323
* Allow RefactoringTool to write to memory instead of always to diskEdwin Vane2013-01-111-29/+34
| | | | | | | | | | | | | | | RefactoringTool::run() always writes the result of rewrites to disk. Instead, make this optional and provide a method for getting the refactoring results in a memory buffer instead. Also made ClangTool polymorphic so RefactoringTool could inherit from it to properly express the IS-A relationship. This change also provides access to ClangTool's public interface, e.g. mapVirtualFile() which is important once refactored buffers start living in memory instead of on disk. Reviewers: klimek llvm-svn: 172219
* Make DiagnosticOptions intrusively reference-counted, and make sureDouglas Gregor2012-10-231-5/+4
| | | | | | | the various stakeholders bump up the reference count. In particular, the diagnostics engine now keeps the DiagnosticOptions object alive. llvm-svn: 166508
* Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.Ted Kremenek2012-09-011-1/+1
| | | | | | | This is similar to how we divide up the StaticAnalyzer libraries to separate core functionality to what is clearly associated with Frontend actions. llvm-svn: 163050
* Adds a toString method to Replacement, which helps debugging.Manuel Klimek2012-05-301-0/+8
| | | | | | Adds missing header guards to Refactoring.h. llvm-svn: 157694
* Adds the Refactoring library, which is a layer on top of the Tooling libraryManuel Klimek2012-05-231-0/+178
that allows easy refactoring across translation units. llvm-svn: 157331
OpenPOWER on IntegriCloud