From f45207e02f3f703ef96b23957538a935856cf874 Mon Sep 17 00:00:00 2001 From: Ashley Nelson Date: Tue, 17 Oct 2023 17:12:26 -0700 Subject: [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. --- src/support/suffix_tree.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/support/suffix_tree.h') 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 #include +#include #include #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{"; + 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 InternalNodeAllocator; -- cgit v1.2.3