summaryrefslogtreecommitdiffhomepage
path: root/flowgraph/scope.h
blob: 65898cf178b5a2e6fdde8c0ecc9b69676fd9473d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#pragma once

#include "data.h"

#include "minicc.h"

#include <cstddef>
#include <memory>
#include <vector>

namespace FlowGraph {

 class Storage; ///< Forward declaration

 // Provide a context for local temporaries name generation
 class LocalScope
 {
 public:
  LocalScope() = default;

  void push_back(std::shared_ptr<Data> data);
  void append(const LocalScope& other);
  index_t indexOfStorage(const Storage& storage) const;

 private:
  std::vector<std::shared_ptr<Data>> m_variables;
 };

}