summaryrefslogtreecommitdiffstats
path: root/clang/unittests/Tooling/RewriterTest.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | 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
* Implement tooling::Replacements as a class.Eric Liu2016-08-011-2/+5
| | | | | | | | | | | | | | | | | | | Summary: - Implement clang::tooling::Replacements as a class to provide interfaces to control how replacements for a single file are combined and provide guarantee on the order of replacements being applied. - tooling::Replacements only contains replacements for the same file now. Use std::map<std::string, tooling::Replacements> to represent multi-file replacements. - Error handling for the interface change will be improved in followup patches. Reviewers: djasper, klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D21748 llvm-svn: 277335
* Make tooling::applyAllReplacements return llvm::Expected<string> instead of ↵Eric Liu2016-07-111-2/+3
| | | | | | | | | | | | | | | | empty string to indicate potential error. Summary: return llvm::Expected<> to carry error status and error information. This is the first step towards introducing "Error" into tooling::Replacements. Reviewers: djasper, klimek Subscribers: ioeric, klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D21601 llvm-svn: 275062
* Avoid using set::emplace as it is apparently not supported by gcc 4.7.Daniel Jasper2015-06-161-2/+2
| | | | llvm-svn: 239816
* Tooling: When applying a set of replacements, do deletions beforeDaniel Jasper2015-06-161-0/+13
| | | | | | | | insertions. It is unlikely to be the intention to delete parts of newly inserted code. To do so, changed sorting Replacements at the same offset to have decreasing length. llvm-svn: 239809
* Adds a method overwriteChangedFiles to the Rewriter. This is implemented byManuel Klimek2012-05-221-0/+37
first writing the changed files to a temporary location and then overwriting the original files atomically. Also adds a RewriterTestContext to aid unit testing rewrting logic in general. llvm-svn: 157260
OpenPOWER on IntegriCloud