summaryrefslogtreecommitdiffstats
path: root/clang/docs/analyzer
Commit message (Collapse)AuthorAgeFilesLines
* Fix the sphinx buildbot after D54429Kristof Umann2019-02-051-1/+1
| | | | llvm-svn: 353150
* [analyzer] Creating standard Sphinx documentationKristof Umann2019-02-0516-243/+2632
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lack of documentation has been a long standing issue in the Static Analyzer, and one of the leading reasons behind this was a lack of good documentation infrastucture. This lead serious drawbacks, such as * Not having proper release notes for years * Not being able to have a sensible auto-generated checker documentations (which lead to most of them not having any) * The HTML website that has to updated manually is a chore, and has been outdated for a long while * Many design discussions are now hidden in phabricator revisions This patch implements a new documentation infrastucture using Sphinx, like most of the other subprojects in LLVM. It transformed some pages as a proof-of- concept, with many others to follow in later patches. The eventual goal is to preserve the original website's (https://clang-analyzer.llvm.org/) frontpage, but move everything else to the new format. Some other ideas, like creating a unipage for each checker (similar to how clang-tidy works now), are also being discussed. Patch by Dániel Krupp! Differential Revision: https://reviews.llvm.org/D54429 llvm-svn: 353126
* [Documentation] Use HTTPS whenever possibleEugene Zelenko2019-01-231-1/+1
| | | | | | Differential revision: https://reviews.llvm.org/D56946 llvm-svn: 351976
* [analyzer] Fix some expressions staying live too long. Add a debug checker.Artem Dergachev2018-12-161-1/+4
| | | | | | | | | | | | | | | | | | | | | StaticAnalyzer uses the CFG-based RelaxedLiveVariables analysis in order to, in particular, figure out values of which expressions are still needed. When the expression becomes "dead", it is garbage-collected during the dead binding scan. Expressions that constitute branches/bodies of control flow statements, eg. `E1' in `if (C1) E1;' but not `E2' in `if (C2) { E2; }', were kept alive for too long. This caused false positives in MoveChecker because it relies on cleaning up loop-local variables when they go out of scope, but some of those live-for-too-long expressions were keeping a reference to those variables. Fix liveness analysis to correctly mark these expressions as dead. Add a debug checker, debug.DumpLiveStmts, in order to test expressions liveness. Differential Revision: https://reviews.llvm.org/D55566 llvm-svn: 349320
* [analyzer] Add a testing facility for testing relationships between symbols.Artem Dergachev2018-09-251-0/+17
| | | | | | | | | | | | | | | | | | Tests introduced in r329780 was disabled in r342317 because these tests were accidentally testing dump infrastructure, when all they cared about was how symbols relate to each other. So when dump infrastructure changed, tests became annoying to maintain. Add a new feature to ExprInspection: clang_analyzer_denote() and clang_analyzer_explain(). The former adds a notation to a symbol, the latter expresses another symbol in terms of previously denoted symbols. It's currently a bit wonky - doesn't print parentheses and only supports denoting atomic symbols. But it's even more readable that way. Differential Revision: https://reviews.llvm.org/D52133 llvm-svn: 343048
* [analyzer] Fix a typo in `RegionStore.txt`.Henry Wong2018-08-081-2/+2
| | | | | | | | | | | | | | Summary: The typo of the description for default bindings can be confusing. Reviewers: NoQ, george.karpenkov Reviewed By: NoQ, george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin, mikhail.ramalho, cfe-commits, MTC Differential Revision: https://reviews.llvm.org/D50382 llvm-svn: 339244
* Fix typos in clangAlexander Kornienko2018-04-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* [analyzer] Document the issue hash debugging facilityGabor Horvath2017-11-131-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D39543 llvm-svn: 318030
* [analyzer] Keep track of design discusions as part of analyzer documentation.Artem Dergachev2017-09-261-0/+321
| | | | | | | | | | | | Create a directory to store discussions on potentially useful features that are not yet implemented in the analyzer. Fill it with a discussion on representing checker-specific parts of the program state for C++ object modeling, that occured in D35216. Differential Revision: https://reviews.llvm.org/D36737 llvm-svn: 314218
* [NFC] [Analyzer] Fix RST markup in documentation.George Karpenkov2017-09-141-9/+9
| | | | llvm-svn: 313219
* Bump docs version to 6.0Hans Wennborg2017-07-191-2/+2
| | | | llvm-svn: 308466
* [analyzer] Improve usability of ExprInspectionCheckerAnna Zaks2017-03-091-1/+7
| | | | | | | | | | | | | | | | Some of the magic functions take arguments of arbitrary type. However, for semantic correctness, the compiler still requires a declaration of these functions with the correct type. Since C does not have argument-type-overloaded function, this made those functions hard to use in C code. Improve this situation by allowing arbitrary suffixes in the affected magic functions' names, thus allowing the user to create different declarations for different types. A patch by Keno Fischer! Differential Revision: https://reviews.llvm.org/D30589 llvm-svn: 297325
* Update docs/conf.py versionHans Wennborg2017-01-121-3/+3
| | | | llvm-svn: 291831
* [analyzer] Minor fixes and improvements to debug.ExprInspectionArtem Dergachev2016-11-301-0/+39
| | | | | | | | | | | | | | | | | | - Fix the bug with transition handling in ExprInspectionChecker's checkDeadSymbols implementation. - Test this bug by adding a new function clang_analyzer_numTimesReached() to catch number of passes through the code, which should be handy for testing against unintended state splits. - Add two more functions should help debugging issues quickly without running the debugger or dumping exploded graphs - clang_analyzer_dump() which dump()s an SVal argument to a warning message, and clang_analyzer_printState(), which dump()s the current program state to stderr. Differential Revision: https://reviews.llvm.org/D26835 llvm-svn: 288257
* Fix a typo in the doc: overriden -> overriddenSylvestre Ledru2016-08-281-1/+1
| | | | llvm-svn: 279942
* docs/conf.py: update version to 4.0Hans Wennborg2016-07-181-2/+2
| | | | llvm-svn: 275848
* Docs: keep copyright years up-to-date.Paul Robinson2016-03-301-1/+2
| | | | llvm-svn: 264941
* Remove autoconf supportChris Bieneman2016-01-261-155/+0
| | | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "This is the way [autoconf] ends Not with a bang but a whimper." -T.S. Eliot Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: klimek, cfe-commits Differential Revision: http://reviews.llvm.org/D16472 llvm-svn: 258862
* [analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion, v2.Artem Dergachev2016-01-151-0/+35
| | | | | | | | | | | | | | | | Provide separate visitor templates for the three hierarchies, and also the `FullSValVisitor' class, which is a union of all three visitors. Additionally, add a particular example visitor, `SValExplainer', in order to test the visitor templates. This visitor is capable of explaining the SVal, SymExpr, or MemRegion in a natural language. Compared to the reverted r257605, this fixes the test that used to fail on some triples, and fixes build failure under -fmodules. Differential Revision: http://reviews.llvm.org/D15448 llvm-svn: 257893
* Revert "[analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion."Artem Dergachev2016-01-131-35/+0
| | | | | | | | | This reverts commit r257605. The test fails on architectures that use unsigned int as size_t. SymbolManager.h fails with compile errors on some platforms. llvm-svn: 257608
* [analyzer] Provide .def-files and visitors for SVal/SymExpr/MemRegion.Artem Dergachev2016-01-131-0/+35
| | | | | | | | | | | | | Provide separate visitor templates for the three hierarchies, and also the `FullSValVisitor' class, which is a union of all three visitors. Additionally, add a particular example visitor, `SValExplainer', in order to test the visitor templates. This visitor is capable of explaining the SVal, SymExpr, or MemRegion in a natural language. Differential Revision: http://reviews.llvm.org/D15448 llvm-svn: 257605
* [analyzer] Fix symbolic element index lifetime.Artem Dergachev2015-12-101-0/+23
| | | | | | | | | | | | SymbolReaper was destroying the symbol too early when it was referenced only from an index SVal of a live ElementRegion. In order to test certain aspects of this patch, extend the debug.ExprInspection checker to allow testing SymbolReaper in a direct manner. Differential Revision: http://reviews.llvm.org/D12726 llvm-svn: 255236
* [Static Analyzer] Checks to catch nullability related issues.Gabor Horvath2015-08-261-0/+92
| | | | | | Differential Revision: http://reviews.llvm.org/D11468 llvm-svn: 246105
* Update the copyright credits -- Happy new year 2014!NAKAMURA Takumi2014-01-011-1/+1
| | | | | FIXME: Dragonegg may be updated at non-trivial changes. llvm-svn: 198274
* [analyzer] Add new debug helper clang_analyzer_warnIfReached.Jordan Rose2013-10-031-0/+13
| | | | | | | | | | | | | This will emit a warning if a call to clang_analyzer_warnIfReached is executed, printing REACHABLE. This is a more explicit way to declare expected reachability than using clang_analyzer_eval or triggering a bug (divide-by-zero or null dereference), and unlike the former will work the same in inlined functions and top-level functions. Like the other debug helpers, it is part of the debug.ExprInspection checker. Patch by Jared Grubb! llvm-svn: 191909
* [analyzer] Fix copy-paste error in internal docs.Jordan Rose2013-09-131-1/+1
| | | | | | Patch by Jared Grubb! llvm-svn: 190651
* [analyzer] Add a debug checker that prints Exploded GraphAnna Zaks2013-06-241-0/+4
| | | | | | | | | | | Add a debug checker that is useful to understand how the ExplodedGraph is built; it can be triggered using the following command: clang -cc1 -analyze -analyzer-checker=debug.ViewExplodedGraph my_program.c A patch by Béatrice Creusillet! llvm-svn: 184768
* We're in 3.4 land now.Bill Wendling2013-05-071-2/+2
| | | | llvm-svn: 181351
* [analyzer] Enable destructor inlining by default (c++-inlining=destructors).Jordan Rose2013-04-041-6/+35
| | | | | | | | | | | | | | | | | | | | | This turns on not only destructor inlining, but inlining of constructors for types with non-trivial destructors. Per r178516, we will still not inline the constructor or destructor of anything that looks like a container unless the analyzer-config option 'c++-container-inlining' is set to 'true'. In addition to the more precise path-sensitive model, this allows us to catch simple smart pointer issues: #include <memory> void test() { std::auto_ptr<int> releaser(new int[4]); } // memory allocated with 'new[]' should not be deleted with 'delete' <rdar://problem/12295363> llvm-svn: 178805
* [analyzer] Turn on C++ constructor inlining by default.Jordan Rose2013-02-271-3/+4
| | | | | | | | | | This enables constructor inlining for types with non-trivial destructors. The plan is to enable destructor inlining within the next month, but that needs further verification. <rdar://problem/12295329> llvm-svn: 176200
* [analyzer] Add a doc describing the internals of RegionStore.Jordan Rose2013-02-051-0/+171
| | | | | | | | This is a text file with Markdown-ish formatting because we haven't decided where analyzer internal documents should go, but it's probably better to have this in source control than sitting on my local drive forever. llvm-svn: 174398
* [analyzer] Remove further references to analyzer-ipa.Anna Zaks2013-01-301-34/+35
| | | | | | Thanks Jordan! llvm-svn: 173955
* [docs/analyzer] Test commit (for auto-update).Daniel Dunbar2013-01-071-0/+1
| | | | llvm-svn: 171788
* [docs/analyzer] Convert existing debug-checks document to Sphinx and link ↵Daniel Dunbar2013-01-074-90/+135
| | | | | | into doctree. llvm-svn: 171786
* analyzer: add initial Sphinx configurationSean Silva2013-01-024-0/+613
| | | | | | | | | | | This is just the output of sphinx-quickstart. Now all that is needed to begin converting the analyzer docs to reST is the server-side setup. The analyzer folks have asked me to keep this segregated from the other clang docs since the analyzer is a logically separate project (and has its own separate web page) even though it resides in the clang tree. llvm-svn: 171425
* docs: Nuke AnalyzerRegions.rst.Sean Silva2012-12-181-259/+0
| | | | | | | | | As per Ted's advice. It can be brought back from version control if needed. This also fixes a Sphinx warning. llvm-svn: 170401
* Remove old description of analyzer internals from public docs.Jordan Rose2012-12-151-0/+259
| | | | | | | | The file still exists in docs/analyzer/, but it won't be linked to from clang.llvm.org or processed as part of the default Sphinx doc-build. RegionStore has changed a lot from what Ted and Zhongxing describe here! llvm-svn: 170260
* [analyzer] Make the defaults explicit for each of the new config options.Jordan Rose2012-09-101-4/+39
| | | | | | Also, document both new inlining options in IPA.txt. llvm-svn: 163551
* [analyzer] Though C++ inlining is enabled, don't inline ctors and dtors.Jordan Rose2012-08-311-0/+20
| | | | | | | | | | | | | | | | More generally, this adds a new configuration option 'c++-inlining', which controls which C++ member functions can be considered for inlining. This uses the new -analyzer-config table, so the cc1 arguments will look like this: ... -analyzer-config c++-inlining=[none|methods|constructors|destructors] Note that each mode implies that all the previous member function kinds will be inlined as well; it doesn't make sense to inline destructors without inlining constructors, for example. The default mode is 'methods'. llvm-svn: 163004
* [analyzer] Make analyzer-ipa=dynamic-bifurcate the default.Anna Zaks2012-08-301-1/+1
| | | | | | | There are two tests regressions that come from the fact that the Retain Count checker does not cancel out inlining of ObjC methods. llvm-svn: 162950
* [analyzer] Don't inline constructors for objects allocated with operator new.Jordan Rose2012-08-271-1/+2
| | | | | | | | | | | Because the CXXNewExpr appears after the CXXConstructExpr in the CFG, we don't actually have the correct region to construct into at the time we decide whether or not to inline. The long-term fix (discussed in PR12014) might be to introduce a new CFG node (CFGAllocator) that appears before the constructor. Tracking the short-term fix in <rdar://problem/12180598>. llvm-svn: 162689
* [analyzer] Update inlining design notes for r162681.Jordan Rose2012-08-271-5/+7
| | | | llvm-svn: 162688
* [analyzer] Restructure discussion of DynamicTypeInfo and RuntimeDefinition.Jordan Rose2012-08-221-63/+65
| | | | | | | | | | Since DynamicTypeInfo is not inherently related to inlining or to dynamic calls, it makes more sense (to me) to discuss it first. Also fix some typos, massage some grammar, and (hopefully) improve precision and clarity. llvm-svn: 162365
* [analyzer] Per feedback, re-structure the docs for ExprInspection checks.Jordan Rose2012-08-221-30/+51
| | | | | | | | Also, remove the FIXME about merging -analyzer-stats and the debug.Stats checker. This would be a bad idea because simply running debug.Stats can affect the output of -analyzer-stats. llvm-svn: 162364
* [analyzer] IPA document: address Ted's review comments (pathAnna Zaks2012-08-221-27/+19
| | | | | | bifurcation) llvm-svn: 162343
* Review, comment, and reformat IPA.txt, including feedback comments.Ted Kremenek2012-08-221-53/+259
| | | | | | | | | | | | | | | | | | | | | | | | | | Formatting includes: - removing line wraps (Emacs Cmd-Q), to make text easier to read - provide useful indentation - call out caveats and notes more explictly Stylistically, I prefer the document talk in 3rd person instead of "we". The term "we" is unambiguous, and sometimes refers to different things. I've passed over the existing paragraphs and made them speak more about specific entities that compose the analyzer and what they do (e.g., ExprEngine) instead of "we" referring to the analyzer. Further, I have substituted some vague concepts such as "state" or "program state" and replaced them with their precise implementation counterparts (e.g., ProgramState). This makes the document more technically precise throughout the entire narrative, which would sometimes use vague terms and other times precise terms. I've placed several comments within the document, which can be seen with ***TMK/COMMENT***, which indicate places that need to be enhanced or clarified, or called out as questions about intended bheavior. llvm-svn: 162338
* [analyzer] Document our debug checkers and ExprInspection's "builtins".Jordan Rose2012-08-221-0/+68
| | | | llvm-svn: 162336
* [analyzer] Set the default IPA mode to 'basic-inlining', which excludes C++.Jordan Rose2012-08-211-3/+4
| | | | | | | | | | | | | | | | | | | Under -analyzer-ipa=basic-inlining, only C functions, blocks, and C++ static member functions are inlined -- essentially, the calls that behave like simple C function calls. This is essentially the behavior in Xcode 4.4. C++ support still has some rough edges, and we don't want users to be worried about them if they download and run their own checker. (In particular, the massive number of false positives for analyzing LLVM comes from inlining defensively-written code in contexts where more aggressive assumptions are implicitly made. This problem is not unique to C++, but it is exacerbated by the higher proportion of code that lives in header files in C++.) The eventual goal is to be comfortable enough with C++ support (and simple Objective-C support) to advance to -analyzer-ipa=inlining as the default behavior. See the IPA design notes for more details. llvm-svn: 162318
* [analyzer] Add an internal reference document describing IPA and CallEvent.Jordan Rose2012-08-171-0/+96
This attempts to be a higher-level description of our inlining heuristics and decision trees than the source, where the work is spread out between ExprEngine (mostly in ExprEngineCallAndReturn.cpp) and CallEvent, with a few other classes participating as well. llvm-svn: 162073
OpenPOWER on IntegriCloud