<commit_before>/*
 * Spatial Computation - Manifestation of Spatial computing.
 * Copyright © 2014 <NAME>
 *
 * This code is available to you under Apache License Version 2.0, January
 * 2014. You can grab a copy of license from the same repository from where you
 * fetched this code.
 *
 * Below code is based on GraphWriter.h in LLVM source tree.
 */

#ifndef LLVM_SUPPORT_DFGWRITER_H
#define LLVM_SUPPORT_DFGWRITER_H

#include "llvm/ADT/GraphTraits.h"
#include "llvm/Support/DOTGraphTraits.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <vector>
#include "dataflow.hpp"
#include "waves.hpp"

namespace llvm {

class DFGWriter {
  raw_ostream &O;
  const DFG<Function*> &G;

  typedef DOTGraphTraits<DFG<Function*> >     DOTTraits;
  typedef GraphTraits<DFG<Function*> >        GTraits;
  typedef typename GTraits::NodeType          NodeType;
  typedef typename GTraits::nodes_iterator    node_iterator;
  typedef typename GTraits::ChildIteratorType child_iterator;
  DOTTraits DTraits;

  // Writes the edge labels of the node to O and returns true if there are any
  // edge labels not equal to the empty string "".
  bool getEdgeSourceLabels(raw_ostream &O, NodeType *Node) {
    child_iterator EI = GTraits::child_begin(Node);
    child_iterator EE = GTraits::child_end(Node);
    bool hasEdgeSourceLabels = false;

    for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) {
      std::string label = DTraits.getEdgeSourceLabel(Node, EI);
<commit_msg>silence compiler warnings about typename<commit_after>/*
 * Spatial Computation - Manifestation of Spatial computing.
 * Copyright © 2014 <NAME>
 *
 * This code is available to you under Apache License Version 2.0, January
 * 2014. You can grab a copy of license from the same repository from where you
 * fetched this code.
 *
 * Below code is based on GraphWriter.h in LLVM source tree.
 */

#ifndef LLVM_SUPPORT_DFGWRITER_H
#define LLVM_SUPPORT_DFGWRITER_H

#include "llvm/ADT/GraphTraits.h"
#include "llvm/Support/DOTGraphTraits.h"
#include "llvm/Support/Path.h"
#include "llvm/Support/raw_ostream.h"
#include <cassert>
#include <vector>
#include "dataflow.hpp"
#include "waves.hpp"

namespace llvm {

class DFGWriter {
  raw_ostream &O;
  const DFG<Function*> &G;

  typedef DOTGraphTraits<DFG<Function*> >     DOTTraits;
  typedef GraphTraits<DFG<Function*> >        GTraits;
  typedef GTraits::NodeType          NodeType;
  typedef GTraits::nodes_iterator    node_iterator;
  typedef GTraits::ChildIteratorType child_iterator;
  DOTTraits DTraits;

  // Writes the edge labels of the node to O and returns true if there are any
  // edge labels not equal to the empty string "".
  bool getEdgeSourceLabels(raw_ostream &O, NodeType *Node) {
    child_iterator EI = GTraits::child_begin(Node);
    child_iterator EE = GTraits::child_end(Node);
    bool hasEdgeSourceLabels = false;

    for (unsigned i = 0; EI != EE && i != 64; ++EI, ++i) {
      std::string label = DTraits.getEdgeSourceLabel(Node, EI);

{'fraction_non_alphanumeric': 0.0986101919258769, 'fraction_numerical': 0.008603573792190603, 'mean_word_length': 4.176369863013699, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5467347', 'n_tokens_mistral': 1019, 'n_tokens_neox': 970, 'n_words': 305}