llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
tail_rec_elim.h
1 // This file if part of the llir-opt project.
2 // Licensing information can be found in the LICENSE file.
3 // (C) 2018 Nandor Licker. All rights reserved.
4 
5 #pragma once
6 
7 #include "core/pass.h"
8 
9 class Func;
10 
11 
12 
25 class TailRecElimPass final : public Pass {
26 public:
28  static const char *kPassID;
29 
31  TailRecElimPass(PassManager *passManager) : Pass(passManager) {}
32 
34  bool Run(Prog &prog) override;
35 
37  const char *GetPassName() const override;
38 
39 private:
41  bool Run(Func &func);
42 };
Func
Definition: func.h:30
PassManager
Definition: pass_manager.h:74
Pass
Definition: pass.h:17
TailRecElimPass
Definition: tail_rec_elim.h:25
TailRecElimPass::GetPassName
const char * GetPassName() const override
Returns the name of the pass.
Definition: tail_rec_elim.cpp:38
Prog
Definition: prog.h:33
TailRecElimPass::kPassID
static const char * kPassID
Pass identifier.
Definition: tail_rec_elim.h:28
TailRecElimPass::TailRecElimPass
TailRecElimPass(PassManager *passManager)
Initialises the pass.
Definition: tail_rec_elim.h:31
TailRecElimPass::Run
bool Run(Prog &prog) override
Runs the pass.
Definition: tail_rec_elim.cpp:26