| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
| |
assertions.
To ensure that custom assertions/conditional would also be supported,
just check if the ivar that needs to be invalidated or set to nil is
compared against 0.
Unfortunately, this will not work for code containing 'assert(IvarName)'
llvm-svn: 172147
|
|
|
|
|
|
|
|
| |
In some cases, we just pick any ivar that needs invalidation and attach
the warning to it. Picking the first from DenseMap of pointer keys was
triggering non-deterministic output.
llvm-svn: 172134
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Restructured the checker so that it could easily find two new classes of
issues:
- when a class contains an invalidatable ivar, but no declaration of an
invalidation method
- when a class contains an invalidatable ivar, but no definition of an
invalidation method in the @implementation.
The second case might trigger some false positives, for example, when
the method is defined in a category.
llvm-svn: 172104
|
|
|
|
|
|
|
|
| |
imaginary and real parts yet.
Fixes false positive reported in <rdar://problem/12964481>.
llvm-svn: 171987
|
|
|
|
|
|
|
| |
This makes us more optimistic when matching reports in a changing code
base. Addresses Jordan's feedback for r171825.
llvm-svn: 171884
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The issue here is that if we have 2 leaks reported at the same line for
which we cannot print the corresponding region info, they will get
treated as the same by issue_hash+description. We need to AUGMENT the
issue_hash with the allocation info to differentiate the two issues.
Add the "hash" (offset from the beginning of a function) representing
allocation site to solve the issue.
We might want to generalize solution in the future when we decide to
track more than just the 2 locations from the diagnostics.
llvm-svn: 171825
|
|
|
|
|
|
| |
This gives more flexibility to what could be stored as issue_hash.
llvm-svn: 171824
|
|
|
|
|
|
|
|
|
| |
Better handle the blacklisting of known bad deallocators when symbol
escapes through a call to CFStringCreateWithBytesNoCopy.
Addresses radar://12702952.
llvm-svn: 171770
|
|
|
|
|
|
|
|
|
| |
When a property is "inherited" through both a parent class and directly
through a protocol, we should not require the child to invalidate it
since the backing ivar belongs to the parent class.
(Fixes radar://12913734)
llvm-svn: 171769
|
|
|
|
|
|
|
|
|
|
| |
actually include it's name.
This is a possible regression of moving to using ImplicitNullDerefEvent.
Fixing this for real (including the parameter name) requires more
plumbing in ImplicitNullDerefEvent. This is just a stop gap fix.
llvm-svn: 171502
|
|
|
|
| |
llvm-svn: 171501
|
|
|
|
| |
llvm-svn: 171439
|
|
|
|
|
|
|
| |
This better reflects when callback is called and what the checkers
are relying on. (Both names meant the same pre-IPA.)
llvm-svn: 171432
|
|
|
|
|
|
|
| |
Removes a duplicate #include as well as cleaning up some sort order
regressions since I last ran the script over Clang.
llvm-svn: 171364
|
|
|
|
|
|
|
|
| |
objc_no_direct_instance_variable_assignment.
Fixes <rdar://problem/12927551>.
llvm-svn: 170971
|
|
|
|
|
|
| |
The new callback greatly simplifies the checker.
llvm-svn: 170969
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
deterministic.
Commit message for r170826:
[analyzer] Traverse the Call Graph in topological order.
Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside
CallGraphNodes.
Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.
Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.
llvm-svn: 170906
|
|
|
|
| |
llvm-svn: 170903
|
|
|
|
| |
llvm-svn: 170832
|
|
|
|
|
|
|
|
| |
./bin/clang -cc1 -internal-isystem /home/espindola/llvm/build/lib/clang/3.3/include/ -analyze -analyzer-checker=debug.DumpCallGraph /home/espindola/llvm/clang/test/Analysis/debug-CallGraph.c -fblocks
changes in each run.
llvm-svn: 170829
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modify the call graph by removing the parentless nodes. Instead all
nodes are children of root to ensure they are all reachable. Remove the
tracking of nodes that are "top level" or global. This information is
not used and can be obtained from the Decls stored inside
CallGraphNodes.
Instead of existing ordering hacks, analyze the functions in topological
order over the Call Graph.
Together with the addition of devirtualizable ObjC message sends and
blocks to the call graph, this gives around 6% performance improvement
on several large ObjC benchmarks.
llvm-svn: 170826
|
|
|
|
|
|
|
|
|
|
|
| |
This paves the road for constructing a better function dependency graph.
If we analyze a function before the functions it calls and inlines,
there is more opportunity for optimization.
Note, we add call edges to the called methods that correspond to
function definitions (declarations with bodies).
llvm-svn: 170825
|
|
|
|
|
|
| |
Fixes <rdar://problem/12887356>.
llvm-svn: 170724
|
|
|
|
|
|
|
|
|
|
| |
Instead of using several callbacks to identify the pointer escape event,
checkers now can register for the checkPointerEscape.
Converted the Malloc checker to use the new callback.
SimpleStreamChecker will be converted next.
llvm-svn: 170625
|
|
|
|
|
|
|
|
| |
accessible there.
This is plumbing needed for later functionality changes.
llvm-svn: 170488
|
|
|
|
|
|
| |
of the include guards.
llvm-svn: 170364
|
|
|
|
| |
llvm-svn: 170362
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
performance heuristic
After inlining a function with more than 13 basic blocks 32 times, we
are not going to inline it anymore. The idea is that inlining large
functions leads to drastic performance implications. Since the function
has already been inlined, we know that we've analyzed it in many
contexts.
The following metrics are used:
- Large function is a function with more than 13 basic blocks (we
should switch to another metric, like cyclomatic complexity)
- We consider that we've inlined a function many times if it's been
inlined 32 times. This number is configurable with -analyzer-config
max-times-inline-large=xx
This heuristic addresses a performance regression introduced with
inlining on one benchmark. The analyzer on this benchmark became 60
times slower with inlining turned on. The heuristic allows us to analyze
it in 24% of the time. The performance improvements on the other
benchmarks I've tested with are much lower - under 10%, which is
expected.
llvm-svn: 170361
|
|
|
|
| |
llvm-svn: 170238
|
|
|
|
|
|
| |
CXXDeleteExpr
llvm-svn: 170234
|
|
|
|
|
|
|
| |
Fixes a bug, where we were dropping the state modifications from the
checkBranchCondition checker callback.
llvm-svn: 170232
|
|
|
|
| |
llvm-svn: 170231
|
|
|
|
| |
llvm-svn: 170170
|
|
|
|
|
|
| |
Thanks for the -Wdocumentation catch, Dmitri!
llvm-svn: 170139
|
|
|
|
|
|
|
|
| |
We now check a few methods for UIResponder, NSResponder, and NSDocument.
Patch by Julian Mayer!
llvm-svn: 170089
|
|
|
|
|
|
|
|
|
|
|
| |
This is a Band-Aid fix to a false positive, where we complain about not
initializing self to [super init], where self is not coming from the
init method, but is coming from the caller to init.
The proper solution would be to associate the self and it's state with
the enclosing init.
llvm-svn: 170059
|
|
|
|
|
|
|
|
|
|
| |
We don't handle array destructors correctly yet, but we now apply the same
hack (explicitly destroy the first element, implicitly invalidate the rest)
for multidimensional arrays that we already use for linear arrays.
<rdar://problem/12858542>
llvm-svn: 170000
|
|
|
|
|
|
|
|
|
| |
inlined.
Fixes a false positive that occurs if a user writes their own
initWithBytesNoCopy:freeWhenDone wrapper.
llvm-svn: 169795
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
top level.
This heuristic is already turned on for non-ObjC methods
(inlining-mode=noredundancy). If a method has been previously analyzed,
while being inlined inside of another method, do not reanalyze it as top
level.
This commit applies it to ObjCMethods as well. The main caveat here is
that to catch the retain release errors, we are still going to reanalyze
all the ObjC methods but without inlining turned on.
Gives 21% performance increase on one heavy ObjC benchmark, which
suffered large performance regressions due to ObjC inlining.
llvm-svn: 169639
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the case where the analyzer tries to print out source locations
for code within a synthesized function body, which of course does not have
a valid source location. The previous fix attempted to do this during
diagnostic path pruning, but some diagnostics have pruning disabled, and
so any diagnostic with a path that goes through a synthesized body will
either hit an assertion or emit invalid output.
<rdar://problem/12657843> (again)
llvm-svn: 169631
|
|
|
|
|
|
|
| |
This reduces canonicalization of ImmutableMaps. This reduces analysis time
of one heavy Objective-C file by another 1%.
llvm-svn: 169630
|
|
|
|
| |
llvm-svn: 169622
|
|
|
|
|
|
|
|
|
| |
ObjCMethodCall::getRuntimeDefinition().
The same queries can happen thousands of times. This reduces the analysis
time on one heavy Objective-C file by 2.4%.
llvm-svn: 169589
|
|
|
|
|
|
| |
avoiding over-eager canonicalization of clusters.
llvm-svn: 169586
|
|
|
|
| |
llvm-svn: 169581
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
bindings.
This reduces analysis time by 1.2% on one test case (Objective-C), but
also cleans up some of the code conceptually as well. We can possible
just make RegionBindingsRef -> RegionBindings, but I wanted to stage
things.
After this, we should revisit Jordan's optimization of not canonicalizing
the immutable AVL trees for the cluster bindings as well.
llvm-svn: 169571
|
|
|
|
|
|
|
|
| |
RegionStore."
Jordan and I discussed this, and we are going to do this another way.
llvm-svn: 169538
|
|
|
|
| |
llvm-svn: 169530
|
|
|
|
|
|
|
| |
'currStmt', 'CleanedState', and 'EntryNode' were being set, but only ever
used locally.
llvm-svn: 169529
|
|
|
|
| |
llvm-svn: 169528
|