summaryrefslogtreecommitdiffstats
path: root/clang/lib/StaticAnalyzer
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Parsing and sema analysis for 'omp task' directive.Alexey Bataev2014-07-111-0/+1
| | | | llvm-svn: 212804
* TestAfterDivZeroChecker.cpp: Avoid member initializer. It is unsupported in ↵NAKAMURA Takumi2014-07-111-2/+2
| | | | | | msc17. llvm-svn: 212789
* [analyzer] Check for code testing a variable for 0 after using it as a ↵Jordan Rose2014-07-103-0/+269
| | | | | | | | | | | | | | | | | | | denominator. This new checker, alpha.core.TestAfterDivZero, catches issues like this: int sum = ... int avg = sum / count; // potential division by zero... if (count == 0) { ... } // ...caught here Because the analyzer does not necessarily explore /all/ paths through a program, this check is restricted to only work on zero checks that immediately follow a division operation (/ % /= %=). This could later be expanded to handle checks dominated by a division operation but not necessarily in the same CFG block. Patch by Anders Rönnholm! (with very minor modifications by me) llvm-svn: 212731
* [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.Alexey Bataev2014-07-081-0/+1
| | | | llvm-svn: 212516
* [OPENMP] Added initial support for 'omp parallel for'.Alexey Bataev2014-07-071-0/+1
| | | | llvm-svn: 212453
* StaticAnalyzer: Silence a warningDavid Majnemer2014-07-071-0/+1
| | | | | | | ExprEngine wasn't ready for SEHLeaveStmtClass. Handle it like all the other SEH constructs by aborting. llvm-svn: 212436
* PlistSupport.h: avoid gcc 'defined but not used' warningAlp Toker2014-07-061-2/+1
| | | | llvm-svn: 212396
* Modernize a couple of loopsAlp Toker2014-07-061-5/+2
| | | | llvm-svn: 212394
* Use PlistSupport in a few more placesAlp Toker2014-07-061-2/+2
| | | | | | Switch over LogDiagnosticPrinter and introduce an integer helper. llvm-svn: 212384
* Track IntrusiveRefCntPtr::get() changes from LLVM r212366Alp Toker2014-07-057-24/+24
| | | | llvm-svn: 212369
* Remove llvm:: from uses of ArrayRef.Craig Topper2014-06-281-1/+1
| | | | llvm-svn: 211987
* Do not inline methods of C++ containers (coming from headers).Anna Zaks2014-06-272-15/+13
| | | | | | | | | | | | | | | | | | | This silences false positives (leaks, use of uninitialized value) in simple code that uses containers such as std::vector and std::list. The analyzer cannot reason about the internal invariances of those data structures which leads to false positives. Until we come up with a better solution to that problem, let's just not inline the methods of the containers and allow objects to escape whenever such methods are called. This just extends an already existing flag "c++-container-inlining" and applies the heuristic not only to constructors and destructors of the containers, but to all of their methods. We have a bunch of distinct user reports all related to this issue (radar://16058651, radar://16580751, radar://16384286, radar://16795491 [PR19637]). llvm-svn: 211832
* [OPENMP] Initial parsing and sema analysis for 'single' directive.Alexey Bataev2014-06-261-0/+1
| | | | llvm-svn: 211774
* [OPENMP] Initial parsing and sema analysis for 'section' directive.Alexey Bataev2014-06-261-0/+1
| | | | llvm-svn: 211767
* [OPENMP] Initial support for 'sections' directive.Alexey Bataev2014-06-251-0/+1
| | | | llvm-svn: 211685
* StaticAnalyzer: Switch a loop to a range-based forDavid Majnemer2014-06-231-3/+2
| | | | | | Merely a code simplification, no functionality change. llvm-svn: 211484
* [analyzer] Check for NULL passed to CFAutorelease.Jordan Rose2014-06-211-6/+11
| | | | | | Patch by Sean McBride, tests adjusted by me. llvm-svn: 211453
* [analyzer] Don't create new PostStmt nodes if we don't have to.Jordan Rose2014-06-181-1/+1
| | | | | | | | Doing this caused us to mistakenly think we'd seen a particular state before when we actually hadn't, which resulted in false negatives. Credit to Rafael Auler for discovering this issue! llvm-svn: 211209
* [OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with ↵Alexey Bataev2014-06-181-0/+1
| | | | | | MSVC). llvm-svn: 211140
* Revert "[OPENMP] Initial support for '#pragma omp for'."Rafael Espindola2014-06-171-1/+0
| | | | | | | | This reverts commit r211096. Looks like it broke the msvc build: SemaOpenMP.cpp(140) : error C4519: default template arguments are only allowed on a class template llvm-svn: 211113
* [OPENMP] Initial support for '#pragma omp for'.Alexey Bataev2014-06-171-0/+1
| | | | llvm-svn: 211096
* One of our buildbot for FreeBSD does not support std::to_string.Sylvestre Ledru2014-06-141-6/+8
| | | | | | Use stringstream instead to convert int to string llvm-svn: 210972
* List the function/method name in the index page of scan-buildSylvestre Ledru2014-06-141-0/+4
| | | | llvm-svn: 210971
* With the option '-analyzer-config stable-report-filename=true',Sylvestre Ledru2014-06-142-16/+76
| | | | | | | | instead of report-XXXXXX.html, scan-build/clang analyzer generate report-<filename>-<function, method name>-<function position>-<id>.html. (id = i++ for several issues found in the same function/method) llvm-svn: 210970
* Fix a crash in Retain Count checker error reportingAnna Zaks2014-06-131-5/+18
| | | | | | | | | Fixes a crash in Retain Count checker error reporting logic by handing the allocation statement retrieval from a BlockEdge program point. Also added a simple CFG dump routine for debugging. llvm-svn: 210960
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-121-2/+2
| | | | llvm-svn: 210780
* Removing an "if (this == nullptr)" check from two print methods. The conditionRichard Trieu2014-06-093-2/+7
| | | | | | | will never be true in a well-defined context. The checking for null pointers has been moved into the caller logic so it does not rely on undefined behavior. llvm-svn: 210498
* Don't assume an implicit IntrusiveRefCntPtr -> bool operator.Rafael Espindola2014-06-031-1/+1
| | | | llvm-svn: 210075
* Move the logic for testing for namespace std into one location. This check canRichard Trieu2014-05-283-4/+4
| | | | | | be performed by using Decl::isInStdNamespace or DeclContext::isStdNamespace llvm-svn: 209708
* [C++11] Use 'nullptr'. StaticAnalyzer edition.Craig Topper2014-05-2765-530/+550
| | | | llvm-svn: 209642
* revert "r209526 List the function/method name in the index page of scan-build "Sylvestre Ledru2014-05-231-4/+0
| | | | | | Depends on http://reviews.llvm.org/D3762 llvm-svn: 209527
* List the function/method name in the index page of scan-build Sylvestre Ledru2014-05-231-0/+4
| | | | llvm-svn: 209526
* Clean up language and grammar.Eric Christopher2014-05-201-1/+1
| | | | | | | Based on a patch by jfcaron3@gmail.com! PR19806 llvm-svn: 209215
* Fix typosAlp Toker2014-05-151-1/+1
| | | | llvm-svn: 208838
* Silence warning in Release builds. This function is only used in an assert.Benjamin Kramer2014-05-111-0/+2
| | | | llvm-svn: 208491
* Analyzer: Make helper function static.Benjamin Kramer2014-05-101-1/+1
| | | | llvm-svn: 208473
* Decouple ExprCXX.h and DeclCXX.h and clean up includes a bit.Benjamin Kramer2014-05-101-0/+1
| | | | | | | Required pulling LambdaExpr::Capture into its own header. No functionality change. llvm-svn: 208470
* NSOrCFErrorDerefChecker: Don't leak bug type. Similar to r208110/r208155. ↵Nico Weber2014-05-071-4/+12
| | | | | | Found by LSan. llvm-svn: 208251
* [analyzer] Use a lazily-initialized BugType in ObjCSelfInitChecker.Jordan Rose2014-05-071-10/+6
| | | | | | Follow-up to Nico's leak-stopping patch in r208110. llvm-svn: 208155
* [analyzer] Functions marked __attribute__((const)) don't modify any memory.Jordan Rose2014-05-071-0/+5
| | | | | | | | | This applies to __attribute__((pure)) as well, but 'const' is more interesting because many of our builtins are marked 'const'. PR19661 llvm-svn: 208154
* Fix leak in ObjCSelfInitChecker, found by LSan.Nico Weber2014-05-061-19/+18
| | | | | | | | BugReport doesn't take ownership of the bug type, so let the checker own the the bug type. (Requires making the bug type mutable, which is icky, but which is also what other checkers do.) llvm-svn: 208110
* Fix crash when resolving branch conditions for temporary destructor ↵Manuel Klimek2014-05-051-12/+34
| | | | | | | | | | | | | | | | | | | | condition blocks. Document and simplify ResolveCondition. 1. Introduce a temporary special case for temporary desctructors when resolving the branch condition - in an upcoming patch, alexmc will change temporary destructor conditions to not run through this logic, in which case we can remove this (marked as FIXME); this currently fixes a crash. 2. Simplify ResolveCondition; while documenting the function, I noticed that it always returns the last statement - either that statement is the condition itself (in which case the condition was returned anyway), or the rightmost leaf is returned; for correctness, the rightmost leaf must be evaluated anyway (which the CFG does in the last statement), thus we can just return the last statement in that case, too. Added an assert to verify the invariant. llvm-svn: 207957
* [leaks] The PDFileEntry nodes in the FilesMade FoldingSet containChandler Carruth2014-05-031-0/+5
| | | | | | | | a std::vector that allocates on the heap. As a consequence, we have to run all of their destructors when tearing down the set, not just deallocate the memory blobs. llvm-svn: 207902
* Updated the attribute tablegen emitter for variadic arguments to emit a ↵Aaron Ballman2014-05-021-3/+2
| | | | | | range accessor in addition to the iterators. Updated code using iterators to use range-based for loops. llvm-svn: 207837
* [analyzer] Don't assert when combining using .* on a temporary.Jordan Rose2014-04-291-0/+6
| | | | | | | | | | | | | While we don't model pointer-to-member operators yet (neither .* nor ->*), CallAndMessageChecker still checks to make sure the 'this' object is not null or undefined first. However, it also expects that the object should always have a valid MemRegion, something that's generally important elsewhere in the analyzer as well. Ensure this is true ahead of time, just like we do for member access. PR19531 llvm-svn: 207561
* [analyzer] Don't crash when a construction is followed by an uninitialized ↵Jordan Rose2014-04-291-1/+1
| | | | | | | | | | variable. This could happen due to unfortunate CFG coincidences. PR19579 llvm-svn: 207486
* [analyzer] Fix a leak found by LSan.Jordan Rose2014-04-231-4/+4
| | | | | | PR19524 llvm-svn: 207001
* Don't pass llvm::DenseSet<> by value.Alexander Kornienko2014-04-231-4/+4
| | | | | | | | | | | | | | Summary: Fixes massive performance problems on large translation units. Reviewers: jordan_rose Reviewed By: jordan_rose Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D3471 llvm-svn: 206999
* [Modules] Fix potential ODR violations by sinking the DEBUG_TYPEChandler Carruth2014-04-226-12/+12
| | | | | | | | | | definition below all of the header #include lines, clang edition. If you want more details about this, you can see some of the commits to Debug.h in LLVM recently. This is just the clang section of a cleanup I've done for all uses of DEBUG_TYPE in LLVM. llvm-svn: 206849
* Add missing include.Richard Trieu2014-04-091-0/+1
| | | | llvm-svn: 205828
OpenPOWER on IntegriCloud