Commit Graph

12 Commits

Author SHA1 Message Date
Stephen Kelly d20961c657 [clang-tidy] Simplify delete null ptr check
Because it no longer relies on finding implicit casts, this check now
works on templates which are not instantiated in the translation unit.

Differential Revision: https://reviews.llvm.org/D96138
2021-02-17 10:18:36 +00:00
Alexander Kornienko 027899dab6 Remove references to the ast_type_traits namespace
Follow up to cd62511496 /
https://reviews.llvm.org/D74499

Reviewed By: aaron.ballman

Differential Revision: https://reviews.llvm.org/D92994
2020-12-11 00:58:46 +01:00
Stephen Kelly a72307c3a6 Set traversal explicitly where needed in clang-tidy
Reviewers: aaron.ballman

Subscribers: nemanjai, kbarton, arphaman, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72530
2020-05-21 22:34:37 +01:00
Nathan James 4f0cc10bf5 [NFC][clang-tidy] use hasOperands in place of hasEitherOperand 2020-05-18 10:11:22 +01:00
Mads Ravn bd324fa227 DeleteNullPointerCheck now deletes until the end brace of the condition.
Patch by Jonathan Camilleri

Differential Revision https://reviews.llvm.org/D61861

llvm-svn: 361735
2019-05-26 17:00:38 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
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
2019-01-19 08:50:56 +00:00
Stephen Kelly c09197e086 Port getLocEnd -> getEndLoc
Subscribers: nemanjai, ioeric, kbarton, cfe-commits

Differential Revision: https://reviews.llvm.org/D50355

llvm-svn: 339401
2018-08-09 22:43:02 +00:00
Stephen Kelly 43465bf3fd Port getLocStart -> getBeginLoc
Reviewers: javed.absar

Subscribers: nemanjai, kbarton, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits

Differential Revision: https://reviews.llvm.org/D50354

llvm-svn: 339400
2018-08-09 22:42:26 +00:00
Alexander Kornienko 9bf7037ccd [clang-tidy] Small cleanup. NFC.
llvm-svn: 298315
2017-03-20 22:15:19 +00:00
Mads Ravn 183e9644b9 [clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not work for class members
Fix for commit r294912 which had a small error in the AST matcher.

llvm-svn: 294913
2017-02-12 20:35:42 +00:00
Mads Ravn 6ff978fd54 [clang-tidy] Fix for bug 31838: readability-delete-null-pointer does not work for class members
I have made a small fix for readability-delete-null-pointer check so it also checks for class members.

Example of case that it fixes
```
  struct A {
    void foo() {
      if(mp)
        delete mp;
    }
    int *mp;
  };
```

Reviewers: JDevlieghere, aaron.ballman, alexfh, malcolm.parsons

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D29726

llvm-svn: 294912
2017-02-12 20:09:59 +00:00
Gabor Horvath 7510d9aa8a [clang-tidy] Add delete null pointer check.
This check detects and fixes redundant null checks before deletes.

Patch by: Gergely Angeli!

Differential Revision: https://reviews.llvm.org/D21298

llvm-svn: 290784
2016-12-31 12:45:59 +00:00