llvm/mlir/include/mlir/Query/Matcher/VariantValue.h

//===--- VariantValue.h -----------------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// Supports all the types required for dynamic Matcher construction.
// Used by the registry to construct matchers in a generic way.
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_TOOLS_MLIRQUERY_MATCHER_VARIANTVALUE_H
#define MLIR_TOOLS_MLIRQUERY_MATCHER_VARIANTVALUE_H

#include "ErrorBuilder.h"
#include "MatchersInternal.h"
#include "llvm/ADT/StringRef.h"

namespace mlir::query::matcher {

// All types that VariantValue can contain.
enum class ArgKind {};

// A variant matcher object to abstract simple and complex matchers into a
// single object type.
class VariantMatcher {};

// Variant value class with a tagged union with value type semantics. It is used
// by the registry as the return value and argument type for the matcher factory
// methods. It can be constructed from any of the supported types:
//  - StringRef
//  - VariantMatcher
class VariantValue {};

// A VariantValue instance annotated with its parser context.
struct ParserValue {};

} // namespace mlir::query::matcher

#endif // MLIR_TOOLS_MLIRQUERY_MATCHER_VARIANTVALUE_H