summaryrefslogtreecommitdiffstats
path: root/clang/utils/analyzer
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] exploded-graph-rewriter: Fix string encodings in python3.Artem Dergachev2019-12-211-1/+5
| | | | | | | | Makes sure that the script works fine both in python2 and python3. Patch by Pavel Samolysov! Differential Revision: https://reviews.llvm.org/D71746
* [analyzer] exploded-graph-rewriter: Rename Environment to Expressions.Artem Dergachev2019-10-181-1/+1
| | | | | | It's less confusing for newcomers. llvm-svn: 375282
* [analyzer] exploded-graph-rewriter: Fix dump for state 0.Artem Dergachev2019-10-181-2/+12
| | | | | | It shouldn't say "unspecified" when the state is specified to be empty. llvm-svn: 375279
* [analyzer] Assign truly stable identifiers to exploded nodes.Artem Dergachev2019-10-171-18/+25
| | | | | | | | | | | ExplodedGraph nodes will now have a numeric identifier stored in them which will keep track of the order in which the nodes were created and it will be fully deterministic both accross runs and across machines. This is extremely useful for debugging as it allows reliably setting conditional breakpoints by node IDs. llvm-svn: 375186
* [analyzer] Display cast kinds in program point dumps.Artem Dergachev2019-10-171-1/+5
| | | | | | | Because cast expressions have their own hierarchy, it's extremely useful to have some information about what kind of casts are we dealing with. llvm-svn: 375185
* [analyzer] exploded-graph-rewriter: Make node headers a bit lighter.Artem Dergachev2019-10-171-1/+1
| | | | | | The 50% grey color is too dark on some monitors. llvm-svn: 375184
* [analyzer] exploded-graph-rewriter: Implement displaying Store pointers.Artem Dergachev2019-08-131-0/+4
| | | | | | | | | They're useful when trying to understand what's going on inside your LazyCompoundValues. Differential Revision: https://reviews.llvm.org/D65427 llvm-svn: 368769
* [analyzer] exploded-graph-rewriter: Implement manual graph trimming.Artem Dergachev2019-08-131-0/+54
| | | | | | | | | | | | | | | | | | | When -trim-egraph is unavailable (say, when you're debugging a crash on a real-world code that takes too long to reduce), it makes sense to view the untrimmed graph up to the crashing node's predecessor, then dump the ID (or a pointer) of the node in the attached debugger, and then trim the dumped graph in order to keep only paths from the root to the node. The newly added --to flag does exactly that: $ exploded-graph-rewriter.py ExprEngine.dot --to 0x12229acd0 Multiple nodes can be specified. Stable IDs of nodes can be used instead of pointers. Differential Revision: https://reviews.llvm.org/D65345 llvm-svn: 368768
* [analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trimmers.Artem Dergachev2019-08-131-26/+33
| | | | | | | | | | | | | | | | | | | | | | | Explorers aren't the right abstraction. For the purposes of displaying svg files we don't care in which order do we explore the nodes. We may care about this for other analyses, but we're not there yet. The function of cutting out chunks of the graph is performed poorly by the explorers, because querying predecessors/successors on the explored nodes yields original successors/predecessors even if they aren't being explored. Introduce a new entity, "trimmers", that do one thing but to it right: cut out chunks of the graph. Trimmers mutate the graph, so stale edges aren't even visible to their consumers in the pipeline. Additionally, trimmers are intrinsically composable: multiple trimmers can be applied to the graph sequentially. Refactor the single-path explorer into the single-path trimmer. Rename the test file for consistency. Differential Revision: https://reviews.llvm.org/D65344 llvm-svn: 368767
* [analyzer] exploded-graph-rewriter: Open the converted graph immediately.Artem Dergachev2019-08-131-7/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | Change the default behavior: the tool no longer dumps the rewritten .dot file to stdout, but instead it automatically converts it into an .html file (which essentially wraps an .svg file) and immediately opens it with the default web browser. This means that the tool should now be fairly easy to use: $ exploded-graph-rewriter.py /tmp/ExprEngine.dot The benefits of wrapping the .svg file into an .html file are: - It'll open in a web browser, which is the intended behavior. An .svg file would be open with an image viewer/editor instead. - It avoids the white background around the otherwise dark svg area in dark mode. The feature can be turned off by passing a flag '--rewrite-only'. The LIT substitution is updated to enforce the old mode because we don't want web browsers opening on our buildbots. Differential Revision: https://reviews.llvm.org/D65250 llvm-svn: 368766
* [analyzer] exploded-graph-rewriter: Improve source location dumps.Artem Dergachev2019-07-121-26/+38
| | | | | | | | - Correctly display macro expansion and spelling locations. - Use the same procedure to display location context call site locations. - Display statement IDs for program points. llvm-svn: 365861
* [analyzer] exploded-graph-rewriter: Fix filenames in program point.Artem Dergachev2019-07-111-2/+3
| | | | | | Fix a typo in JSON field name. llvm-svn: 365827
* [analyzer] exploded-graph-rewriter: Implement a topology-only mode.Artem Dergachev2019-07-081-8/+13
| | | | | | | | | | In this mode the rewriter will only rewrite program points and omit program states. Useful for understanding the rough topology of the graph. Differential Revision: https://reviews.llvm.org/D64264 llvm-svn: 365410
* [analyzer] exploded-graph-rewriter: Implement a single-path mode.Artem Dergachev2019-07-081-3/+41
| | | | | | | | | | Instead of rewriting the whole graph, rewrite the leftmost path in the graph. Useful for trimmed graphs that are still too large to display due to multiple equivalent reports mixed into them. Differential Revision: https://reviews.llvm.org/D64263 llvm-svn: 365409
* [analyzer] exploded-graph-rewriter: Implement a black-and-white color scheme.Artem Dergachev2019-07-031-11/+18
| | | | | | | | For accessibility! Differential Revision: https://reviews.llvm.org/D64153 llvm-svn: 365085
* [analyzer] exploded-graph-rewriter: Implement bug nodes and sink nodes.Artem Dergachev2019-07-031-0/+8
| | | | | | | | | | | Add a label to nodes that have a bug report attached or on which the analysis was generally interrupted. Fix printing has_report and implement printing is_sink in the graph dumper. Differential Revision: https://reviews.llvm.org/D64110 llvm-svn: 364992
* [analyzer] exploded-graph-rewriter: NFC: Add more comments.Artem Dergachev2019-07-031-3/+25
| | | | llvm-svn: 364991
* [analyzer] exploded-graph-rewriter: Collapse very long statement pretty-prints.Artem Dergachev2019-07-031-3/+20
| | | | | | | | | | When printing various statements that include braces (compound statements, lambda expressions, statement-expressions, etc.), replace the code between braces with '...'. Differential Revision: https://reviews.llvm.org/D64104 llvm-svn: 364990
* [analyzer] exploded-graph-rewriter: Implement checker messages.Artem Dergachev2019-07-031-9/+104
| | | | | | | | They are displayed as raw lines and diffed via difflib on a per-checker basis. Differential Revision: https://reviews.llvm.org/D64100 llvm-svn: 364989
* [analyzer] exploded-graph-rewriter: Implement a dark color scheme.Artem Dergachev2019-07-021-11/+26
| | | | | | | | Addresses a popular request. Activated via --dark. Differential Revision: https://reviews.llvm.org/D64056 llvm-svn: 364882
* [analyzer] exploded-graph-rewriter: Improve program point dumps.Artem Dergachev2019-07-021-7/+26
| | | | | | | | | | | | - Take advantage of the stmt_point_kind. - Dump block IDs for BlockEntrance nodes. - Don't dump huge compound statements on PurgeDeadSymbols nodes. - Rename Edge to BlockEdge for consistency. - Tweak colors. Differential Revision: https://reviews.llvm.org/D64051 llvm-svn: 364881
* [analyzer] exploded-graph-rewriter: Add support for objects under construction.Artem Dergachev2019-07-021-22/+52
| | | | | | | | This trait is Environment-like, so there was a chance to re-use a lot of code. Differential Revision: https://reviews.llvm.org/D64047 llvm-svn: 364880
* [analyzer] exploded-graph-rewriter: Add support for dynamic types.Artem Dergachev2019-07-011-17/+25
| | | | | | | | | Slightly cleanup emission of horizontal lines and unhardcode the title for generic maps. Differential Revision: https://reviews.llvm.org/D64041 llvm-svn: 364865
* [analyzer] exploded-graph-rewriter: Implement program point tags.Artem Dergachev2019-07-011-0/+6
| | | | | | | | Keep them on a separate line for more visibility. Differential Revision: https://reviews.llvm.org/D63965 llvm-svn: 364864
* [analyzer] exploded-graph-rewriter: Prettier location context dumps.Artem Dergachev2019-06-261-1/+2
| | | | | | Make them span wider. llvm-svn: 364365
* [analyzer] print() JSONify: Create pointersCsaba Dabis2019-06-251-2/+4
| | | | | | | | | | | | | | | | | Summary: - Reviewers: NoQ Reviewed By: NoQ Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63726 llvm-svn: 364271
* [analyzer] exploded-graph-rewriter: Fix escaping for bitwise-or.Artem Dergachev2019-06-251-1/+2
| | | | | | | '|' is a special character in graphviz, so it needs to be properly escaped and unescaped. llvm-svn: 364269
* [analyzer] exploded-graph-rewriter: Add support for range constraints.Artem Dergachev2019-06-251-2/+63
| | | | | | | | | | | | Diff support included. A cheap solution is implemented that treats range constraints as "some sort of key-value map", so it's going to be trivial to add support for other such maps later, such as dynamic type info. Differential Revision: https://reviews.llvm.org/D63685 llvm-svn: 364268
* [analyzer] NFC: exploded-graph-rewriter: Extract some code into functions.Artem Dergachev2019-06-251-19/+22
| | | | | | Differential Revision: https://reviews.llvm.org/D63684 llvm-svn: 364267
* [analyzer] exploded-graph-rewriter: Implement a --diff mode.Artem Dergachev2019-06-191-61/+218
| | | | | | | | | | | | | | | | | | | | | In this mode the tool would avoid duplicating the contents of the program state on every node, replacing them with a diff-like dump of changes that happened on that node. This is useful because most of the time we only interested in whether the effect of the statement was modeled correctly. A diffed graph would also be much faster to load and navigate, being much smaller than the original graph. The diffs are computed "semantically" as opposed to plain text diffs. I.e., the diff algorithm is hand-crafted separately for every state trait, taking the underlying data structures into account. This is especially nice for Environment because textual diffs would have been terrible. On the other hand, it requires some boilerplate to implement. Differential Revision: https://reviews.llvm.org/D62761 llvm-svn: 363898
* [analyzer] exploded-graph-rewriter: Fix escaping StringRegions.Artem Dergachev2019-06-191-0/+1
| | | | | | | | | | | Quotes around StringRegions are now escaped and unescaped correctly, producing valid JSON. Additionally, add a forgotten escape for Store values. Differential Revision: https://reviews.llvm.org/D63519 llvm-svn: 363897
* [analyzer] exploded-graph-rewriter: Add the missing license header!Artem Dergachev2019-06-051-0/+9
| | | | llvm-svn: 362575
* [analyzer] exploded-graph-rewriter: Initial commit.Artem Dergachev2019-06-021-0/+398
| | | | | | | | | | | This is a utility to improve readability and generally manipulate GraphViz dumps of the analysis graph. Such dumps are often huge and not only hard to read, but also often hang the viewer apps with their mere size. Such script should significantly improve debugging experience. Differential Revision: https://reviews.llvm.org/D62638 llvm-svn: 362340
* [analyzer] SATestBuild.py: Use driver for analyzing single-file tests.Artem Dergachev2019-05-292-23/+6
| | | | | | | | Don't bother coming up with a -cc1 run-line ourselves. This, in particular, gets rid of a macOS-specific code path. llvm-svn: 362009
* [analyzer] [testing] Inside CmpRuns.py output also print the filename of the ↵George Karpenkov2019-02-051-1/+22
| | | | | | | | first item in the path Differential Revision: https://reviews.llvm.org/D57783 llvm-svn: 353228
* Portable Python script across Python versionSerge Guelton2018-12-183-3/+3
| | | | | | | | Make scripts more future-proof by importing most __future__ stuff. Differential Revision: https://reviews.llvm.org/D55208 llvm-svn: 349504
* Portable Python script across Python versionSerge Guelton2018-12-182-4/+3
| | | | | | | | | | | In Python3, dict.items, dict.keys, dict.values, zip, map and filter no longer return lists, they create generator instead. The portability patch consists in forcing an extra `list` call if the result is actually used as a list. `map` are replaced by list comprehension and `filter` by filtered list comprehension. Differential Revision: https://reviews.llvm.org/D55197 llvm-svn: 349501
* Portable Python script across Python versionSerge Guelton2018-12-181-2/+2
| | | | | | | | | In Python2, division between integer yields an integer, while it yields a float in Python3. Use a combination of from __future__ import division and // operator to get a portable behavior. Differential Revision: https://reviews.llvm.org/D55204 llvm-svn: 349455
* Portable Python script across Python versionSerge Guelton2018-12-185-36/+40
| | | | | | | | Using from __future__ import print_function it is possible to have a compatible behavior of `print(...)` across Python version. Differential Revision: https://reviews.llvm.org/D55213 llvm-svn: 349454
* Portable Python script across Python versionSerge Guelton2018-12-131-2/+5
| | | | | | | | Queue module as been renamed into queue in Python3 Differential Revision: https://reviews.llvm.org/D55202 llvm-svn: 349009
* Portable Python script across versionSerge Guelton2018-12-031-5/+5
| | | | | | | | | Have all classes derive from object: that's implicitly the default in Python3, it needs to be done explicilty in Python2. Differential Revision: https://reviews.llvm.org/D55121 llvm-svn: 348127
* Portable Python script across Python versionSerge Guelton2018-12-031-1/+1
| | | | | | | | | | | | | | Python2 supports the two following equivalent construct raise ExceptionType, exception_value and raise ExceptionType(exception_value) Only the later is supported by Python3. Differential Revision: https://reviews.llvm.org/D55195 llvm-svn: 348126
* [analyzer] [testing] Compute data on path length, compute percentilesGeorge Karpenkov2018-10-231-0/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D52844 llvm-svn: 344990
* [analyzer] [tests] Hotfix: missing spaceGeorge Karpenkov2018-10-021-1/+1
| | | | llvm-svn: 343643
* [analyzer] [tests] Allow specifying entire -analyze-config on the command ↵George Karpenkov2018-10-021-14/+16
| | | | | | | | line, make sure it's always propagated Differential Revision: https://reviews.llvm.org/D52801 llvm-svn: 343636
* [analyzer] [testing] Pass through an extra argument for specifying extra ↵George Karpenkov2018-09-271-16/+22
| | | | | | | | analyzer options Differential Revision: https://reviews.llvm.org/D52585 llvm-svn: 343158
* [analyzer] Remove traces of ubigraph visualizationGeorge Karpenkov2018-09-061-76/+0
| | | | | | | | | | Ubigraph project has been dead since about 2008, and to the best of my knowledge, no one was using it. Previously, I wasn't able to launch the existing binary at all. Differential Revision: https://reviews.llvm.org/D51655 llvm-svn: 341601
* [analyzer] [tests] Do not be verbose by default when updating reference results.George Karpenkov2018-08-071-1/+1
| | | | llvm-svn: 339183
* [analyzer] [tests] Add an option for showing statistics after running tests.George Karpenkov2018-07-301-1/+3
| | | | | | Do not show statistics by default. llvm-svn: 338323
* [analyzer] [tests] Style fixes for testing harness.George Karpenkov2018-07-302-14/+14
| | | | llvm-svn: 338322
OpenPOWER on IntegriCloud