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