47 #ifndef LLVM_TABLEGEN_SETTHEORY_H 48 #define LLVM_TABLEGEN_SETTHEORY_H 67 using RecVec = std::vector<Record *>;
72 virtual void anchor();
87 virtual void anchor();
98 using ExpandMap = std::map<Record *, RecVec>;
131 template<
typename Iter>
145 #endif // LLVM_TABLEGEN_SETTHEORY_H const_iterator end(StringRef path)
Get end iterator over path.
const_iterator begin(StringRef path, Style style=Style::native)
Get begin iterator over path.
This class represents lattice values for constants.
Operator - A callback representing a DAG operator.
SetTheory()
Create a SetTheory instance with only the standard operators.
Expander - A callback function that can transform a Record representing a set into a fully expanded l...
amdgpu Simplify well known AMD library false Value Value const Twine & Name
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.
std::vector< Record * > RecVec
(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.