13 std::vector<const Util::Comment *> prefix;
14 std::vector<const Util::Comment *> suffix;
16 using CommentsMap = std::unordered_map<NodeId, Comments>;
17 enum class TraversalType { Preorder, Postorder };
19 explicit Attach(std::unordered_map<const Util::Comment *, bool> &processedComments)
20 : processedComments(processedComments){};
22 void attachCommentsToNode(
const IR::Node *, TraversalType);
24 bool preorder(
const IR::Node *node)
override;
25 void postorder(
const IR::Node *node)
override;
29 const CommentsMap &getCommentsMap()
const;
34 std::unordered_map<const Util::Comment *, bool> &processedComments;
36 CommentsMap commentsMap;