llvm-project/clang/test
Kristóf Umann 9d359f6c73 [analyzer] MallocChecker: Add notes from NoOwnershipChangeVisitor only when a function "intents", but doesn't change ownership, enable by default
D105819 Added NoOwnershipChangeVisitor, but it is only registered when an
off-by-default, hidden checker option was enabled. The reason behind this was
that it grossly overestimated the set of functions that really needed a note:

std::string getTrainName(const Train *T) {
  return T->name;
} // note: Retuning without changing the ownership of or deallocating memory
// Umm... I mean duh? Nor would I expect this function to do anything like that...

void foo() {
  Train *T = new Train("Land Plane");
  print(getTrainName(T)); // note: calling getTrainName / returning from getTrainName
} // warn: Memory leak

This patch adds a heuristic that guesses that any function that has an explicit
operator delete call could have be responsible for deallocating the memory that
ended up leaking. This is waaaay too conservative (see the TODOs in the new
function), but it safer to err on the side of too little than too much, and
would allow us to enable the option by default *now*, and add refinements
one-by-one.

Differential Revision: https://reviews.llvm.org/D108753
2021-09-13 15:01:20 +02:00
..
APINotes
ARCMT
AST Revert "[Coroutines] [Clang] Look up coroutine component in std namespace first" 2021-09-03 16:01:09 -04:00
ASTMerge
Analysis [analyzer] MallocChecker: Add notes from NoOwnershipChangeVisitor only when a function "intents", but doesn't change ownership, enable by default 2021-09-13 15:01:20 +02:00
CXX [clang] fix transformation of template arguments of 'auto' type constraints 2021-09-08 03:22:34 +02:00
ClangScanDeps [clang][deps] Move tests to the Clang subdirectory 2021-09-10 21:36:49 +02:00
CodeCompletion [CodeCompletion] Provide placeholders for known attribute arguments 2021-08-19 14:03:41 +02:00
CodeGen Revert "[clang] Check unsupported types in expressions" 2021-09-13 15:34:21 +03:00
CodeGenCUDA [CUDA] Fix static device variables with -fgpu-rdc 2021-08-25 09:31:22 +02:00
CodeGenCXX [Clang] Add __ibm128 type to represent ppc_fp128 2021-09-06 18:00:58 +08:00
CodeGenCoroutines Revert "[Coroutines] [Clang] Look up coroutine component in std namespace first" 2021-09-03 16:01:09 -04:00
CodeGenHIP
CodeGenObjC [ObjC][ARC] Use the addresses of the ARC runtime functions instead of 2021-09-08 11:56:22 -07:00
CodeGenObjCXX [ObjC][ARC] Use the addresses of the ARC runtime functions instead of 2021-09-08 11:56:22 -07:00
CodeGenOpenCL [OpenCL] Supports optional 64-bit floating point types in C++ for OpenCL 2021 2021-09-03 10:58:05 +01:00
CodeGenOpenCLCXX [C++4OpenCL] Introduces __remove_address_space utility 2021-08-06 10:40:22 +01:00
CodeGenSYCL Ensure field-annotations on pointers properly match the AS of the field. 2021-09-01 06:12:24 -07:00
Coverage Add a target triple to fix failures on MS build bots. 2021-06-30 17:27:26 -07:00
CoverageMapping Revert "[Coroutines] [Clang] Look up coroutine component in std namespace first" 2021-09-03 16:01:09 -04:00
Driver [clang] Make the driver not diagnose errors on nonexistent linker inputs 2021-09-13 08:57:38 -04:00
FixIt Implement P1949 2021-08-18 07:33:14 -04:00
Format Remove redundant test that was causing intermittent build bot failures. 2021-06-15 12:46:03 -07:00
Frontend [Clang] add support for error+warning fn attrs 2021-08-25 10:34:18 -07:00
Headers [OpenCL] Support cl_ext_float_atomics 2021-09-13 12:12:40 +01:00
Import
Index Revert "[Coroutines] [Clang] Look up coroutine component in std namespace first" 2021-09-03 16:01:09 -04:00
Integration
InterfaceStubs [ifs][elfabi] Merge llvm-ifs/elfabi tools 2021-07-19 11:23:19 -07:00
Interpreter Reland "[clang-repl] Allow passing in code as positional arguments." 2021-07-10 17:54:00 +00:00
Layout [AIX] Check for typedef properly when getting preferred type align 2021-09-08 16:21:52 -04:00
Lexer Implement #pragma clang restrict_expansion 2021-08-23 09:46:38 -07:00
LibClang libclang.so: Make SONAME independent from LLVM version 2021-07-26 16:37:26 -07:00
Misc [RISCV] Add SiFive cores E and S series 2021-09-08 23:59:04 -07:00
Modules [modules] Fix miscompilation when using two RecordDecl definitions with the same name. 2021-08-30 17:51:38 -07:00
OpenMP Revert "[clang] Check unsupported types in expressions" 2021-09-13 15:34:21 +03:00
PCH Revert "[Coroutines] [Clang] Look up coroutine component in std namespace first" 2021-09-03 16:01:09 -04:00
Parser Implement P1949 2021-08-18 07:33:14 -04:00
ParserSYCL
Preprocessor [X86] Add CRC32 feature. 2021-09-06 17:24:30 +08:00
Profile Update: clang/test/Profile/gcc-flag-compatibility.c to have -flto on AIX 2021-08-09 14:57:38 +00:00
Refactor
Rewriter
Sema [Sema] Add test for __builtin_fminf errors. 2021-09-13 11:12:06 +01:00
SemaCUDA [HIP] Warn capture this pointer in device lambda 2021-09-08 13:45:26 -04:00
SemaCXX [PowerPC] [NFC] Add Big-Endian checks for existing MMA tests 2021-09-12 20:39:27 -05:00
SemaObjC [Sema][ObjC] Allow conversions between pointers to ObjC pointers and 2021-08-25 10:22:29 -07:00
SemaObjCXX [clang] C++98 implicit moves are back with a vengeance 2021-07-13 19:16:49 +02:00
SemaOpenCL [OpenCL] Support cl_ext_float_atomics 2021-09-13 12:12:40 +01:00
SemaOpenCLCXX [OpenCL] Initialize temporaries in the private address space 2021-09-13 12:56:04 +01:00
SemaSYCL Revert "[clang] Check unsupported types in expressions" 2021-09-13 15:34:21 +03:00
SemaTemplate [clang] Enable the special enable_if_t diagnostics for libc++'s __enable_if_t as well. 2021-09-11 13:44:51 -05:00
TableGen
Templight
Tooling [clang][tooling] Accept Clang invocations with multiple jobs 2021-07-27 10:47:55 +02:00
Unit
VFS [Modules] Do not remove failed modules after the control block phase 2021-08-17 16:46:51 -07:00
clang-rename
utils/update_cc_test_checks [llvm-lit] unbreak clang-only builds by not assuming llvm-lit in build dir 2021-08-31 18:57:47 +03:00
.clang-format
CMakeLists.txt Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test case."" 2021-09-03 13:18:09 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg.py Revert "Reland "[clang-repl] Re-implement clang-interpreter as a test case."" 2021-09-03 13:18:09 +00:00
lit.site.cfg.py.in libclang.so: Make SONAME independent from LLVM version 2021-07-26 16:37:26 -07:00
make_test_dirs.pl