llvm/llvm/lib/TableGen/SetTheory.cpp

//===- SetTheory.cpp - Generate ordered sets from DAG expressions ---------===//
//
// 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
//
//===----------------------------------------------------------------------===//
//
// This file implements the SetTheory class that computes ordered sets of
// Records from DAG expressions.
//
//===----------------------------------------------------------------------===//

#include "llvm/TableGen/SetTheory.h"
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/SMLoc.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/TableGen/Error.h"
#include "llvm/TableGen/Record.h"
#include <algorithm>
#include <cstdint>
#include <string>
#include <utility>

usingnamespacellvm;

// Define the standard operators.
namespace {

RecSet;
RecVec;

// (add a, b, ...) Evaluate and union all arguments.
struct AddOp : public SetTheory::Operator {};

// (sub Add, Sub, ...) Set difference.
struct SubOp : public SetTheory::Operator {};

// (and S1, S2) Set intersection.
struct AndOp : public SetTheory::Operator {};

// SetIntBinOp - Abstract base class for (Op S, N) operators.
struct SetIntBinOp : public SetTheory::Operator {};

// (shl S, N) Shift left, remove the first N elements.
struct ShlOp : public SetIntBinOp {};

// (trunc S, N) Truncate after the first N elements.
struct TruncOp : public SetIntBinOp {};

// Left/right rotation.
struct RotOp : public SetIntBinOp {};

// (decimate S, N) Pick every N'th element of S.
struct DecimateOp : public SetIntBinOp {};

// (interleave S1, S2, ...) Interleave elements of the arguments.
struct InterleaveOp : public SetTheory::Operator {};

// (sequence "Format", From, To) Generate a sequence of records by name.
struct SequenceOp : public SetTheory::Operator {};

// Expand a Def into a set by evaluating one of its fields.
struct FieldExpander : public SetTheory::Expander {};

} // end anonymous namespace

// Pin the vtables to this file.
void SetTheory::Operator::anchor() {}
void SetTheory::Expander::anchor() {}

SetTheory::SetTheory() {}

void SetTheory::addOperator(StringRef Name, std::unique_ptr<Operator> Op) {}

void SetTheory::addExpander(StringRef ClassName, std::unique_ptr<Expander> E) {}

void SetTheory::addFieldExpander(StringRef ClassName, StringRef FieldName) {}

void SetTheory::evaluate(const Init *Expr, RecSet &Elts, ArrayRef<SMLoc> Loc) {}

const RecVec *SetTheory::expand(const Record *Set) {}