[PATCH] D124442: [analyzer] Allow exploded graph dumps in release builds

Bal√°zs Benics via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 26 02:27:36 PDT 2022


steakhal created this revision.
steakhal added reviewers: NoQ, martong, Szelethus, ASDenysPetrov.
Herald added subscribers: manas, pengfei, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware, xazax.hun.
Herald added a project: All.
steakhal requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Historically, exploded graph dumps were disabled in non-debug builds.
It was done so probably because a regular user should not dump the
internal representation of the analyzer anyway and the dump methods
might introduce unnecessary binary size overhead.

It turns out some of the users actually want to dump this.

Note that e.g. `LiveExpressionsDumper`, `LiveVariablesDumper`,
`ControlDependencyTreeDumper` etc. worked previously, and they are
unaffected by this change.
However, `CFGViewer` and `CFGDumper` still won't work for a similar
reason. AFAIK only these two won't work after this change.

Addresses #53873

---

**baseline**

| binary     | size | size after strip |
| clang      | 103M | 83M              |
| clang-tidy | 67M  | 54M              |
|

**after this change**

| binary     | size | size after strip |
| clang      | 103M | 84M              |
| clang-tidy | 67M  | 54M              |
|

CMake configuration:

  cmake -S llvm -GNinja -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release
  -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang
  -DLLVM_ENABLE_ASSERTIONS=OFF -DLLVM_USE_LINKER=lld
  -DLLVM_ENABLE_DUMP=OFF -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra"
  -DLLVM_ENABLE_Z3_SOLVER=ON -DLLVM_TARGETS_TO_BUILD="X86"

Built by `clang-14.0.0`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D124442

Files:
  clang/lib/StaticAnalyzer/Core/ExprEngine.cpp
  clang/test/Analysis/dump_egraph.c
  clang/test/Analysis/dump_egraph.cpp
  clang/test/Analysis/exploded-graph-rewriter/dynamic_types.cpp
  clang/test/Analysis/exploded-graph-rewriter/escapes.c
  clang/test/Analysis/exploded-graph-rewriter/initializers_under_construction.cpp
  clang/test/Analysis/exploded-graph-rewriter/l_name_starts_with_l.cpp
  clang/test/Analysis/exploded-graph-rewriter/macros.c
  clang/test/Analysis/exploded-graph-rewriter/objects_under_construction.cpp
  clang/test/Analysis/exploded-graph-rewriter/win_path_forbidden_chars.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124442.425158.patch
Type: text/x-patch
Size: 10094 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220426/639da706/attachment-0001.bin>


More information about the cfe-commits mailing list