summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/inlining/inliner.hh
blob: fc2f71fb41ddafe19b16645f31e76ae78357f98d (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
 ** \file inlining/inliner.hh
 ** \brief Declaration of inlining::Inliner.
 */

#pragma once

#include <map>

#include <ast/function-dec.hh>
#include <astclone/cloner.hh>
#include <misc/scoped-map.hh>
#include <misc/set.hh>

namespace inlining
{
  /// Perform inline expansion of functions.
  class Inliner : public astclone::Cloner
  {
  public:
    using super_type = astclone::Cloner;

    // Import overloaded virtual functions.
    using super_type::operator();

    /// Build an Inliner.
    Inliner(const ast::Ast& tree);

    /// \name Visit methods.
    /// \{
    // FIXME: Some code was deleted here.
    /// \}

    /// \name Getters.
    /// \{
    const misc::set<const ast::FunctionDec*>& rec_funs_get() const;
    /// \}

  private:
    /// Recursive functions of the program.
    misc::set<const ast::FunctionDec*> rec_funs_;
  };

} // namespace inlining