#include "mlir/TableGen/Predicate.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/StringExtras.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
usingnamespacemlir;
usingnamespacetblgen;
Pred::Pred(const llvm::Record *record) : … { … }
Pred::Pred(const llvm::Init *init) { … }
std::string Pred::getCondition() const { … }
bool Pred::isCombined() const { … }
ArrayRef<SMLoc> Pred::getLoc() const { … }
CPred::CPred(const llvm::Record *record) : … { … }
CPred::CPred(const llvm::Init *init) : … { … }
std::string CPred::getConditionImpl() const { … }
CombinedPred::CombinedPred(const llvm::Record *record) : … { … }
CombinedPred::CombinedPred(const llvm::Init *init) : … { … }
const llvm::Record *CombinedPred::getCombinerDef() const { … }
std::vector<const llvm::Record *> CombinedPred::getChildren() const { … }
namespace {
enum class PredCombinerKind { … };
struct PredNode { … };
}
static PredCombinerKind getPredCombinerKind(const Pred &pred) { … }
namespace {
Subst;
}
static void performSubstitutions(std::string &str,
ArrayRef<Subst> substitutions) { … }
static PredNode *
buildPredicateTree(const Pred &root,
llvm::SpecificBumpPtrAllocator<PredNode> &allocator,
ArrayRef<Subst> substitutions) { … }
static PredNode *
propagateGroundTruth(PredNode *node,
const llvm::SmallPtrSetImpl<Pred *> &knownTruePreds,
const llvm::SmallPtrSetImpl<Pred *> &knownFalsePreds) { … }
static std::string combineBinary(ArrayRef<std::string> children,
const std::string &combiner,
std::string init) { … }
static std::string combineNot(ArrayRef<std::string> children) { … }
static std::string getCombinedCondition(const PredNode &root) { … }
std::string CombinedPred::getConditionImpl() const { … }
StringRef SubstLeavesPred::getPattern() const { … }
StringRef SubstLeavesPred::getReplacement() const { … }
StringRef ConcatPred::getPrefix() const { … }
StringRef ConcatPred::getSuffix() const { … }