| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Makes life easier for downstream developers with different default standard.
llvm-svn: 375308
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
It's a new API for custom RTTI in Apple IOKit/DriverKit framework that is
similar to OSDynamicCast() that's already supported, but crashes instead of
returning null (and therefore causing UB when the cast fails unexpectedly).
Kind of like cast_or_null<> as opposed to dyn_cast_or_null<> in LLVM's RTTI.
Historically, RetainCountChecker was responsible for modeling OSDynamicCast.
This is simply an extension of the same functionality.
Differential Revision: https://reviews.llvm.org/D63117
llvm-svn: 363891
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary: -
Reviewers: NoQ, george.karpenkov
Reviewed By: NoQ
Subscribers: cfe-commits, xazax.hun, baloghadamsoftware, szepet, a.sidorin,
mikhail.ramalho, Szelethus, donat.nagy, dkrupp
Tags: #clang
Differential Revision: https://reviews.llvm.org/D58206
llvm-svn: 362026
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Summary:
Add extra messages to the bug report to inform the user why the analyzer
`Taking true/false branch`.
Reviewers: NoQ, george.karpenkov
Reviewed By: NoQ
Subscribers: gerazo, gsd, dkrupp, whisperity, baloghadamsoftware, xazax.hun,
eraman, szepet, a.sidorin, mikhail.ramalho, Szelethus,
donat.nagy, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D53076
llvm-svn: 362020
|
|
|
|
|
|
|
|
|
| |
The checker was crashing when it was trying to assume a structure
to be null or non-null so that to evaluate the effect of the annotation.
Differential Revision: https://reviews.llvm.org/D61958
llvm-svn: 360790
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the OSObject universe there appears to be another slightly popular contract,
apart from "create" and "get", which is "matching". It optionally consumes
a "table" parameter and if a table is passed, it fills in the table and
returns it at +0; otherwise, it creates a new table, fills it in and
returns it at +1.
For now suppress false positives by doing a conservative escape on all functions
that end with "Matching", which is the naming convention that seems to be
followed by all such methods.
Differential Revision: https://reviews.llvm.org/D61161
llvm-svn: 359264
|
|
|
|
|
|
|
|
|
|
| |
Track them for ISL/OS objects by default, and for NS/CF under a flag.
rdar://47536377
Differential Revision: https://reviews.llvm.org/D57356
llvm-svn: 352534
|
|
|
|
|
|
| |
Differential Revision: https://reviews.llvm.org/D57211
llvm-svn: 352530
|
|
|
|
|
|
|
|
|
|
| |
modeling assumes 'null' output
rdar://47397214
Differential Revision: https://reviews.llvm.org/D56952
llvm-svn: 351865
|
|
|
|
|
|
|
|
| |
RetainCountChecker
Differential Revision: https://reviews.llvm.org/D56951
llvm-svn: 351864
|
|
|
|
|
|
|
|
| |
This reverts commit 2cedaaef383d8d6142046074ffebc2bb5a914778.
Revert with a fix.
llvm-svn: 351575
|
|
|
|
|
|
|
| |
Revert r351508-351514, this block of changes introduced a consistent
MSan failure on the sanitizer bots.
llvm-svn: 351528
|
|
|
|
|
|
|
|
| |
Insert a note when the object becomes not (exclusively) owned.
Differential Revision: https://reviews.llvm.org/D56891
llvm-svn: 351514
|
|
|
|
|
|
|
|
| |
is used
Differential Revision: https://reviews.llvm.org/D56820
llvm-svn: 351509
|
|
|
|
|
|
|
|
| |
rdar://47323216
Differential Revision: https://reviews.llvm.org/D56817
llvm-svn: 351508
|
|
|
|
|
|
|
|
|
| |
This is not NFC strictly speaking, since it unifies CleanupAttr handling,
so that out parameters now also understand it.
Differential Revision: https://reviews.llvm.org/D56759
llvm-svn: 351394
|
|
|
|
|
|
|
|
|
| |
rdar://46357478
rdar://47121327
Differential Revision: https://reviews.llvm.org/D56240
llvm-svn: 350982
|
|
|
|
|
|
|
|
| |
for readability
Differential Revision: https://reviews.llvm.org/D56344
llvm-svn: 350867
|
|
|
|
| |
llvm-svn: 349943
|
|
|
|
|
|
|
|
|
|
| |
RetainCountChecker on type mismatch even for inlined functions"
This reverts commit b44b33f6e020a2c369da2b0c1d53cd52975f2526.
Revert the revert with the fix.
llvm-svn: 349939
|
|
|
|
|
|
|
|
| |
checker
It should be in the past tense.
llvm-svn: 349938
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
RetainCountChecker on type mismatch even for inlined functions
The fix done in D55465 did not previously apply when the function was inlined.
rdar://46889541
Differential Revision: https://reviews.llvm.org/D55976
........
Fixes broken buildbot: http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/14764
llvm-svn: 349894
|
|
|
|
|
|
|
|
|
|
|
|
| |
inlined functions
The fix done in D55465 did not previously apply when the function was inlined.
rdar://46889541
Differential Revision: https://reviews.llvm.org/D55976
llvm-svn: 349876
|
|
|
|
|
|
|
|
|
|
|
|
| |
mismatched summary in inlined functions
Previously, we were not printing a note at all if at least one of the parameters was not annotated.
rdar://46888422
Differential Revision: https://reviews.llvm.org/D55972
llvm-svn: 349875
|
|
|
|
|
|
|
|
|
|
|
|
| |
Right now they report to have one parameter with null decl,
because initializing an ArrayRef of pointers with a nullptr
yields an ArrayRef to an array of one null pointer.
Fixes a crash in the OSObject section of RetainCountChecker.
Differential Revision: https://reviews.llvm.org/D55671
llvm-svn: 349229
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
os_consumed summary
This is currently a diagnostics, but might be upgraded to an error in the future,
especially if we introduce os_return_on_success attributes.
rdar://46359592
Differential Revision: https://reviews.llvm.org/D55530
llvm-svn: 348820
|
|
|
|
|
|
|
|
| |
printed properly
Differential Revision: https://reviews.llvm.org/D55528
llvm-svn: 348819
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
primitive types
Escaping to void * / uint64_t / others non-OSObject * should stop tracking,
as such functions can have heterogeneous semantics depending on context,
and can not always be annotated.
rdar://46439133
Differential Revision: https://reviews.llvm.org/D55465
llvm-svn: 348675
|
|
|
|
|
|
|
|
|
| |
Allow enabling and disabling tracking of ObjC/CF objects
separately from tracking of OS objects.
Differential Revision: https://reviews.llvm.org/D55400
llvm-svn: 348638
|
|
|
|
|
|
|
|
| |
call consumes a reference for "this"
Differential Revision: https://reviews.llvm.org/D55158
llvm-svn: 348533
|
|
|
|
|
|
|
|
| |
RetainCountChecker
Differential Revision: https://reviews.llvm.org/D55351
llvm-svn: 348531
|
|
|
|
|
|
|
|
|
|
| |
with inheritance
rdar://46388388
Differential Revision: https://reviews.llvm.org/D55154
llvm-svn: 348396
|
|
|
|
|
|
|
|
| |
This reverts commit 5bad6129c012fbf186eb055be49344e790448ecc.
Hopefully fixing the issue which was breaking the bots.
llvm-svn: 348030
|
|
|
|
|
|
| |
http://lab.llvm.org:8011/builders/clang-cmake-armv8-lld/builds/440/steps/ninja%20check%202/logs/FAIL%3A%20Clang%3A%3Aosobject-retain-release.cpp
llvm-svn: 348020
|
|
|
|
| |
llvm-svn: 347951
|
|
|
|
|
|
|
|
|
| |
The "free" call frees the object immediately, ignoring the reference count.
Sadly, it is actually used in a few places, so we need to model it.
Differential Revision: https://reviews.llvm.org/D55092
llvm-svn: 347950
|
|
|
|
|
|
|
|
| |
directly using an operator "new"
Differential Revision: https://reviews.llvm.org/D55076
llvm-svn: 347949
|
|
|
|
|
|
|
|
| |
Instead of generalized reference counting annotations.
Differential Revision: https://reviews.llvm.org/D55041
llvm-svn: 347948
|
|
|
|
|
|
|
|
|
| |
Move visitors to the implementation file, move a complicated logic into
a function.
Differential Revision: https://reviews.llvm.org/D55036
llvm-svn: 347946
|
|
|
|
|
|
|
|
| |
(uppercase) are also getters.
Differential Revision: https://reviews.llvm.org/D55035
llvm-svn: 347945
|
|
|
|
|
|
|
|
|
|
|
| |
diagnostics
Attempt to get a fully qualified name from AST if an SVal corresponding
to the object is not available.
Differential Revision: https://reviews.llvm.org/D55034
llvm-svn: 347944
|
|
|
|
|
|
|
|
|
|
|
|
| |
If the object is a temporary, and there is no variable it binds to,
let's at least print out the object name in order to help differentiate
it from other temporaries.
rdar://45175098
Differential Revision: https://reviews.llvm.org/D55033
llvm-svn: 347943
|
|
|
|
|
|
|
|
|
|
| |
inlined function.
rdar://45532181
Differential Revision: https://reviews.llvm.org/D54973
llvm-svn: 347942
|
|
|
|
|
|
|
|
| |
Turns out the rule is quite ubiquitous.
Revert of https://reviews.llvm.org/D53628
llvm-svn: 345747
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
inlined code
Trusting summaries of inlined code would require a more thorough work,
as the current approach was causing too many false positives, as the new
example in test. The culprit lies in the fact that we currently escape
all variables written into a field (but not passed off to unknown
functions!), which can result in inconsistent behavior.
rdar://45655344
Differential Revision: https://reviews.llvm.org/D53902
llvm-svn: 345746
|
|
|
|
|
|
|
|
| |
The FP rate seems to be good enough now.
Differential Revision: https://reviews.llvm.org/D53849
llvm-svn: 345745
|
|
|
|
|
|
|
|
| |
constructors and operators
Differential Revision: https://reviews.llvm.org/D53660
llvm-svn: 345340
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, OSDynamicCast was modeled as an identity.
This is not correct: the output of OSDynamicCast may be zero even if the
input was not zero (if the class is not of desired type), and thus the
modeling led to false positives.
Instead, we are doing eager state split:
in one branch, the returned value is identical to the input parameter,
and in the other branch, the returned value is zero.
This patch required a substantial refactoring of canEval infrastructure,
as now it can return different function summaries, and not just true/false.
rdar://45497400
Differential Revision: https://reviews.llvm.org/D53624
llvm-svn: 345338
|
|
|
|
|
|
|
|
| |
Trust generalized annotations for OSObject.
Differential Revision: https://reviews.llvm.org/D53550
llvm-svn: 345100
|
|
|
|
|
|
|
|
| |
Refactor the way in which summaries are consumed for safeMetaCast
Differential Revision: https://reviews.llvm.org/D53549
llvm-svn: 345099
|