13#ifndef FORTRAN_OPTIMIZER_SUPPORT_MATCHER_H
14#define FORTRAN_OPTIMIZER_SUPPORT_MATCHER_H
16#include "flang/Common/idioms.h"
21namespace fir::details {
23template<
class... Ts>
struct matches : Ts... {
using Ts::operator()...; };
26 template<
typename... Ts>
auto match(Ts... ts) {
27 return Fortran::common::visit(
matches{ts...},
static_cast<N*
>(
this)->matchee());
29 template<
typename... Ts>
auto match(Ts... ts)
const {
30 return Fortran::common::visit(
matches{ts...},
static_cast<N const*
>(
this)->matchee());