#pragma once

#include <map>
#include <set>
#include <string>
#include "GraphCall/graph_calls.h"

class UniqueNameCreator
{
    std::map<std::string, std::vector<FuncInfo*>> funcInfo;
    std::set<std::string> allDeclarations;
    bool declarationsAnalyzed = false;
    std::map<const DIST::Array*, std::pair<std::string, std::string>> generatedNames;

    static void GetSymbolsRec(SgExpression* exp, std::set<std::string>& add_to);
    void FillDeclarations();

public:
    UniqueNameCreator(const std::map<std::string, std::vector<FuncInfo*>>& allFuncInfo)
    {
        declarationsAnalyzed = false;
        funcInfo = allFuncInfo;
    }

    void GetUniqueName(DIST::Array* array, std::string& array_name, std::string& common_block_name);
};
