retdec
|
A base class for all runners of pattern finders. More...
#include <pattern_finder_runner.h>
Public Types | |
using | PatternFinders = std::vector< ShPtr< PatternFinder > > |
A container storing pattern finders. More... | |
Public Member Functions | |
virtual | ~PatternFinderRunner ()=default |
void | run (const PatternFinders &pfs, ShPtr< Module > module) |
Runs all the given pattern finders in pfs on module. More... | |
void | run (ShPtr< PatternFinder > pf, ShPtr< Module > module) |
Runs the given pattern finder pf on module. More... | |
Protected Member Functions | |
virtual void | doActionsBeforePatternFinderRuns (ShPtr< PatternFinder > pf)=0 |
Performs actions before pattern finder pf runs. More... | |
virtual void | doActionsAfterPatternFinderHasRun (ShPtr< PatternFinder > pf, const PatternFinder::Patterns &foundPatterns)=0 |
Performs actions after pattern finder pf has run. More... | |
A base class for all runners of pattern finders.
A concrete runner should
Instances of this class have reference object semantics. The class implements the NVI ("non-virtual interface") pattern.
using retdec::llvmir2hll::PatternFinderRunner::PatternFinders = std::vector<ShPtr<PatternFinder> > |
A container storing pattern finders.
|
virtualdefault |
|
protectedpure virtual |
Performs actions after pattern finder pf has run.
[in] | pf | Pattern finder that has run. |
[in] | foundPatterns | The result of pf->findPatterns(module) . |
Implemented in retdec::llvmir2hll::NoActionPatternFinderRunner, and retdec::llvmir2hll::CLIPatternFinderRunner.
|
protectedpure virtual |
Performs actions before pattern finder pf runs.
Implemented in retdec::llvmir2hll::NoActionPatternFinderRunner, and retdec::llvmir2hll::CLIPatternFinderRunner.
void retdec::llvmir2hll::PatternFinderRunner::run | ( | const PatternFinders & | pfs, |
ShPtr< Module > | module | ||
) |
Runs all the given pattern finders in pfs on module.
[in] | pfs | Pattern finders to be run. |
[in] | module | The module that is passed to the finders in pfs. |
More specifically, it calls run(pf, module)
on every pattern finder pf
in pfs.
void retdec::llvmir2hll::PatternFinderRunner::run | ( | ShPtr< PatternFinder > | pf, |
ShPtr< Module > | module | ||
) |
Runs the given pattern finder pf on module.
[in] | pf | Pattern finder to be run. |
[in] | module | The module that is passed to pf->findPatterns() . |
More specifically, the following actions are done. (1) Calls doActionsBeforePatternFinderRuns() with pf
. (2) Calls pf->findPatterns()
and stores the result. (3) Calls doActionsAfterPatternFinderHasRun() with pf
and the result from (2).