47#ifndef LLVM_TABLEGEN_SETTHEORY_H
48#define LLVM_TABLEGEN_SETTHEORY_H
67 using RecVec = std::vector<const Record *>;
72 virtual void anchor();
87 virtual void anchor();
98 using ExpandMap = std::map<const Record *, RecVec>;
131 template<
typename Iter>
This file defines the StringMap class.
This file implements a set that has insertion order iteration characteristics.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
(v a, b) - Represent a DAG tree value.
Expander - A callback function that can transform a Record representing a set into a fully expanded l...
virtual void expand(SetTheory &, const Record *, RecSet &Elts)=0
virtual ~Expander()=default
Operator - A callback representing a DAG operator.
virtual void apply(SetTheory &, const DagInit *Expr, RecSet &Elts, ArrayRef< SMLoc > Loc)=0
apply - Apply this operator to Expr's arguments and insert the result in Elts.
virtual ~Operator()=default
void addOperator(StringRef Name, std::unique_ptr< Operator >)
addOperator - Add a DAG operator.
SetTheory()
Create a SetTheory instance with only the standard operators.
const RecVec * expand(const Record *Set)
expand - Expand a record into a set of elements if possible.
void evaluate(Iter begin, Iter end, RecSet &Elts, ArrayRef< SMLoc > Loc)
evaluate - Evaluate a sequence of Inits and append to Elts.
void evaluate(const Init *Expr, RecSet &Elts, ArrayRef< SMLoc > Loc)
evaluate - Evaluate Expr and append the resulting set to Elts.
std::vector< const Record * > RecVec
void addFieldExpander(StringRef ClassName, StringRef FieldName)
addFieldExpander - Add an expander for ClassName that simply evaluates FieldName in the Record to get...
void addExpander(StringRef ClassName, std::unique_ptr< Expander >)
addExpander - Add an expander for Records with the named super class.
A SetVector that performs no allocations if smaller than a certain size.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
StringRef - Represent a constant reference to a string, i.e.
This is an optimization pass for GlobalISel generic memory operations.