- Apr 01, 2012
-
-
Benjamin Kramer authored
Analyzer: Store BugReports directly in a ilist instead of adding another layer of inderection with std::list llvm-svn: 153847
-
- Mar 30, 2012
-
-
Anna Zaks authored
Fixes a false positive (radar://11152419). The current solution of adding the info into 3 places is quite ugly. Pending a generic pointer escapes callback. llvm-svn: 153731
-
- Mar 28, 2012
-
-
Anna Zaks authored
the root function. (This is a bit cleaner then using the StackFrame.) llvm-svn: 153580
-
- Mar 27, 2012
-
-
Anna Zaks authored
Report root function name with exhausted block diagnostic. Also, use stack frames, not just any location context when checking if the basic block is in the same context. llvm-svn: 153532
-
Ted Kremenek authored
assigned to a struct. This is fallout from inlining results, which expose far more patterns where people stuff CF objects into structs and pass them around (and we can reason about it). The problem is that we don't have a general way to detect when values have escaped, so as an intermediate step we need to eagerly prune out such tracking. Fixes <rdar://problem/11104566>. llvm-svn: 153489
-
- Mar 26, 2012
-
-
Anna Zaks authored
llvm-svn: 153453
-
- Mar 24, 2012
-
-
Jordy Rose authored
[analyzer] Tighten up the realloc() failure path note generation...make sure we get the right realloc()! llvm-svn: 153370
-
Jordy Rose authored
[analyzer] Restart path diagnostic generation if any of the visitors change the report configuration while walking the path. This required adding a change count token to BugReport, but also allowed us to ditch ImmutableList as the BugReporterVisitor data type. Also, remove the hack from MallocChecker, now that visitors appear in the opposite order. This is not exactly a fix, but the common case -- custom diagnostics after generic ones -- is now the default behavior. llvm-svn: 153369
-
Jordy Rose authored
[analyzer] Add a clone() method to BugReporterVisitor, so that we'll be able to reset diagnostic generation. llvm-svn: 153368
-
- Mar 23, 2012
-
-
Ted Kremenek authored
Avoid applying retain/release effects twice in RetainCountChecker when a function call was inlined (i.e., we do not need to apply summaries in such cases). llvm-svn: 153309
-
Anton Yartsev authored
llvm-svn: 153302
-
- Mar 22, 2012
-
-
Anna Zaks authored
llvm-svn: 153280
-
Anna Zaks authored
(Stats Checker). llvm-svn: 153279
-
Ted Kremenek authored
"Teach" RetainCountChecker about dispatch_set_context, which can indirectly free its argument later. Fixes <rdar://problem/11059275>. llvm-svn: 153244
-
Anna Zaks authored
llvm-svn: 153232
-
- Mar 21, 2012
-
-
Benjamin Kramer authored
llvm-svn: 153220
-
Anna Zaks authored
Specifically, we use the last store of the leaked symbol in the leak diagnostic. (No support for struct fields since the malloc checker doesn't track those yet.) + Infrastructure to track the regions used in store evaluations. This approach is more precise than iterating the store to obtain the region bound to the symbol, which is used in RetainCount checker. The region corresponds to what is uttered in the code in the last store and we do not rely on the store implementation to support this functionality. llvm-svn: 153212
-
Anna Zaks authored
So that others could use it as well. No functionality change. llvm-svn: 153211
-
- Mar 18, 2012
-
-
Jordy Rose authored
[analyzer] Mark a failed-realloc's result as an interesting symbol between the realloc call and the null check, so we get nicer path notes. Fixes a regression introduced by the diagnostic pruning added in r152361. This is accomplished by calling markInteresting /during/ path diagnostic generation, and as such relies on deterministic ordering of BugReporterVisitors -- namely, that BugReporterVisitors are run in /reverse/ order from how they are added. (Right now that's a consequence of storing visitors in an ImmutableList, where new items are added to the front.) It's a little hacky, but it works for now. I think this is the best we can do without storing the relation between the old and new symbols, and that would be a hit whether or not there ends up being an error. llvm-svn: 153010
-
Jordy Rose authored
[analyzer] Use a FoldingSet to cache simple RetainSummary instances, rather than explicitly keeping DoNothing and StopTracking summaries and nothing else. I tried to test the effects of this change on memory usage and run time, but what I saw on retain-release.m was indistinguishable from noise (debug and release builds). Even so, some caveman profiling showed 101 cache hits that we would have generated new summaries for before (i.e. not default or stop summaries), and the more code we analyze, the more memory we should save. Maybe we should have a standard project for benchmarking the retain count checker's memory and time? llvm-svn: 153007
-
- Mar 17, 2012
-
-
Jordy Rose authored
[analyzer] Unify retain-count summary generation for class and instance methods. No functionality change. llvm-svn: 153001
-
Jordy Rose authored
The cocoa::deriveNamingConventions helper is just using method families anyway now, and the way RetainSummaryTemplate works means we're allocating an extra summary for every method with a relevant family. Also, fix RetainSummaryTemplate to do the right thing w/r/t annotating an /existing/ summary. This was probably the real cause of <rdar://problem/10824732> and the fix in r152448. llvm-svn: 152998
-
Jordy Rose authored
[analyzer] Don't claim an object was returned with +1 retain count before counting autoreleases. Fixes PR10376. (Also, 80-column violations.) llvm-svn: 152976
-
Anna Zaks authored
Do not display the standard "Returning from 'foo'", when a stack hint is available. llvm-svn: 152964
-
Anna Zaks authored
The symbol-aware stack hint combines the checker-provided message with the information about how the symbol was passed to the callee: as a parameter or a return value. For malloc, the generated messages look like this : "Returning from 'foo'; released memory via 1st parameter" "Returning from 'foo'; allocated memory via 1st parameter" "Returning from 'foo'; allocated memory returned" "Returning from 'foo'; reallocation of 1st parameter failed" (We are yet to handle cases when the symbol is a field in a struct or an array element.) llvm-svn: 152962
-
- Mar 15, 2012
-
-
Anna Zaks authored
BugVisitor DiagnosticPieces. When checkers create a DiagnosticPieceEvent, they can supply an extra string, which will be concatenated with the call exit message for every call on the stack between the diagnostic event and the final bug report. (This is a simple version, which could be/will be further enhanced.) For example, this is used in Malloc checker to produce the ", which allocated memory" in the following example: static char *malloc_wrapper() { // 2. Entered call from 'use' return malloc(12); // 3. Memory is allocated } void use() { char *v; v = malloc_wrapper(); // 1. Calling 'malloc_wrappers' // 4. Returning from 'malloc_wrapper', which allocated memory } // 5. Memory is never released; potential memory leak llvm-svn: 152837
-
- Mar 11, 2012
-
-
David Blaikie authored
The member variable is always "LangOpts" and the member function is always "getLangOpts". Reviewed by Chris Lattner llvm-svn: 152536
-
Jordy Rose authored
llvm-svn: 152521
-
- Mar 10, 2012
-
-
John McCall authored
track whether the referenced declaration comes from an enclosing local context. I'm amenable to suggestions about the exact meaning of this bit. llvm-svn: 152491
-
Ted Kremenek authored
Teach RetainCountChecker about mixing method families with explicit annotations. Fixes <rdar://problem/10824732>. llvm-svn: 152448
-
- Mar 09, 2012
-
-
Ted Kremenek authored
Essentially, a bug centers around a story for various symbols and regions. We should only include the path diagnostic events that relate to those symbols and regions. The pruning is done by associating a set of interesting symbols and regions with a BugReporter, which can be modified at BugReport creation or by BugReporterVisitors. This patch reduces the diagnostics emitted in several of our test cases. I've vetted these as having desired behavior. The only regression is a missing null check diagnostic for the return value of realloc() in test/Analysis/malloc-plist.c. This will require some investigation to fix, and I have added a FIXME to the test case. llvm-svn: 152361
-
- Mar 08, 2012
-
-
Anna Zaks authored
The final graph contains a single root node, which is a parent of all externally available functions(and 'main'). As well as a list of Parentless/Unreachable functions, which are either truly unreachable or are unreachable due to our analyses imprecision. The analyzer checkers debug.DumpCallGraph or debug.ViewGraph can be used to look at the produced graph. Currently, the graph is not very precise, for example, it entirely skips edges resulted from ObjC method calls. llvm-svn: 152272
-
- Mar 06, 2012
-
-
Ted Kremenek authored
llvm-svn: 152139
-
Jordy Rose authored
llvm-svn: 152080
-
Jordy Rose authored
llvm-svn: 152078
-
Ted Kremenek authored
when the called function is never inlined. Fixes <rdar://problem/10977037>. llvm-svn: 152073
-
- Mar 05, 2012
- Mar 03, 2012
-
-
Ted Kremenek authored
[analyzer] do not warn about returning stack-allocated memory when it comes from an ancestor stack frame. llvm-svn: 151964
-
- Mar 01, 2012
-
-
Anna Zaks authored
attributes, introduced in r151188. + the test to catch it. Thanks to Ahmed Charles for pointing this out. llvm-svn: 151840
-