summaryrefslogtreecommitdiff
path: root/src/analysis/CMakeLists.txt
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2023-05-12 11:27:29 -0500
committerGitHub <noreply@github.com>2023-05-12 09:27:29 -0700
commit64e5a99ee014af3a138a36f5a87addfacfc95f0c (patch)
treea322095dfe09f1b361964682f56bc5c6f963e46a /src/analysis/CMakeLists.txt
parent7d5d24f400019ff023b65ccdb3c1d8d07ebb00a5 (diff)
downloadbinaryen-64e5a99ee014af3a138a36f5a87addfacfc95f0c.tar.gz
binaryen-64e5a99ee014af3a138a36f5a87addfacfc95f0c.tar.bz2
binaryen-64e5a99ee014af3a138a36f5a87addfacfc95f0c.zip
[analysis] Add a new iterable CFG utility (#5712)
Add a new "analysis" source directory that will contain the source for a new static program analysis framework. To start the framework, add a CFG utility that provides convenient iterators for iterating through the basic blocks of the CFG as well as the predecessors, successors, and contents of each block. The new CFGs are constructed using the existing CFGWalker, but they are different in that the new utility is meant to provide a usable representation of a CFG whereas CFGWalker is meant to allow collecting arbitrary information about each basic block in a CFG. For testing and debugging purposes, add `print` methods to CFGs and basic blocks. This requires exposing the ability to print expression contents excluding children, which was something we previously did only for StackIR. Also add a new gtest file with a test for constructing and printing a CFG. The test reveals some strange properties of the current CFG construction, including empty blocks and strange placement of `loop` instructions, but fixing these problems is left as future work.
Diffstat (limited to 'src/analysis/CMakeLists.txt')
-rw-r--r--src/analysis/CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/analysis/CMakeLists.txt b/src/analysis/CMakeLists.txt
new file mode 100644
index 000000000..ea0494859
--- /dev/null
+++ b/src/analysis/CMakeLists.txt
@@ -0,0 +1,6 @@
+file(GLOB analysis_HEADERS *.h)
+set(analysis_SOURCES
+ cfg.cpp
+ ${analysis_HEADERS}
+)
+add_library(analysis OBJECT ${analysis_SOURCES})