llir-opt  0.0.1
Low-Level Post-Link Optimiser for OCaml and C
dead_code_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 
10 
14 class DeadCodeElimPass final : public Pass {
15 public:
17  static const char *kPassID;
18 
20  DeadCodeElimPass(PassManager *passManager) : Pass(passManager) {}
21 
23  bool Run(Prog &prog) override;
24 
26  const char *GetPassName() const override;
27 
28 private:
30  bool Run(Func &func);
31 };
Func
Definition: func.h:30
PassManager
Definition: pass_manager.h:74
Pass
Definition: pass.h:17
DeadCodeElimPass::DeadCodeElimPass
DeadCodeElimPass(PassManager *passManager)
Initialises the pass.
Definition: dead_code_elim.h:20
DeadCodeElimPass
Definition: dead_code_elim.h:14
DeadCodeElimPass::GetPassName
const char * GetPassName() const override
Returns the name of the pass.
Definition: dead_code_elim.cpp:38
DeadCodeElimPass::kPassID
static const char * kPassID
Pass identifier.
Definition: dead_code_elim.h:17
Prog
Definition: prog.h:33
DeadCodeElimPass::Run
bool Run(Prog &prog) override
Runs the pass.
Definition: dead_code_elim.cpp:25