souffle  2.0.2-371-g6315b36
Public Member Functions | Static Public Attributes | Protected Attributes
souffle::ram::analysis::RelationAnalysis Class Reference

A RAM Analysis for finding relations by name. More...

#include <Relation.h>

Inheritance diagram for souffle::ram::analysis::RelationAnalysis:
Inheritance graph
Collaboration diagram for souffle::ram::analysis::RelationAnalysis:
Collaboration graph

Public Member Functions

const ram::Relationlookup (const std::string &name) const
 
 RelationAnalysis (const char *id)
 
void run (const TranslationUnit &) override
 Run analysis for a RAM translation unit. More...
 
- Public Member Functions inherited from souffle::ram::analysis::Analysis
 Analysis (const char *id)
 
virtual const std::string & getName () const
 get name of the analysis More...
 
virtual void print (std::ostream &) const
 Print the analysis result in HTML format. More...
 
virtual ~Analysis ()=default
 

Static Public Attributes

static constexpr const char * name = "relation-analysis"
 

Protected Attributes

std::map< std::string, const ram::Relation * > relationMap
 
- Protected Attributes inherited from souffle::ram::analysis::Analysis
std::string identifier
 name of analysis instance More...
 

Detailed Description

A RAM Analysis for finding relations by name.

Definition at line 36 of file Relation.h.

Constructor & Destructor Documentation

◆ RelationAnalysis()

souffle::ram::analysis::RelationAnalysis::RelationAnalysis ( const char *  id)
inline

Definition at line 38 of file Relation.h.

40 :
41  std::map<std::string, const ram::Relation*> relationMap;

Member Function Documentation

◆ lookup()

const ram::Relation & souffle::ram::analysis::RelationAnalysis::lookup ( const std::string &  name) const

Definition at line 33 of file Relation.cpp.

33  {
34  visitDepthFirst(translationUnit.getProgram(),
35  [&](const Relation& relation) { relationMap[relation.getName()] = &relation; });
36 }
37 

References souffle::ram::TranslationUnit::getProgram(), relation, and souffle::ram::visitDepthFirst().

Referenced by souffle::ram::transform::MakeIndexTransformer::makeIndex(), and souffle::ram::transform::ParallelTransformer::parallelizeOperations().

Here is the call graph for this function:

◆ run()

void souffle::ram::analysis::RelationAnalysis::run ( const TranslationUnit translationUnit)
overridevirtual

Run analysis for a RAM translation unit.

Implements souffle::ram::analysis::Analysis.

Definition at line 39 of file Relation.cpp.

Field Documentation

◆ name

constexpr const char* souffle::ram::analysis::RelationAnalysis::name = "relation-analysis"
staticconstexpr

Definition at line 40 of file Relation.h.

◆ relationMap

std::map<std::string, const ram::Relation*> souffle::ram::analysis::RelationAnalysis::relationMap
protected

Definition at line 47 of file Relation.h.


The documentation for this class was generated from the following files:
relation
Relation & relation
Definition: Reader.h:130
souffle::ram::analysis::RelationAnalysis::relationMap
std::map< std::string, const ram::Relation * > relationMap
Definition: Relation.h:47
souffle::ram::visitDepthFirst
void visitDepthFirst(const Node &root, Visitor< R, Ps... > &visitor, Args &... args)
A utility function visiting all nodes within the RAM fragments rooted by the given node recursively i...
Definition: Visitor.h:357