souffle  2.0.2-371-g6315b36
Public Member Functions | Protected Member Functions | Protected Attributes
souffle::ast::transform::PipelineTransformer Class Reference

Transformer that holds an arbitrary number of sub-transformations. More...

#include <Pipeline.h>

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

Public Member Functions

PipelineTransformerclone () const override
 
void disableTransformers (const std::set< std::string > &transforms) override
 
std::string getName () const override
 
std::vector< Transformer * > getSubtransformers () const override
 
template<typename... Args>
 PipelineTransformer (Args... args)
 
 PipelineTransformer (VecOwn< Transformer > pipeline)
 
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
 

Protected Member Functions

bool transform (TranslationUnit &translationUnit) override
 

Protected Attributes

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

Detailed Description

Transformer that holds an arbitrary number of sub-transformations.

Definition at line 44 of file Pipeline.h.

Constructor & Destructor Documentation

◆ PipelineTransformer() [1/2]

template<typename... Args>
souffle::ast::transform::PipelineTransformer::PipelineTransformer ( Args...  args)
inline

Definition at line 53 of file Pipeline.h.

54  {
55  for (auto& i : pipeline) {
56  if (auto* mt = dynamic_cast<MetaTransformer*>(i.get())) {
57  mt->setDebugReport();
58  } else {

References i, and pipeline.

◆ PipelineTransformer() [2/2]

souffle::ast::transform::PipelineTransformer::PipelineTransformer ( VecOwn< Transformer pipeline)
inline

Definition at line 60 of file Pipeline.h.

64 {

Member Function Documentation

◆ clone()

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

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

Definition at line 99 of file Pipeline.h.

99  : pipeline) {
100  changed |= applySubtransformer(translationUnit, transformer.get());
101  }
102  return changed;
103  }
104 };
105 

References souffle::ast::transform::MetaTransformer::applySubtransformer().

Here is the call graph for this function:

◆ disableTransformers()

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

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

Definition at line 85 of file Pipeline.h.

87  {
88  VecOwn<Transformer> transformers;
89  for (const auto& transformer : pipeline) {
90  transformers.push_back(souffle::clone(transformer));
91  }
92  return new PipelineTransformer(std::move(transformers));
93  }

◆ getName()

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

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

Definition at line 95 of file Pipeline.h.

95  :
96  VecOwn<Transformer> pipeline;
97  bool transform(TranslationUnit& translationUnit) override {

◆ getSubtransformers()

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

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

Definition at line 62 of file Pipeline.h.

64  {

◆ setDebugReport()

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

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

Definition at line 66 of file Pipeline.h.

66  : pipeline) {
67  if (auto* mt = dynamic_cast<MetaTransformer*>(cur.get())) {
68  mt->setVerbosity(verbose);
69  }
70  }
71  }
72 
73  void disableTransformers(const std::set<std::string>& transforms) override {
74  for (auto& i : pipeline) {

References souffle::ast::transform::MetaTransformer::verbose.

◆ setVerbosity()

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

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

Definition at line 76 of file Pipeline.h.

77  {
78  i = mk<NullTransformer>();
79  }
80  }
81  }
82 
83  std::string getName() const override {

◆ transform()

bool souffle::ast::transform::PipelineTransformer::transform ( TranslationUnit translationUnit)
inlineoverrideprotectedvirtual

Field Documentation

◆ pipeline

VecOwn<Transformer> souffle::ast::transform::PipelineTransformer::pipeline
protected

Definition at line 108 of file Pipeline.h.

Referenced by PipelineTransformer().


The documentation for this class was generated from the following file:
souffle::ast::transform::PipelineTransformer::transform
bool transform(TranslationUnit &translationUnit) override
Definition: Pipeline.h:109
souffle::ast::transform::PipelineTransformer::PipelineTransformer
PipelineTransformer(Args... args)
Definition: Pipeline.h:53
souffle::ast::transform::PipelineTransformer::disableTransformers
void disableTransformers(const std::set< std::string > &transforms) override
Definition: Pipeline.h:85
souffle::clone
auto clone(const std::vector< A * > &xs)
Definition: ContainerUtil.h:172
i
size_t i
Definition: json11.h:663
souffle::ast::transform::MetaTransformer::verbose
bool verbose
Definition: Meta.h:44
souffle::ast::transform::PipelineTransformer::getName
std::string getName() const override
Definition: Pipeline.h:95
souffle::ast::transform::PipelineTransformer::pipeline
VecOwn< Transformer > pipeline
Definition: Pipeline.h:108
souffle::ast::transform::MetaTransformer::applySubtransformer
bool applySubtransformer(TranslationUnit &translationUnit, Transformer *transformer)
Definition: Meta.cpp:30