[clang-tidy] introduce legacy resource functions to 'cppcoreguidelines-owning-memory'
authorJonas Toth <jonas.toth@gmail.com>
Wed, 18 Oct 2017 16:14:15 +0000 (16:14 +0000)
committerJonas Toth <jonas.toth@gmail.com>
Wed, 18 Oct 2017 16:14:15 +0000 (16:14 +0000)
commitc9aea86e6af2bc1f7414f69f31428cf49273bf62
treeeb9d59a48d895e2799a488c3b416a79a7d66bc89
parent13ce95b77f54aa4a7ff01a46a5faaa85001755a6
[clang-tidy] introduce legacy resource functions to 'cppcoreguidelines-owning-memory'

Summary:
This patch introduces support for legacy C-style resource functions that must obey
the 'owner<>' semantics.

- added legacy creators like malloc,fopen,...
- added legacy consumers like free,fclose,...

This helps codes that mostly benefit from owner:
Legacy, C-Style code that isn't feasable to port directly to RAII but needs a step in between
to identify actual resource management and just using the resources.

Reviewers: aaron.ballman, alexfh, hokein

Reviewed By: aaron.ballman

Subscribers: nemanjai, JDevlieghere, xazax.hun, kbarton

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

llvm-svn: 316092
clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.cpp
clang-tools-extra/clang-tidy/cppcoreguidelines/OwningMemoryCheck.h
clang-tools-extra/docs/clang-tidy/checks/cppcoreguidelines-owning-memory.rst
clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-containers.cpp [new file with mode: 0644]
clang-tools-extra/test/clang-tidy/cppcoreguidelines-owning-memory-legacy-functions.cpp [new file with mode: 0644]