|
| SEqualReducer ()=default |
| default constructor More...
|
|
| SEqualReducer (Handler *handler, const PathTracingData *tracing_data, bool map_free_vars) |
| Constructor with a specific handler. More...
|
|
bool | operator() (const double &lhs, const double &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
| Reduce condition to comparison of two attribute values. More...
|
|
bool | operator() (const int64_t &lhs, const int64_t &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
|
bool | operator() (const uint64_t &lhs, const uint64_t &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
|
bool | operator() (const int &lhs, const int &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
|
bool | operator() (const bool &lhs, const bool &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
|
bool | operator() (const std::string &lhs, const std::string &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
|
bool | operator() (const DataType &lhs, const DataType &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
|
template<typename ENum , typename = typename std::enable_if<std::is_enum<ENum>::value>::type> |
bool | operator() (const ENum &lhs, const ENum &rhs, Optional< ObjectPathPair > paths=NullOpt) const |
|
template<typename T , typename Callable , typename = std::enable_if_t< std::is_same_v<std::invoke_result_t<Callable, const ObjectPath&>, ObjectPath>>> |
bool | operator() (const T &lhs, const T &rhs, const Callable &callable) |
|
bool | operator() (const ObjectRef &lhs, const ObjectRef &rhs) const |
| Reduce condition to comparison of two objects. More...
|
|
bool | operator() (const ObjectRef &lhs, const ObjectRef &rhs, const ObjectPathPair &paths) const |
| Reduce condition to comparison of two objects. More...
|
|
bool | DefEqual (const ObjectRef &lhs, const ObjectRef &rhs) |
| Reduce condition to comparison of two definitions, where free vars can be mapped. More...
|
|
template<typename T > |
bool | operator() (const Array< T > &lhs, const Array< T > &rhs) const |
| Reduce condition to comparison of two arrays. More...
|
|
bool | FreeVarEqualImpl (const runtime::Object *lhs, const runtime::Object *rhs) const |
| Implementation for equality rule of var type objects(e.g. TypeVar, tir::Var). More...
|
|
Handler * | operator-> () const |
|
bool | IsPathTracingEnabled () const |
| Check if this reducer is tracing paths to the first mismatch. More...
|
|
const ObjectPathPair & | GetCurrentObjectPaths () const |
| Get the paths of the currently compared objects. More...
|
|
void | RecordMismatchPaths (const ObjectPathPair &paths) const |
| Specify the object paths of a detected mismatch. More...
|
|
A Reducer class to reduce the structural equality result of two objects.
The reducer will call the SEqualReduce function of each objects recursively. Importantly, the reducer may not directly use recursive calls to resolve the equality checking. Instead, it can store the necessary equality conditions and check later via an internally managed stack.
Reduce condition to comparison of two objects.
Like operator()
, but with an additional paths
parameter that specifies explicit object paths for lhs
and rhs
. This is useful for implementing SEqualReduce() methods for container objects like Array and Map, or other custom objects that store nested objects that are not simply attributes.
Can only be called when IsPathTracingEnabled()
is true
.
- Parameters
-
lhs | The left operand. |
rhs | The right operand. |
paths | Object paths for lhs and rhs . |
- Returns
- the immediate check result.