souffle  2.0.2-371-g6315b36
Public Member Functions | Static Public Attributes | Private Attributes
souffle::ast::analysis::RelationDetailCacheAnalysis Class Reference

Analysis pass mapping identifiers with relations and clauses. More...

#include <RelationDetailCache.h>

Inheritance diagram for souffle::ast::analysis::RelationDetailCacheAnalysis:
Inheritance graph
Collaboration diagram for souffle::ast::analysis::RelationDetailCacheAnalysis:
Collaboration graph

Public Member Functions

std::set< Clause * > getClauses (const QualifiedName &name) const
 
std::set< Clause * > getClauses (const Relation *rel) const
 
RelationgetRelation (const QualifiedName &name) const
 
void print (std::ostream &os) const override
 print the analysis result in HTML format More...
 
 RelationDetailCacheAnalysis ()
 
void run (const TranslationUnit &translationUnit) override
 run analysis for a Ast translation unit More...
 
- Public Member Functions inherited from souffle::ast::analysis::Analysis
 Analysis (std::string identifier)
 
virtual const std::string & getName () const
 get name of the analysis More...
 
virtual ~Analysis ()=default
 

Static Public Attributes

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

Private Attributes

std::map< QualifiedName, std::set< Clause * > > nameToClauses
 
std::map< QualifiedName, Relation * > nameToRelation
 

Additional Inherited Members

- Protected Attributes inherited from souffle::ast::analysis::Analysis
const std::string identifier
 

Detailed Description

Analysis pass mapping identifiers with relations and clauses.

Definition at line 47 of file RelationDetailCache.h.

Constructor & Destructor Documentation

◆ RelationDetailCacheAnalysis()

souffle::ast::analysis::RelationDetailCacheAnalysis::RelationDetailCacheAnalysis ( )
inline

Definition at line 51 of file RelationDetailCache.h.

Member Function Documentation

◆ getClauses() [1/2]

std::set<Clause*> souffle::ast::analysis::RelationDetailCacheAnalysis::getClauses ( const QualifiedName name) const
inline

Definition at line 69 of file RelationDetailCache.h.

◆ getClauses() [2/2]

std::set<Clause*> souffle::ast::analysis::RelationDetailCacheAnalysis::getClauses ( const Relation rel) const
inline

Definition at line 64 of file RelationDetailCache.h.

68  :
69  std::map<QualifiedName, Relation*> nameToRelation;

◆ getRelation()

Relation* souffle::ast::analysis::RelationDetailCacheAnalysis::getRelation ( const QualifiedName name) const
inline

Definition at line 57 of file RelationDetailCache.h.

61  {
62  if (nameToClauses.find(name) != nameToClauses.end()) {

◆ print()

void souffle::ast::analysis::RelationDetailCacheAnalysis::print ( std::ostream &  ) const
overridevirtual

print the analysis result in HTML format

Reimplemented from souffle::ast::analysis::Analysis.

Definition at line 56 of file RelationDetailCache.cpp.

◆ run()

void souffle::ast::analysis::RelationDetailCacheAnalysis::run ( const TranslationUnit )
overridevirtual

run analysis for a Ast translation unit

Implements souffle::ast::analysis::Analysis.

Definition at line 41 of file RelationDetailCache.cpp.

41  {
42  nameToClauses[relationName] = std::set<Clause*>();
43  }
44  nameToClauses.at(relationName).insert(clause);
45  }
46 }
47 
48 void RelationDetailCacheAnalysis::print(std::ostream& os) const {
49  for (const auto& pair : nameToClauses) {
50  os << "--" << pair.first << "--";
51  os << std::endl;
52  for (const auto* clause : pair.second) {
53  os << *clause << std::endl;
54  }

References nameToClauses.

Field Documentation

◆ name

constexpr const char* souffle::ast::analysis::RelationDetailCacheAnalysis::name = "relation-detail"
staticconstexpr

Definition at line 49 of file RelationDetailCache.h.

◆ nameToClauses

std::map<QualifiedName, std::set<Clause*> > souffle::ast::analysis::RelationDetailCacheAnalysis::nameToClauses
private

Definition at line 78 of file RelationDetailCache.h.

Referenced by run().

◆ nameToRelation

std::map<QualifiedName, Relation*> souffle::ast::analysis::RelationDetailCacheAnalysis::nameToRelation
private

Definition at line 77 of file RelationDetailCache.h.


The documentation for this class was generated from the following files:
souffle::ast::analysis::RelationDetailCacheAnalysis::nameToClauses
std::map< QualifiedName, std::set< Clause * > > nameToClauses
Definition: RelationDetailCache.h:78
souffle::ast::analysis::RelationDetailCacheAnalysis::nameToRelation
std::map< QualifiedName, Relation * > nameToRelation
Definition: RelationDetailCache.h:77
souffle::ast::analysis::RelationDetailCacheAnalysis::name
static constexpr const char * name
Definition: RelationDetailCache.h:49
souffle::ast::analysis::RelationDetailCacheAnalysis::print
void print(std::ostream &os) const override
print the analysis result in HTML format
Definition: RelationDetailCache.cpp:56