summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests/clang-apply-replacements
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tools-extra] [cmake] Link against libclang-cpp whenever possibleMichal Gorny2019-10-041-2/+5
| | | | | | | | | Use clang_target_link_libraries() in order to support linking against libclang-cpp instead of static libraries. Differential Revision: https://reviews.llvm.org/D68448 llvm-svn: 373786
* 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 llvm-svn: 361684
* [clang-tidy] Add fix descriptions to clang-tidy checks.Haojian Wu2019-04-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Motivation/Context: in the code review system integrating with clang-tidy, clang-tidy doesn't provide a human-readable description of the fix. Usually developers have to preview a code diff (before vs after apply the fix) to understand what the fix does before applying a fix. This patch proposes that each clang-tidy check provides a short and actional fix description that can be shown in the UI, so that users can know what the fix does without previewing diff. This patch extends clang-tidy framework to support fix descriptions (will add implementations for existing checks in the future). Fix descriptions and fixes are emitted via diagnostic::Note (rather than attaching the main warning diagnostic). Before this patch: ``` void MyCheck::check(...) { ... diag(loc, "my check warning") << FixtItHint::CreateReplacement(...); } ``` After: ``` void MyCheck::check(...) { ... diag(loc, "my check warning"); // Emit a check warning diag(loc, "fix description", DiagnosticIDs::Note) << FixtItHint::CreateReplacement(...); // Emit a diagnostic note and a fix } ``` Reviewers: sammccall, alexfh Reviewed By: alexfh Subscribers: MyDeveloperDay, Eugene.Zelenko, aaron.ballman, JonasToth, xazax.hun, jdoerfert, cfe-commits Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D59932 llvm-svn: 358576
* 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
* [clang-apply-replacements] Convert tooling::Replacements to ↵Malcolm Parsons2018-04-113-70/+5
| | | | | | | | | | | | | | | | | | | | tooling::AtomicChange for conflict resolving of changes, code cleanup, and code formatting. Summary: By converting Replacements by AtomicChange, clang-apply-replacements is able like clang-tidy to automatically cleanup and format changes. This should permits to close this ticket: https://bugs.llvm.org/show_bug.cgi?id=35051 and attempt to follow hints from https://reviews.llvm.org/D43500 comments. Reviewers: klimek, ioeric Reviewed By: ioeric Subscribers: malcolm.parsons, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D43764 Patch by Jeremy Demeule. llvm-svn: 329813
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* ClangApplyReplacementsTests: Add clangBasic in libdeps.NAKAMURA Takumi2017-07-151-0/+1
| | | | | | r308015 introduced clangBasic to instantiate Diagnostics &c, llvm-svn: 308085
* [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML outputAlexander Kornienko2017-07-142-0/+54
| | | | | | | | | | | | | | | | | | | | Summary: To get properly integration Clang-Tidy with CLion IDE, next things were implemented: * Preserve `Message`, `FileOffset`, `FilePath` in the clang-tidy output. * Export all diagnostics, not just the ones with fixes * Test-cases Reviewers: alexfh, ilya-biryukov Subscribers: mgorny, JDevlieghere, xazax.hun, cfe-commits Tags: #clang-tools-extra Patch by Vladimir Plyashkun! Differential Revision: https://reviews.llvm.org/D35349 llvm-svn: 308015
* [clang-apply-replacements] use Range::operator==() instead of self-defined ↵Eric Liu2016-06-211-3/+1
| | | | | | operator. llvm-svn: 273291
* Remove autoconf supportChris Bieneman2016-01-261-25/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 llvm-svn: 258864
* Revert "Adapt clang-tools-extra to clang module format changes."Adrian Prantl2015-02-251-3/+2
| | | | | | This reverts commit 230424. llvm-svn: 230456
* Adapt clang-tools-extra to clang module format changes.Adrian Prantl2015-02-251-2/+3
| | | | | | | - add clangCodeGen.a to the tools that need it - tweak pp-trace command line handling to not conflict with clang's. llvm-svn: 230424
* Revert "Adapt Makefile dependencies for the clang module format change in ↵Adrian Prantl2015-02-211-4/+3
| | | | | | r230089." llvm-svn: 230104
* Adapt Makefile dependencies for the clang module format change in r230089.Adrian Prantl2015-02-201-3/+4
| | | | llvm-svn: 230090
* [CMake] Prune redundant libdeps.NAKAMURA Takumi2014-10-301-1/+0
| | | | llvm-svn: 220893
* [CMake] Add dependencies on clangToolingCore.NAKAMURA Takumi2014-10-301-0/+1
| | | | llvm-svn: 220890
* Fix Makefiles after r220867.Daniel Jasper2014-10-291-4/+5
| | | | llvm-svn: 220868
* Track clang r213171Alp Toker2014-07-161-1/+1
| | | | | | The clang rewriter is now a core facility. llvm-svn: 213172
* Run llvm/utils/sort_includes.py over the Clang tools code. This doesn'tChandler Carruth2014-01-071-1/+1
| | | | | | | | | | always produce as pretty of results as it does in LLVM and Clang, but I don't mind and the value of having a single canonical ordering is very high IMO. Let me know if you spot really serious problems here. llvm-svn: 198703
* [CMake] clang-tools-extra: Update dependencies.NAKAMURA Takumi2013-12-101-7/+1
| | | | llvm-svn: 196860
* Fix build by adding dep on TransformUtilsEdwin Vane2013-09-301-1/+2
| | | | | | clang-apply-replacements unittest Makefile wasn't linking in TransformUtils. llvm-svn: 191669
* clang-apply-replacements: Add code formatting functionalityEdwin Vane2013-09-303-0/+115
The tool now supports a collection of arguments to turn on and provide settings for the formatting of code affected by applying replacements: * --format turns on formatting (default style is LLVM) * --style controls code style settings * --style-config allows one to explicitly indicate where a style config file lives. The libclangApplyReplacements interface has a new function to turn Replacements into Ranges to be used with tooling::reformat(). llvm-svn: 191667
OpenPOWER on IntegriCloud