FreeTensor
Loading...
Searching...
No Matches
Namespaces | Macros | Functions
match_ast.cc File Reference
#include <algorithm>
#include <container_utils.h>
#include <debug/match_ast.h>
#include <pass/flatten_stmt_seq.h>
Include dependency graph for match_ast.cc:

Namespaces

namespace  freetensor
 

Macros

#define CHECK(expr)
 
#define TRY_RECURSE(lexpr, rexpr)
 
#define RECURSE(lexpr, rexpr)
 

Functions

bool freetensor::match (const Stmt &pattern, const Stmt &instance)
 

Macro Definition Documentation

◆ CHECK

#define CHECK (   expr)
Value:
if (!(expr)) { \
isMatched_ = false; \
return; \
}

◆ RECURSE

#define RECURSE (   lexpr,
  rexpr 
)
Value:
{ \
TRY_RECURSE(lexpr, rexpr) \
if (!isMatched_) { \
return; \
} \
}

◆ TRY_RECURSE

#define TRY_RECURSE (   lexpr,
  rexpr 
)
Value:
/* Check isMatched_ because some node visitor will reset it and retry */ \
if (isMatched_) { \
auto oldInstance = instance_; \
instance_ = rexpr; \
(*this)(lexpr); \
instance_ = oldInstance; \
}