diff options
author | Ashley Nelson <nashley@google.com> | 2023-10-17 17:12:26 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-18 00:12:26 +0000 |
commit | f45207e02f3f703ef96b23957538a935856cf874 (patch) | |
tree | c4820119a1e6fc1588c92a405753c40f8eec7ed0 /src/support/suffix_tree.h | |
parent | 1be114f36d6a4d48dec69a070de0d66a729918e6 (diff) | |
download | binaryen-f45207e02f3f703ef96b23957538a935856cf874.tar.gz binaryen-f45207e02f3f703ef96b23957538a935856cf874.tar.bz2 binaryen-f45207e02f3f703ef96b23957538a935856cf874.zip |
[Outlining] Filter Local Set (#6018)
Adds a general purpose walker named FilterStringifyWalker, intended to walk control flow and take note of whether any of the expressions satisfy the condition.
Also includes an << overload for SuffixTree::RepeatedSubstring to make debugging easier.
Diffstat (limited to 'src/support/suffix_tree.h')
-rw-r--r-- | src/support/suffix_tree.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/support/suffix_tree.h b/src/support/suffix_tree.h index 4ce61767d..6aa9c2f20 100644 --- a/src/support/suffix_tree.h +++ b/src/support/suffix_tree.h @@ -38,6 +38,7 @@ #include "llvm/Support/Allocator.h" #include <cassert> #include <cstddef> +#include <ostream> #include <vector> #include "support/suffix_tree_node.h" @@ -64,6 +65,19 @@ public: } }; + friend std::ostream& operator<<(std::ostream& os, + RepeatedSubstring substring) { + os << "SuffixTree::RepeatedSubstring{" << substring.Length + << "u, (std::vector<unsigned>{"; + for (unsigned idx = 0; idx < substring.StartIndices.size(); idx++) { + os << substring.StartIndices[idx]; + if (idx != substring.StartIndices.size() - 1) { + os << ", "; + } + } + return os << "})}"; + } + private: /// Maintains internal nodes in the tree. SpecificBumpPtrAllocator<SuffixTreeInternalNode> InternalNodeAllocator; |