summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clang-tidy/misc/StaticAssertCheck.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Make SourceManager::createFileID(UnownedTag, ...) take a const ↵Nico Weber2019-04-041-1/+1
| | | | | | | | | | | | | | | | | | | | | llvm::MemoryBuffer* Requires making the llvm::MemoryBuffer* stored by SourceManager const, which in turn requires making the accessors for that return const llvm::MemoryBuffer*s and updating all call sites. The original motivation for this was to use it and fix the TODO in CodeGenAction.cpp's ConvertBackendLocation() by using the UnownedTag version of createFileID, and since llvm::SourceMgr* hands out a const llvm::MemoryBuffer* this is required. I'm not sure if fixing the TODO this way actually works, but this seems like a good change on its own anyways. No intended behavior change. Differential Revision: https://reviews.llvm.org/D60247 llvm-svn: 357724
* 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
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-1/+1
| | | | | | | | Subscribers: nemanjai, ioeric, kbarton, cfe-commits Differential Revision: https://reviews.llvm.org/D50355 llvm-svn: 339401
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-2/+2
| | | | | | | | | | Reviewers: javed.absar Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50354 llvm-svn: 339400
* [clang-tidy] Make misc-static-assert accept assert(!"msg")Florian Gross2017-06-031-1/+3
| | | | | | | | Added negated string literals to the set of IsAlwaysFalse expressions to avoid flagging of assert(!"msg"). Differential Revision: http://reviews.llvm.org/D33827 llvm-svn: 304657
* [clang-tidy] remove trailing whitespaces and retabKirill Bobyrev2016-08-011-1/+1
| | | | llvm-svn: 277340
* [ASTMatchers] Added ignoringParenImpCasts to has matchersPiotr Padlewski2016-05-311-3/+4
| | | | | | | | | has matcher changed behaviour, and now it matches "as is" and doesn't skip implicit and paren casts http://reviews.llvm.org/D20801 llvm-svn: 271289
* [clang-tidy] Speedup misc-static-assert.Samuel Benzaquen2016-05-031-3/+7
| | | | | | | | | | | | | | | | | | | Summary: Speedup the misc-static-assert check by not use `stmt()` as the toplevel matcher. The framework runs a filter on the matchers before trying them on each node and uses the toplevel type for this. Using `stmt()` as the toplevel causes the matcher to be run on every `Stmt` node, even if the node doesn't match the desired types. This change speeds up clang-tidy by ~5% in a benchmark. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19877 llvm-svn: 268430
* [clang-tidy] Cleaning namespaces to be more consistant across checkers.Etienne Bergeron2016-05-021-0/+2
| | | | | | | | | | | | | | Summary: The goal of the patch is to bring checkers in their appropriate namespace. This path doesn't change any behavior. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D19811 llvm-svn: 268264
* Refactors AST matching code to use the new AST matcher names. This patch ↵Aaron Ballman2015-09-171-2/+2
| | | | | | correlates to r247885 which performs the AST matcher rename in Clang. llvm-svn: 247886
* Allow the static assert clang-tidy checker to run over C code.Aaron Ballman2015-08-311-4/+3
| | | | llvm-svn: 246495
* Using an early return as it is more clear; NFC.Aaron Ballman2015-08-311-38/+38
| | | | llvm-svn: 246447
* Disable clang-tidy misc checkers when not compiling in C++ mode. Many of the ↵Aaron Ballman2015-08-281-30/+42
| | | | | | checkers do not require additional testing as the tests will not compile for other languages or modes, or the checkers would never match a valid construct. llvm-svn: 246318
* [clang-tidy] Fix for llvm.org/PR23355Szabolcs Sipos2015-05-291-4/+7
| | | | | | misc-static-assert and misc-assert-side-effect will handle __builtin_expect based asserts correctly. llvm-svn: 238548
* [clang-tidy] Fix for llvm.org/PR23572Szabolcs Sipos2015-05-231-1/+3
| | | | | | misc-static-assert won't report asserts whose conditions contain calls to non constexpr functions. llvm-svn: 238098
* [clang-tidy] Fix for llvm.org/PR23161Szabolcs Sipos2015-05-081-1/+1
| | | | | | | | | | The misc-static-assert check will not warn on the followings: assert(NULL == "shouldn't warn"); assert(__null == "shouldn't warn"); Where NULL is a macro defined as __null. llvm-svn: 236812
* [clang-tidy] Fix for llvm.org/PR23161Szabolcs Sipos2015-04-101-8/+12
| | | | | | | | The misc-static-assert check will not warn on the followings: assert("Some message" == NULL); assert(NULL == "Some message"); llvm-svn: 234596
* [clang-tidy] Fix false positives in the misc-static-assert check ↵Alexander Kornienko2015-03-151-3/+11
| | | | | | | | | | | | | | | | http://llvm.org/PR22880 The misc-static-assert check will not warn on assert(false), assert(False), assert(FALSE); where false / False / FALSE are macros expanding to the false or 0 literals. Also added corresponding test cases. http://reviews.llvm.org/D8328 Patch by Szabolcs Sipos! llvm-svn: 232306
* [clang-tidy] Fix assertion when a dependent expression is used in an assert.Alexander Kornienko2015-03-091-1/+3
| | | | llvm-svn: 231620
* [clang-tidy] Assert related checkersAlexander Kornienko2015-03-021-0/+138
This patch contains two assert related checkers. These checkers are the part of those that is being open sourced by Ericsson (http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-December/040520.html). The checkers: AssertSideEffect: /// \brief Finds \c assert() with side effect. /// /// The conition of \c assert() is evaluated only in debug builds so a condition /// with side effect can cause different behaviour in debug / relesase builds. StaticAssert: /// \brief Replaces \c assert() with \c static_assert() if the condition is /// evaluatable at compile time. /// /// The condition of \c static_assert() is evaluated at compile time which is /// safer and more efficient. http://reviews.llvm.org/D7375 Patch by Szabolcs Sipos! llvm-svn: 230943
OpenPOWER on IntegriCloud