llvm/mlir/include/mlir/TableGen/Predicate.h

//===- Predicate.h - Predicate class ----------------------------*- 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
//
//===----------------------------------------------------------------------===//
//
// Wrapper around predicates defined in TableGen.
//
//===----------------------------------------------------------------------===//

#ifndef MLIR_TABLEGEN_PREDICATE_H_
#define MLIR_TABLEGEN_PREDICATE_H_

#include "mlir/Support/LLVM.h"
#include "llvm/ADT/Hashing.h"

#include <string>
#include <vector>

namespace llvm {
class Init;
class ListInit;
class Record;
class SMLoc;
} // namespace llvm

namespace mlir {
namespace tblgen {

// A logical predicate.  This class must closely follow the definition of
// TableGen class 'Pred'.
class Pred {};

// A logical predicate wrapping a C expression.  This class must closely follow
// the definition of TableGen class 'CPred'.
class CPred : public Pred {};

// A logical predicate that is a combination of other predicates.  This class
// must closely follow the definition of TableGen class 'CombinedPred'.
class CombinedPred : public Pred {};

// A combined predicate that requires all child predicates of 'CPred' type to
// have their expression rewritten with a simple string substitution rule.
class SubstLeavesPred : public CombinedPred {};

// A combined predicate that prepends a prefix and appends a suffix to the
// predicate string composed from a child predicate.
class ConcatPred : public CombinedPred {};

} // namespace tblgen
} // namespace mlir

#endif // MLIR_TABLEGEN_PREDICATE_H_