LLVM API Documentation
#include <SetTheory.h>
Classes | |
class | Expander |
class | Operator |
Operator - A callback representing a DAG operator. More... | |
Public Types | |
typedef std::vector< Record * > | RecVec |
typedef SmallSetVector< Record *, 16 > | RecSet |
Public Member Functions | |
SetTheory () | |
Create a SetTheory instance with only the standard operators. | |
void | addExpander (StringRef ClassName, Expander *) |
addExpander - Add an expander for Records with the named super class. | |
void | addFieldExpander (StringRef ClassName, StringRef FieldName) |
void | addOperator (StringRef Name, Operator *) |
addOperator - Add a DAG operator. | |
void | evaluate (Init *Expr, RecSet &Elts, ArrayRef< SMLoc > Loc) |
evaluate - Evaluate Expr and append the resulting set to Elts. | |
template<typename Iter > | |
void | evaluate (Iter begin, Iter end, RecSet &Elts, ArrayRef< SMLoc > Loc) |
evaluate - Evaluate a sequence of Inits and append to Elts. | |
const RecVec * | expand (Record *Set) |
Definition at line 63 of file SetTheory.h.
typedef SmallSetVector<Record*, 16> llvm::SetTheory::RecSet |
Definition at line 66 of file SetTheory.h.
typedef std::vector<Record*> llvm::SetTheory::RecVec |
Definition at line 65 of file SetTheory.h.
Create a SetTheory instance with only the standard operators.
Definition at line 247 of file SetTheory.cpp.
References addOperator().
void SetTheory::addExpander | ( | StringRef | ClassName, |
Expander * | E | ||
) |
addExpander - Add an expander for Records with the named super class.
Definition at line 264 of file SetTheory.cpp.
Referenced by addFieldExpander().
void SetTheory::addFieldExpander | ( | StringRef | ClassName, |
StringRef | FieldName | ||
) |
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 268 of file SetTheory.cpp.
References addExpander().
void SetTheory::addOperator | ( | StringRef | Name, |
Operator * | Op | ||
) |
addOperator - Add a DAG operator.
Definition at line 260 of file SetTheory.cpp.
References Name.
Referenced by SetTheory().
void SetTheory::evaluate | ( | Init * | Expr, |
RecSet & | Elts, | ||
ArrayRef< SMLoc > | Loc | ||
) |
evaluate - Evaluate Expr and append the resulting set to Elts.
Definition at line 272 of file SetTheory.cpp.
References llvm::tgtok::Def, llvm::dyn_cast(), expand(), llvm::Init::getAsString(), llvm::DagInit::getOperator(), llvm::SetVector< T, Vector, Set >::insert(), LI, llvm::StringMap< ValueTy, AllocatorTy >::lookup(), and llvm::PrintFatalError().
Referenced by evaluate().
void llvm::SetTheory::evaluate | ( | Iter | begin, |
Iter | end, | ||
RecSet & | Elts, | ||
ArrayRef< SMLoc > | Loc | ||
) | [inline] |
evaluate - Evaluate a sequence of Inits and append to Elts.
Definition at line 128 of file SetTheory.h.
References evaluate().
const RecVec * SetTheory::expand | ( | Record * | Set | ) |
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 298 of file SetTheory.cpp.
References llvm::SetVector< T, Vector, Set >::begin(), llvm::SetVector< T, Vector, Set >::end(), llvm::Record::getSuperClasses(), I, llvm::StringMap< ValueTy, AllocatorTy >::lookup(), and llvm::PPCISD::SC.
Referenced by evaluate().