VapourSynth-llvmexpr
Loading...
Searching...
No Matches
ConstPropPass.hpp
Go to the documentation of this file.
1
19
20#ifndef LLVMEXPR_ANALYSIS_CONST_PROP_PASS_HPP
21#define LLVMEXPR_ANALYSIS_CONST_PROP_PASS_HPP
22
23#include "../framework/Pass.hpp"
24
25#include <optional>
26#include <vector>
27
28namespace analysis {
29
31 std::vector<std::vector<std::optional<double>>> const_stack_in;
32 std::vector<std::vector<std::optional<double>>> const_stack_out;
33};
34/*
35 Performs forward dataflow analysis to track compile-time constant values on the stack through the CFG.
36 Depends on: BlockAnalysisPass
37*/
38class ConstPropPass : public AnalysisPass<ConstPropPass, ConstPropResult> {
39 public:
41
42 [[nodiscard]] const char* getName() const override {
43 return "Constant Propagation Pass";
44 }
45
46 Result run(const std::vector<Token>& tokens, AnalysisManager& am) override;
47};
48
49} // namespace analysis
50
51#endif // LLVMEXPR_ANALYSIS_CONST_PROP_PASS_HPP
const char * getName() const override
Result run(const std::vector< Token > &tokens, AnalysisManager &am) override
std::vector< std::vector< std::optional< double > > > const_stack_out
std::vector< std::vector< std::optional< double > > > const_stack_in