summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/utils/HeaderGuard.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove \brief commands from doxygen comments.Dmitri Gribenko2019-08-221-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Summary: We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done [This is analogous to LLVM r331272 and CFE r331834] Subscribers: srhines, nemanjai, javed.absar, kbarton, MaskRay, jkorous, arphaman, jfb, kadircet, jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66578 llvm-svn: 369643
* [clang-tools-extra] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-1/+1
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368944
* [clang-tidy] Move all checks to the new registerPPCallbacks APIAlexander Kornienko2019-03-221-4/+4
| | | | llvm-svn: 356796
* 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
* Spelling mistakes in comments. NFCI.Simon Pilgrim2017-03-301-1/+1
| | | | | | Based on corrections mentioned in patch for clang for PR27635 llvm-svn: 299074
* [clang-tidy] Reword the "code outside header guard" warning.Benjamin Kramer2017-02-211-6/+6
| | | | | | | | | | | | The check doesn't really know if the code it is warning about came before or after the header guard, so phrase it more neutral instead of complaining about code before the header guard. The location for the warning is still not optimal, but I don't think fixing that is worth the effort, the preprocessor doesn't give us a better location. Differential Revision: https://reviews.llvm.org/D30191 llvm-svn: 295715
* [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