summaryrefslogtreecommitdiff
path: root/tiger-compiler/src/inlining/inliner.hh
diff options
context:
space:
mode:
Diffstat (limited to 'tiger-compiler/src/inlining/inliner.hh')
-rw-r--r--tiger-compiler/src/inlining/inliner.hh44
1 files changed, 44 insertions, 0 deletions
diff --git a/tiger-compiler/src/inlining/inliner.hh b/tiger-compiler/src/inlining/inliner.hh
new file mode 100644
index 0000000..fc2f71f
--- /dev/null
+++ b/tiger-compiler/src/inlining/inliner.hh
@@ -0,0 +1,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