summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-apply-replacements/Inputs/basic
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Add fix descriptions to clang-tidy checks.Haojian Wu2019-04-172-28/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [clang-apply-replacements] Convert tooling::Replacements to ↵Malcolm Parsons2018-04-111-4/+4
| | | | | | | | | | | | | | | | | | | | 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
* [Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML outputAlexander Kornienko2017-07-142-0/+6
| | | | | | | | | | | | | | | | | | | | 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-tidy] Add check name to YAML export (clang-tools-extra part)Alexander Kornienko2017-01-032-22/+26
| | | | | | | | | | | | Add a field indicating the associated check for every replacement to the YAML report generated with the '-export-fixes' option. Update clang-apply-replacements to handle the new format. Patch by Alpha Abdoulaye! Differential revision: https://reviews.llvm.org/D26137 llvm-svn: 290893
* clang-apply-replacements: Deduplicate paths with FileManager.Benjamin Kramer2014-09-091-0/+4
| | | | | | | | Bucket replacements by FileEntry instead of path. The same file with different paths is very common, relative #include paths and symlinks can easily create them. When that occurs we would apply the fix twice. llvm-svn: 217440
* Fix YAML tests again.Rui Ueyama2013-09-112-6/+6
| | | | llvm-svn: 190489
* Fix YAML tests.Rui Ueyama2013-09-111-7/+7
| | | | llvm-svn: 190487
* Rename clang-replace -> clang-apply-replacementsEdwin Vane2013-09-033-0/+56
Made changes throughout clang-tools-extra for the renaming of clang-replace to clang-apply-replacements as per feedback from community. llvm-svn: 189832
OpenPOWER on IntegriCloud