<commit_before>/// XXX add licence
//

#ifdef HAVE_LLVM

#include <utility>
#include <queue>
/*
#include <llvm/Function.h>
#include <llvm/ADT/SmallPtrSet.h>
*/
#include <llvm/IR/Module.h>
#include <llvm/IR/Instruction.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/Value.h>
#include <llvm/IR/CFG.h>
#include <llvm/Support/raw_ostream.h>

#include "LLVMDependenceGraph.h"

using llvm::errs;
using std::make_pair;

namespace dg {

LLVMDependenceGraph::~LLVMDependenceGraph()
{
    for (auto I = begin(), E = end(); I != E; ++I) {
        delete I->second;
    }
}

bool LLVMDependenceGraph::build(llvm::Module *m, llvm::Function *entry)
{
    // get entry function if not given
    if (!entry)<commit_msg>llvm: fix memory leak<commit_after>/// XXX add licence
//

#ifdef HAVE_LLVM

#include <utility>
#include <queue>
/*
#include <llvm/Function.h>
#include <llvm/ADT/SmallPtrSet.h>
*/
#include <llvm/IR/Module.h>
#include <llvm/IR/Instruction.h>
#include <llvm/IR/Instructions.h>
#include <llvm/IR/Value.h>
#include <llvm/IR/CFG.h>
#include <llvm/Support/raw_ostream.h>

#include "LLVMDependenceGraph.h"

using llvm::errs;
using std::make_pair;

namespace dg {

LLVMDependenceGraph::~LLVMDependenceGraph()
{
    for (auto I = begin(), E = end(); I != E; ++I) {
        if (I->second) {
            if (I->second->getSubgraph())
                delete I->second->getSubgraph();

            delete I->second;
        }
    }
}

bool LLVMDependenceGraph::build(llvm::Module *m, llvm::Function *entry)
{
    // get entry function if not given
    if (!entry)
{'fraction_non_alphanumeric': 0.16912235746316465, 'fraction_numerical': 0.0, 'mean_word_length': 3.621301775147929, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 30, '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': '4198865', 'n_tokens_mistral': 588, 'n_tokens_neox': 574, 'n_words': 126}