retdec
pattern_finder_runner.h
Go to the documentation of this file.
1 
7 #ifndef RETDEC_LLVMIR2HLL_PATTERN_PATTERN_FINDER_RUNNER_H
8 #define RETDEC_LLVMIR2HLL_PATTERN_PATTERN_FINDER_RUNNER_H
9 
10 #include <vector>
11 
13 
14 namespace retdec {
15 namespace llvmir2hll {
16 
17 class Module;
18 
29 public:
31  using PatternFinders = std::vector<ShPtr<PatternFinder>>;
32 
33 public:
34  virtual ~PatternFinderRunner() = default;
35  void run(const PatternFinders &pfs, ShPtr<Module> module);
37 
38 protected:
43 
51  const PatternFinder::Patterns &foundPatterns) = 0;
52 };
53 
54 } // namespace llvmir2hll
55 } // namespace retdec
56 
57 #endif
A base class for all runners of pattern finders.
Definition: pattern_finder_runner.h:28
virtual void doActionsBeforePatternFinderRuns(ShPtr< PatternFinder > pf)=0
Performs actions before pattern finder pf runs.
std::vector< ShPtr< PatternFinder > > PatternFinders
A container storing pattern finders.
Definition: pattern_finder_runner.h:31
void run(const PatternFinders &pfs, ShPtr< Module > module)
Runs all the given pattern finders in pfs on module.
Definition: pattern_finder_runner.cpp:25
virtual void doActionsAfterPatternFinderHasRun(ShPtr< PatternFinder > pf, const PatternFinder::Patterns &foundPatterns)=0
Performs actions after pattern finder pf has run.
std::vector< ShPtr< Pattern > > Patterns
A list of patterns.
Definition: pattern_finder.h:41
ShPtr< Module > module
The current module.
Definition: hll_writer.cpp:100
A library providing API for working with back-end IR.
std::shared_ptr< T > ShPtr
An alias for a shared pointer.
Definition: smart_ptr.h:18
Definition: archive_wrapper.h:19
A base class for all pattern finders.