P4C
The P4 Compiler
Loading...
Searching...
No Matches
P4::BinaryConstraint Class Referenceabstract

Base class for EqualityConstraint and CanBeImplicitlyCastConstraint. More...

#include <typeConstraints.h>

Inheritance diagram for P4::BinaryConstraint:
[legend]

Public Member Functions

virtual BinaryConstraintcreate (const IR::Type *left, const IR::Type *right) const =0
 
 DECLARE_TYPEINFO (BinaryConstraint, TypeConstraint)
 
- Public Member Functions inherited from P4::TypeConstraint
 DECLARE_TYPEINFO (TypeConstraint)
 
virtual bool reportError (const TypeVariableSubstitution *subst) const =0
 
template<typename... Args>
bool reportError (const TypeVariableSubstitution *subst, const char *format, Args &&...args) const
 
void setError (std::string_view format, std::initializer_list< const IR::Node * > nodes)
 
- Public Member Functions inherited from P4::IHasDbPrint
virtual void dbprint (std::ostream &out) const =0
 
void print () const
 
- Public Member Functions inherited from P4::ICastable
template<typename T >
T & as ()
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
const T & as () const
 Tries to convert the class to type T. A BUG occurs if the cast fails.
 
template<typename T >
T * checkedTo ()
 Performs a checked cast. A BUG occurs if the cast fails.
 
template<typename T >
const T * checkedTo () const
 Performs a checked cast. A BUG occurs if the cast fails.
 
- Public Member Functions inherited from P4::RTTI::Base
template<typename T >
bool is () const noexcept
 
virtual bool isA (TypeId typeId) const noexcept=0
 
template<typename T >
const T * to () const noexcept
 Same as to, but returns const pointer to T.
 
template<typename T >
T * to () noexcept
 
virtual TypeId typeId () const noexcept=0
 

Public Attributes

const IR::Type * left
 
const IR::Type * right
 

Protected Member Functions

 BinaryConstraint (const IR::Type *left, const IR::Type *right, const IR::Node *origin)
 
 BinaryConstraint (const IR::Type *left, const IR::Type *right, const TypeConstraint *derivedFrom)
 
void validate () const
 
- Protected Member Functions inherited from P4::TypeConstraint
 TypeConstraint (const IR::Node *origin)
 
 TypeConstraint (const TypeConstraint *derivedFrom)
 
std::string explain (size_t index, Explain *explainer) const
 
std::string localError (Explain *explainer) const
 
- Protected Member Functions inherited from P4::RTTI::Base
virtual const void * toImpl (TypeId typeId) const noexcept=0
 

Additional Inherited Members

- Protected Attributes inherited from P4::TypeConstraint
const TypeConstraintderivedFrom = nullptr
 Constraint which produced this one. May be nullptr.
 
const IR::Nodeorigin = nullptr
 Place in source code which originated the contraint. May be nullptr.
 

Detailed Description

Base class for EqualityConstraint and CanBeImplicitlyCastConstraint.