souffle  2.0.2-371-g6315b36
Public Member Functions | Private Member Functions | Private Attributes
souffle::ast::transform::FixpointTransformer Class Reference

Transformer that repeatedly executes a sub-transformer until no changes are made. More...

#include <Fixpoint.h>

Inheritance diagram for souffle::ast::transform::FixpointTransformer:
Inheritance graph
Collaboration diagram for souffle::ast::transform::FixpointTransformer:
Collaboration graph

Public Member Functions

FixpointTransformerclone () const override
 
void disableTransformers (const std::set< std::string > &transforms) override
 
 FixpointTransformer (Own< Transformer > transformer)
 
std::string getName () const override
 
std::vector< Transformer * > getSubtransformers () const override
 
void setDebugReport () override
 
void setVerbosity (bool verbose) override
 
- Public Member Functions inherited from souffle::ast::transform::MetaTransformer
bool applySubtransformer (TranslationUnit &translationUnit, Transformer *transformer)
 
- Public Member Functions inherited from souffle::ast::transform::Transformer
bool apply (TranslationUnit &translationUnit)
 
virtual ~Transformer ()=default
 

Private Member Functions

bool transform (TranslationUnit &translationUnit) override
 

Private Attributes

Own< Transformertransformer
 

Additional Inherited Members

- Protected Attributes inherited from souffle::ast::transform::MetaTransformer
bool verbose = false
 

Detailed Description

Transformer that repeatedly executes a sub-transformer until no changes are made.

Definition at line 42 of file Fixpoint.h.

Constructor & Destructor Documentation

◆ FixpointTransformer()

souffle::ast::transform::FixpointTransformer::FixpointTransformer ( Own< Transformer transformer)
inline

Definition at line 50 of file Fixpoint.h.

52 {

Referenced by disableTransformers().

Member Function Documentation

◆ clone()

FixpointTransformer* souffle::ast::transform::FixpointTransformer::clone ( ) const
inlineoverridevirtual

Implements souffle::ast::transform::MetaTransformer.

Definition at line 83 of file Fixpoint.h.

◆ disableTransformers()

void souffle::ast::transform::FixpointTransformer::disableTransformers ( const std::set< std::string > &  transforms)
inlineoverridevirtual

Implements souffle::ast::transform::MetaTransformer.

Definition at line 71 of file Fixpoint.h.

71  {
73  }
74 
75 private:
76  Own<Transformer> transformer;
77  bool transform(TranslationUnit& translationUnit) override {

References souffle::clone(), FixpointTransformer(), and transformer.

Here is the call graph for this function:

◆ getName()

std::string souffle::ast::transform::FixpointTransformer::getName ( ) const
inlineoverridevirtual

Implements souffle::ast::transform::Transformer.

Definition at line 79 of file Fixpoint.h.

79  {
80  changed = true;
81  }

◆ getSubtransformers()

std::vector<Transformer*> souffle::ast::transform::FixpointTransformer::getSubtransformers ( ) const
inlineoverridevirtual

Implements souffle::ast::transform::MetaTransformer.

Definition at line 60 of file Fixpoint.h.

60  {
61  mt->disableTransformers(transforms);
62  } else if (transforms.find(transformer->getName()) != transforms.end()) {

◆ setDebugReport()

void souffle::ast::transform::FixpointTransformer::setDebugReport ( )
inlineoverridevirtual

Implements souffle::ast::transform::MetaTransformer.

Definition at line 52 of file Fixpoint.h.

52  {
53  this->verbose = verbose;
54  if (auto* mt = dynamic_cast<MetaTransformer*>(transformer.get())) {
55  mt->setVerbosity(verbose);
56  }
57  }
58 

References transformer, and souffle::ast::transform::MetaTransformer::verbose.

◆ setVerbosity()

void souffle::ast::transform::FixpointTransformer::setVerbosity ( bool  verbose)
inlineoverridevirtual

Implements souffle::ast::transform::MetaTransformer.

Definition at line 64 of file Fixpoint.h.

67  {
68  return "FixpointTransformer";
69  }

◆ transform()

bool souffle::ast::transform::FixpointTransformer::transform ( TranslationUnit translationUnit)
inlineoverrideprivatevirtual

Implements souffle::ast::transform::Transformer.

Definition at line 89 of file Fixpoint.h.

Field Documentation

◆ transformer

Own<Transformer> souffle::ast::transform::FixpointTransformer::transformer
private

Definition at line 88 of file Fixpoint.h.

Referenced by disableTransformers(), and setDebugReport().


The documentation for this class was generated from the following file:
souffle::clone
auto clone(const std::vector< A * > &xs)
Definition: ContainerUtil.h:172
souffle::ast::transform::MetaTransformer::verbose
bool verbose
Definition: Meta.h:44
souffle::ast::transform::FixpointTransformer::transformer
Own< Transformer > transformer
Definition: Fixpoint.h:88
souffle::ast::transform::FixpointTransformer::FixpointTransformer
FixpointTransformer(Own< Transformer > transformer)
Definition: Fixpoint.h:50
souffle::ast::transform::FixpointTransformer::transform
bool transform(TranslationUnit &translationUnit) override
Definition: Fixpoint.h:89