summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Added hh, hxx and hpp to header guard checks.Mads Ravn2016-08-261-3/+3
| | | | | | | | Changed the extension check to include the option of ",h,hh,hpp,hxx" instead of just returning whether the file ended with ".h". Differential revision: https://reviews.llvm.org/D20512 llvm-svn: 279803
* [clang-tidy] Cleanups utils filesEtienne Bergeron2016-05-161-17/+4
| | | | | | | | | | | | | | | | | | | Summary: Cleanup some code by using appropriate APIs. Some coding style cleanups. There is no behavior changes. - Function `IncludeSorter::CreateFixIt` can be replaced by `FixItHint::CreateReplacement`. - Function `cleanPath` is a wrapper for `llvm::sys::path::remove_dots`. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20279 llvm-svn: 269656
* [clang-tidy] Cleanup namespace in utils folder.Etienne Bergeron2016-05-031-0/+2
| | | | | | | | | | | | | | Summary: This is a step forward cleaning up the namespaces in clang-tidy/utils. There is no behavior change. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19819 llvm-svn: 268356
* [clang-tidy] Don't duplicate the leading slash.Alexander Kornienko2015-07-271-1/+1
| | | | llvm-svn: 243265
* Update to match clang r236404.Richard Smith2015-05-041-4/+4
| | | | llvm-svn: 236405
* [clang-tidy] Use the new ArrayRef<FixItHint> inserter.Alexander Kornienko2015-02-251-8/+5
| | | | llvm-svn: 230497
* Fix llvm-header-guard check.Alexander Kornienko2014-10-151-7/+15
| | | | | | | | | | | | | | | | | Summary: This patch makes the check work better for LLVM code: * always fix existing #endif comments * use one space before the comment (+allow customization for other styles) Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D5795 llvm-svn: 219789
* Make a variable local so it's lifetime becomes more obvious.Benjamin Kramer2014-09-171-6/+7
| | | | | | NFC llvm-svn: 217952
* [clang-tidy] Don't emit the same fixit multiple times.Benjamin Kramer2014-09-171-5/+5
| | | | | | | | | | If we had many header files we would attach the fix-it for all files to all warnings, oops. This is harmless 99.9% of the time but can confuse the rewriter in some edge cases. Sadly I failed to create a small test case for this. While there move fix-its instead of copying. llvm-svn: 217951
* [clang-tidy] When emitting header guard fixes bundle all fix-its into oneBenjamin Kramer2014-09-161-17/+31
| | | | | | | | | warning. Before we would emit two warnings if the header guard was wrong and the comment on a trailing #endif also needed fixing. llvm-svn: 217890
* [clang-tidy] Don't try to fix header guard #endif comments if there are escapedBenjamin Kramer2014-09-101-0/+7
| | | | | | | | newlines involved. Getting that right is just not worth it. llvm-svn: 217480
* Unique_ptrify PPCallbacks ownership. Goes with clang r217474.Craig Topper2014-09-101-1/+2
| | | | llvm-svn: 217475
* [clang-tidy] If we're going to change the header guard in the #endif commentBenjamin Kramer2014-08-261-13/+30
| | | | | | | | | we can also fix the original header guard. We still allow an _ at the end of a header guard since it's so common, but remove it now when the #endif comment is changed. llvm-svn: 216462
* [clang-tidy] Allow /**/ comments on #endifs when checking header guards.Benjamin Kramer2014-08-201-1/+2
| | | | | | Turning block comments into line comments just creates unecessary churn. llvm-svn: 216072
* [clang-tidy] Add a generic header guard checker + LLVM implementation.Benjamin Kramer2014-08-131-0/+257
The implementation is split into a generic part and a LLVM-specific part. Other codebases can implement it with their own style. The specific features supported are: - Verification (and fixing) of header guards against a style based on the file path - Automatic insertion of header guards for headers that are missing them - A warning when the header guard doesn't enable our fancy header guard optimization (e.g. when there's an include preceeding the guard) - Automatic insertion of a comment with the guard name after #endif. For the LLVM style we disable #endif comments for now, they're not very common in the codebase. We also only flag headers in the include directories, there doesn't seem to be a common style outside. Differential Revision: http://reviews.llvm.org/D4867 llvm-svn: 215548
OpenPOWER on IntegriCloud