#pragma once

#include <vector>
#include <map>
#include <set>
#include <string>

#include "../Distribution/Distribution.h"
#include "../Utils/errors.h"
#include "../GraphLoop/graph_loops.h"
#include "../Utils/types.h"

#define FIRST(x)  get<0>(x)
#define SECOND(x) get<1>(x)
#define THIRD(x)  get<2>(x)

void addShadowFromAnalysis(ParallelDirective* dir, const std::map<DIST::Array*, ArrayInfo*>& currAccesses);

bool checkForConflict(const std::map<DIST::Array*, ArrayInfo*>& currAccesses,
					  const LoopGraph* currentLoop,
					  std::map<DIST::Array*, std::pair<int, std::pair<int, int>>, DIST::ArrayComparator>& arrayWriteAcc,
					  const std::vector<std::pair<std::pair<std::string, std::string>, std::vector<std::pair<int, int>>>>& acrossInfo,
					  std::set<DIST::Array*>& acrossOutArrays);

uint64_t getTrueRegId(const uint64_t regId, const uint64_t loopRegId);

