History log of /llvm-project/clang/utils/analyzer/exploded-graph-rewriter.py (Results 1 – 25 of 43)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5
# 20cb4ec8 22-Nov-2024 Balazs Benics <benicsbalazs@gmail.com>

[analyzer] Print the PostInitializer target in exploded-graph-rewriter (#116034)

This aids debugging PostInitializer program points by knowing what is
the location being initialized.

![Screenshot f

[analyzer] Print the PostInitializer target in exploded-graph-rewriter (#116034)

This aids debugging PostInitializer program points by knowing what is
the location being initialized.

![Screenshot from 2024-11-11
09-50-51](https://github.com/user-attachments/assets/481f79f2-5cc5-4d0c-ac7d-ac24b4b23bc5)

show more ...


Revision tags: llvmorg-19.1.4
# 9cbf2dd6 15-Nov-2024 Balazs Benics <benicsbalazs@gmail.com>

[analyzer] Print the callee name in CallEnter in exploded-graph-rewriter (#116225)

![image](https://github.com/user-attachments/assets/22a82950-d6e1-4e1f-8f82-2f33240b382a)


Revision tags: llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3
# 0c3e24f7 26-Mar-2024 Ella Ma <alansnape3058@gmail.com>

[analyzer] Allow egraph rewriter not to open the generated HTML directly (#85515)

When developing on a headless device through SSH, we do not have a
browser or even an X environment. Hence, it woul

[analyzer] Allow egraph rewriter not to open the generated HTML directly (#85515)

When developing on a headless device through SSH, we do not have a
browser or even an X environment. Hence, it would be more convenient if
the rewriter could stop before attempting to open the generated HTML
file. Then, it can be opened remotely through an HTML server.

This patch adds a new option `--dump-html-only` to make the rewriter
stop before opening the generated HTML in a browser. The new option is
marked in conflict with the existing `--dump-dot-only` option to prevent
unexpected behaviors.

show more ...


Revision tags: llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5
# dd3c26a0 17-May-2023 Tobias Hieta <tobias@hieta.se>

[NFC][Py Reformat] Reformat python files in clang and clang-tools-extra

This is an ongoing series of commits that are reformatting our
Python code.

Reformatting is done with `black`.

If you end up

[NFC][Py Reformat] Reformat python files in clang and clang-tools-extra

This is an ongoing series of commits that are reformatting our
Python code.

Reformatting is done with `black`.

If you end up having problems merging this commit because you
have made changes to a python file, the best way to handle that
is to run git checkout --ours <yourfile> and then reformat it
with black.

If you run into any problems, post to discourse about it and
we will try to help.

RFC Thread below:

https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style

Reviewed By: MatzeB

Differential Revision: https://reviews.llvm.org/D150761

show more ...


Revision tags: llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, working, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2
# b5147937 04-Aug-2022 isuckatcs <65320245+isuckatcs@users.noreply.github.com>

[analyzer] Add more information to the Exploded Graph

This patch dumps every state trait in the egraph. Also
the empty state traits are no longer dumped, instead
they are treated as null by the egra

[analyzer] Add more information to the Exploded Graph

This patch dumps every state trait in the egraph. Also
the empty state traits are no longer dumped, instead
they are treated as null by the egraph rewriter script,
which solves reverse compatibility issues.

Differential Revision: https://reviews.llvm.org/D131187

show more ...


# 5e876c54 11-Aug-2022 Balazs Benics <benicsbalazs@gmail.com>

[analyzer] exploded-graph-rewriter: Fix python3 string encoding issues

This encapsulates 3 changes:
- `DotDumpVisitor` now aggregates strings instead of *bytes* for both
`python2` and `python3`.

[analyzer] exploded-graph-rewriter: Fix python3 string encoding issues

This encapsulates 3 changes:
- `DotDumpVisitor` now aggregates strings instead of *bytes* for both
`python2` and `python3`. This difference caused crashes when it tried
to write out the content as *strings*, similarly described at D71746.
- `graphviz.pipe()` expects the input in *bytes* instead of unicode
strings. And it results in *bytes*. Due to string concatenations and
similar operations, I'm using unicode string as the default, and
converting to *bytes* on demand.
- `write_temp_file()` now appends the `egraph-` prefix and more
importantly, it will create the temp file in the **current working
directory** instead of in the *temp*. This change makes `Firefox` be
able to open the file even if the `security.sandbox.content.level` is
set to the (default) most restricting `4`.
See https://support.mozilla.org/si/questions/1259285

An artifact of the bad byte handling was previously in the `HTML`
produced by the script that it displayed the `b'` string at the top left
corner. Now it won't anymore :)

I've tested that the following command works on `Ubuntu 22.04`:
```
exploded-graph-rewriter my-egraph.dot
```
Both `python2` and `python3` works as expected.

PS: I'm not adding tests, as the current test infra does not support
testing HTML outputs for this script.
Check the `clang/test/Analysis/exploded-graph-rewriter/lit.local.cfg`.
We always pass the `--dump-dot-only` flag to the script.
Along with that, the default invocation will not only create this HTML
report but also try to open it. In addition to this, I'm not sure if the
buildbots have `graphviz` installed and also if this package is installed
on `pip`.
Unless we change some of these, we cannot test this change.
Given that D71746 had no tests, I'm not too worried about this either.

Reviewed By: NoQ

Differential Revision: https://reviews.llvm.org/D131553

show more ...


# 5674a3c8 01-Aug-2022 Gabriel Ravier <gabravier@gmail.com>

Fixed a number of typos

I went over the output of the following mess of a command:

(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z |
parallel --xargs -0 cat | aspell list --mode=none --igno

Fixed a number of typos

I went over the output of the following mess of a command:

(ulimit -m 2000000; ulimit -v 2000000; git ls-files -z |
parallel --xargs -0 cat | aspell list --mode=none --ignore-case |
grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n |
grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less)

and proceeded to spend a few days looking at it to find probable typos
and fixed a few hundred of them in all of the llvm project (note, the
ones I found are not anywhere near all of them, but it seems like a
good start).

Differential Revision: https://reviews.llvm.org/D130827

show more ...


Revision tags: llvmorg-15.0.0-rc1, llvmorg-16-init, llvmorg-14.0.6
# b032e3ff 16-Jun-2022 isuckatcs <65320245+isuckatcs@users.noreply.github.com>

[analyzer] Evaluate construction of non-POD type arrays

Introducing the support for evaluating the constructor
of every element in an array. The idea is to record the
index of the current array memb

[analyzer] Evaluate construction of non-POD type arrays

Introducing the support for evaluating the constructor
of every element in an array. The idea is to record the
index of the current array member being constructed and
create a loop during the analysis. We looping over the
same CXXConstructExpr as many times as many elements
the array has.

Differential Revision: https://reviews.llvm.org/D127973

show more ...


Revision tags: llvmorg-14.0.5, llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2, llvmorg-14.0.0-rc1, llvmorg-15-init, llvmorg-13.0.1, llvmorg-13.0.1-rc3, llvmorg-13.0.1-rc2, llvmorg-13.0.1-rc1, llvmorg-13.0.0, llvmorg-13.0.0-rc4, llvmorg-13.0.0-rc3, llvmorg-13.0.0-rc2, llvmorg-13.0.0-rc1, llvmorg-14-init, llvmorg-12.0.1, llvmorg-12.0.1-rc4, llvmorg-12.0.1-rc3, llvmorg-12.0.1-rc2, llvmorg-12.0.1-rc1, llvmorg-12.0.0, llvmorg-12.0.0-rc5, llvmorg-12.0.0-rc4, llvmorg-12.0.0-rc3, llvmorg-12.0.0-rc2, llvmorg-11.1.0, llvmorg-11.1.0-rc3, llvmorg-12.0.0-rc1, llvmorg-13-init, llvmorg-11.1.0-rc2, llvmorg-11.1.0-rc1, llvmorg-11.0.1, llvmorg-11.0.1-rc2, llvmorg-11.0.1-rc1, llvmorg-11.0.0, llvmorg-11.0.0-rc6, llvmorg-11.0.0-rc5, llvmorg-11.0.0-rc4, llvmorg-11.0.0-rc3, llvmorg-11.0.0-rc2, llvmorg-11.0.0-rc1, llvmorg-12-init, llvmorg-10.0.1, llvmorg-10.0.1-rc4, llvmorg-10.0.1-rc3, llvmorg-10.0.1-rc2
# 01f9388d 22-Jun-2020 Denys Petrov <dpetrov@accesssoftek.com>

[analyzer] Handle `\l` symbol in string literals in exploded-graph-rewriter

Summary:
Handle `\l` separately because a string literal can be in code like "string\\literal" with the `\l` inside. Also

[analyzer] Handle `\l` symbol in string literals in exploded-graph-rewriter

Summary:
Handle `\l` separately because a string literal can be in code like "string\\literal" with the `\l` inside. Also on Windows macros __FILE__ produces specific delimiters `\` and a directory or file may starts with the letter `l`.

Fix:
Use regex for replacing all `\l` (like `,\l`, `}\l`, `[\l`) except `\\l`, because a literal as a rule contains multiple `\` before `\l`.

Differential Revision: https://reviews.llvm.org/D82092

show more ...


Revision tags: llvmorg-10.0.1-rc1
# c98872e3 14-May-2020 Valeriy Savchenko <vsavchenko@apple.com>

[analyzer] Modernize analyzer's Python scripts

Summary:
Fix read/write in binary format, which crashes Python 3.
Additionally, clean up redundant (as for Python 3) code and
fix a handful of flake8 w

[analyzer] Modernize analyzer's Python scripts

Summary:
Fix read/write in binary format, which crashes Python 3.
Additionally, clean up redundant (as for Python 3) code and
fix a handful of flake8 warnings.

Differential Revision: https://reviews.llvm.org/D79932

show more ...


Revision tags: llvmorg-10.0.0, llvmorg-10.0.0-rc6, llvmorg-10.0.0-rc5, llvmorg-10.0.0-rc4, llvmorg-10.0.0-rc3, llvmorg-10.0.0-rc2, llvmorg-10.0.0-rc1, llvmorg-11-init
# 2203089a 21-Dec-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Fix string encodings in python3.

Makes sure that the script works fine both in python2 and python3.

Patch by Pavel Samolysov!

Differential Revision: https://rev

[analyzer] exploded-graph-rewriter: Fix string encodings in python3.

Makes sure that the script works fine both in python2 and python3.

Patch by Pavel Samolysov!

Differential Revision: https://reviews.llvm.org/D71746

show more ...


Revision tags: llvmorg-9.0.1, llvmorg-9.0.1-rc3, llvmorg-9.0.1-rc2, llvmorg-9.0.1-rc1
# c6921379 18-Oct-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Rename Environment to Expressions.

It's less confusing for newcomers.

llvm-svn: 375282


# d93b810c 18-Oct-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Fix dump for state 0.

It shouldn't say "unspecified" when the state is specified to be empty.

llvm-svn: 375279


# 14e9eb3d 17-Oct-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] Assign truly stable identifiers to exploded nodes.

ExplodedGraph nodes will now have a numeric identifier stored in them
which will keep track of the order in which the nodes were created

[analyzer] Assign truly stable identifiers to exploded nodes.

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

show more ...


# d325196f 17-Oct-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] Display cast kinds in program point dumps.

Because cast expressions have their own hierarchy, it's extremely useful
to have some information about what kind of casts are we dealing with.

[analyzer] Display cast kinds in program point dumps.

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

show more ...


# 73b67f0b 17-Oct-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Make node headers a bit lighter.

The 50% grey color is too dark on some monitors.

llvm-svn: 375184


Revision tags: llvmorg-9.0.0, llvmorg-9.0.0-rc6, llvmorg-9.0.0-rc5, llvmorg-9.0.0-rc4, llvmorg-9.0.0-rc3
# daf41722 13-Aug-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Implement displaying Store pointers.

They're useful when trying to understand what's going on
inside your LazyCompoundValues.

Differential Revision: https://revi

[analyzer] exploded-graph-rewriter: Implement displaying Store pointers.

They're useful when trying to understand what's going on
inside your LazyCompoundValues.

Differential Revision: https://reviews.llvm.org/D65427

llvm-svn: 368769

show more ...


# 9289681e 13-Aug-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Implement manual graph trimming.

When -trim-egraph is unavailable (say, when you're debugging a crash on
a real-world code that takes too long to reduce), it make

[analyzer] exploded-graph-rewriter: Implement manual graph trimming.

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

show more ...


# 0b26891f 13-Aug-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trimmers.

Explorers aren't the right abstraction. For the purposes of displaying svg files
we don't care in which order do we explore

[analyzer] exploded-graph-rewriter: NFC: Refactor explorers into trimmers.

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

show more ...


# e9e36354 13-Aug-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Open the converted graph immediately.

Change the default behavior: the tool no longer dumps the rewritten .dot file
to stdout, but instead it automatically conver

[analyzer] exploded-graph-rewriter: Open the converted graph immediately.

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

show more ...


Revision tags: llvmorg-9.0.0-rc2, llvmorg-9.0.0-rc1, llvmorg-10-init
# ed035ff8 12-Jul-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Improve source location dumps.

- Correctly display macro expansion and spelling locations.
- Use the same procedure to display location context call site location

[analyzer] exploded-graph-rewriter: Improve source location dumps.

- 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

show more ...


# fc6059e8 11-Jul-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Fix filenames in program point.

Fix a typo in JSON field name.

llvm-svn: 365827


Revision tags: llvmorg-8.0.1, llvmorg-8.0.1-rc4
# c6b5c5b9 08-Jul-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Implement a topology-only mode.

In this mode the rewriter will only rewrite program points
and omit program states. Useful for understanding
the rough topology of

[analyzer] exploded-graph-rewriter: Implement a topology-only mode.

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

show more ...


# 78566e45 08-Jul-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Implement a single-path mode.

Instead of rewriting the whole graph, rewrite the leftmost path in the
graph. Useful for trimmed graphs that are still too large to

[analyzer] exploded-graph-rewriter: Implement a single-path mode.

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

show more ...


# 78c0aefb 03-Jul-2019 Artem Dergachev <artem.dergachev@gmail.com>

[analyzer] exploded-graph-rewriter: Implement a black-and-white color scheme.

For accessibility!

Differential Revision: https://reviews.llvm.org/D64153

llvm-svn: 365085


12