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`. Reviewed By: martong Differential Revision: https://reviews.llvm.org/D124442
20 lines
777 B
C++
20 lines
777 B
C++
// FIXME: Figure out how to use %clang_analyze_cc1 with our lit.local.cfg.
|
|
// RUN: %clang_cc1 -analyze -triple x86_64-unknown-linux-gnu \
|
|
// RUN: -analyzer-checker=core \
|
|
// RUN: -analyzer-dump-egraph=%t.dot %s
|
|
// RUN: %exploded_graph_rewriter --verbose %t.dot 2>&1 | FileCheck %s
|
|
// UNSUPPORTED: !windows
|
|
|
|
// Angle brackets shall not be presented in the field `file`,
|
|
// because exploded_graph_rewriter handles it as a file path
|
|
// and such symbols are forbidden on Windows platform.
|
|
|
|
void test() {
|
|
// This produces angle brackets.
|
|
char text[] = __FILE__;
|
|
}
|
|
|
|
// This test is passed if exploded_graph_rewriter handles dot file without errors.
|
|
// CHECK: DEBUG:root:Line: digraph "Exploded Graph"
|
|
// CHECK: \"file\": \"scratch space\"
|