LLVM
8.0.1
|
#include "llvm/TableGen/SetTheory.h"
Classes | |
class | Expander |
Expander - A callback function that can transform a Record representing a set into a fully expanded list of elements. More... | |
class | Operator |
Operator - A callback representing a DAG operator. More... | |
Public Types | |
using | RecVec = std::vector< Record * > |
using | RecSet = SmallSetVector< Record *, 16 > |
Public Member Functions | |
SetTheory () | |
Create a SetTheory instance with only the standard operators. More... | |
void | addExpander (StringRef ClassName, std::unique_ptr< Expander >) |
addExpander - Add an expander for Records with the named super class. More... | |
void | addFieldExpander (StringRef ClassName, StringRef FieldName) |
addFieldExpander - Add an expander for ClassName that simply evaluates FieldName in the Record to get the set elements. More... | |
void | addOperator (StringRef Name, std::unique_ptr< Operator >) |
addOperator - Add a DAG operator. More... | |
void | evaluate (Init *Expr, RecSet &Elts, ArrayRef< SMLoc > Loc) |
evaluate - Evaluate Expr and append the resulting set to Elts. More... | |
template<typename Iter > | |
void | evaluate (Iter begin, Iter end, RecSet &Elts, ArrayRef< SMLoc > Loc) |
evaluate - Evaluate a sequence of Inits and append to Elts. More... | |
const RecVec * | expand (Record *Set) |
expand - Expand a record into a set of elements if possible. More... | |
Definition at line 65 of file SetTheory.h.
using llvm::SetTheory::RecSet = SmallSetVector<Record *, 16> |
Definition at line 68 of file SetTheory.h.
using llvm::SetTheory::RecVec = std::vector<Record *> |
Definition at line 67 of file SetTheory.h.
SetTheory::SetTheory | ( | ) |
Create a SetTheory instance with only the standard operators.
Definition at line 258 of file SetTheory.cpp.
addExpander - Add an expander for Records with the named super class.
Definition at line 275 of file SetTheory.cpp.
addFieldExpander - Add an expander for ClassName that simply evaluates FieldName in the Record to get the set elements.
That is all that is needed for a class like:
class Set<dag d> { dag Elts = d; }
Definition at line 279 of file SetTheory.cpp.
evaluate - Evaluate Expr and append the resulting set to Elts.
Definition at line 283 of file SetTheory.cpp.
References llvm::tgtok::Def, llvm::dyn_cast(), expand(), llvm::Init::getAsString(), llvm::DagInit::getOperator(), I, llvm::SetVector< T, Vector, Set >::insert(), and llvm::PrintFatalError().
Referenced by evaluate().
|
inline |
evaluate - Evaluate a sequence of Inits and append to Elts.
Definition at line 132 of file SetTheory.h.
References evaluate(), and expand().
expand - Expand a record into a set of elements if possible.
Return a pointer to the expanded elements, or NULL if Set cannot be expanded further.
Definition at line 309 of file SetTheory.cpp.
References llvm::SetVector< T, Vector, Set >::begin(), llvm::SetVector< T, Vector, Set >::end(), llvm::Record::getSuperClasses(), I, and llvm::PPCISD::SC.
Referenced by evaluate().