FLANG
|
#include <flang/Evaluate/rewrite.h>
Public Member Functions | |
Mutator (Rewriter &rewriter) | |
template<typename T , typename U = llvm::remove_cvref_t<T>> | |
U | operator() (T &&x) |
Bottom-up Expr<T> rewriter.
The Mutator traverses and reconstructs given Expr<T>. Going bottom-up, whenever the traversal visits a sub-node of type Expr (for some U), it will invoke the user-provided rewriter via the () operator.
If x is of type Expr, it will call (in pseudo-code): rewriter_(x, active_member_of(x.u)) The second parameter is there to make it easier to overload the () operator for specific operations in Expr<...>.
The user rewriter is only invoked for Expr, not for Operation, nor any other subobject.