souffle  2.0.2-371-g6315b36
PolymorphicObjects.h
Go to the documentation of this file.
1 /*
2  * Souffle - A Datalog Compiler
3  * Copyright (c) 2020, The Souffle Developers. All rights reserved.
4  * Licensed under the Universal Permissive License v 1.0 as shown at:
5  * - https://opensource.org/licenses/UPL
6  * - <souffle root>/licenses/SOUFFLE-UPL.txt
7  */
8 
9 /************************************************************************
10  *
11  * @file PolymorphicObjects.h
12  *
13  ***********************************************************************/
14 
15 #pragma once
16 
17 #include "ast/NumericConstant.h"
18 #include "ast/analysis/Analysis.h"
19 #include <map>
20 #include <set>
21 
22 namespace souffle {
23 enum class AggregateOp;
24 enum class BinaryConstraintOp;
25 enum class FunctorOp;
26 } // namespace souffle
27 
28 namespace souffle::ast {
29 class Aggregator;
30 class BinaryConstraint;
31 class IntrinsicFunctor;
32 class TranslationUnit;
33 } // namespace souffle::ast
34 
35 namespace souffle::ast::analysis {
36 
37 class TypeAnalysis;
38 
40 public:
41  static constexpr const char* name = "polymorphic-objects";
42 
44 
45  void run(const TranslationUnit& translationUnit) override;
46 
47  void print(std::ostream& os) const override;
48 
49  // Numeric constants
50  bool hasInvalidType(const NumericConstant* nc) const;
52 
53  // Functors
55 
56  // Binary constraints
58 
59  // Aggregators
61 
62 private:
63  const TypeAnalysis* typeAnalysis = nullptr;
64 };
65 
66 } // namespace souffle::ast::analysis
souffle::ast::analysis::PolymorphicObjectsAnalysis::getInferredType
NumericConstant::Type getInferredType(const NumericConstant *nc) const
Definition: PolymorphicObjects.cpp:40
souffle::ast::analysis::PolymorphicObjectsAnalysis::typeAnalysis
const TypeAnalysis * typeAnalysis
Definition: PolymorphicObjects.h:63
souffle::ast::analysis::PolymorphicObjectsAnalysis
Definition: PolymorphicObjects.h:39
souffle::AggregateOp
AggregateOp
Types of aggregation functions.
Definition: AggregateOp.h:34
souffle::ast::analysis::PolymorphicObjectsAnalysis::getOverloadedFunctionOp
FunctorOp getOverloadedFunctionOp(const IntrinsicFunctor *inf) const
Definition: PolymorphicObjects.cpp:36
souffle::ast::IntrinsicFunctor
Intrinsic Functor class for functors are in-built.
Definition: IntrinsicFunctor.h:47
souffle::ast::TranslationUnit
Translation unit class for the translation pipeline.
Definition: TranslationUnit.h:51
souffle::BinaryConstraintOp
BinaryConstraintOp
Binary Constraint Operators.
Definition: BinaryConstraintOps.h:41
souffle::ast::analysis::PolymorphicObjectsAnalysis::print
void print(std::ostream &os) const override
print the analysis result in HTML format
Definition: PolymorphicObjects.cpp:34
souffle::FunctorOp
FunctorOp
Definition: FunctorOps.h:35
souffle::ast::analysis::Analysis
Abstract class for a AST Analysis.
Definition: Analysis.h:38
souffle::ast::BinaryConstraint
Binary constraint class.
Definition: BinaryConstraint.h:53
souffle::ast::analysis::PolymorphicObjectsAnalysis::run
void run(const TranslationUnit &translationUnit) override
run analysis for a Ast translation unit
Definition: PolymorphicObjects.cpp:30
souffle::ast::Aggregator
Defines the aggregator class.
Definition: Aggregator.h:53
souffle::ast::analysis
Definition: Aggregate.cpp:39
souffle
Definition: AggregateOp.h:25
souffle::ast::analysis::PolymorphicObjectsAnalysis::name
static constexpr const char * name
Definition: PolymorphicObjects.h:41
souffle::ast::analysis::TypeAnalysis
Definition: Type.h:45
souffle::ast::NumericConstant::Type
Type
Definition: NumericConstant.h:51
souffle::ast
Definition: Aggregator.h:35
souffle::ast::NumericConstant
Numeric Constant.
Definition: NumericConstant.h:43
souffle::ast::analysis::PolymorphicObjectsAnalysis::getOverloadedOperator
BinaryConstraintOp getOverloadedOperator(const BinaryConstraint *bc) const
Definition: PolymorphicObjects.cpp:48
Analysis.h
souffle::ast::analysis::PolymorphicObjectsAnalysis::PolymorphicObjectsAnalysis
PolymorphicObjectsAnalysis()
Definition: PolymorphicObjects.h:43
souffle::ast::analysis::PolymorphicObjectsAnalysis::hasInvalidType
bool hasInvalidType(const NumericConstant *nc) const
Definition: PolymorphicObjects.cpp:44
NumericConstant.h