13#ifndef LLVM_SUPPORT_REGISTRY_H
14#define LLVM_SUPPORT_REGISTRY_H
29 std::unique_ptr<T> (*Ctor)();
56 static node *Head, *Tail;
113 template <
typename V>
118 static std::unique_ptr<T> CtorFn() {
return std::make_unique<V>(); }
137#define LLVM_INSTANTIATE_REGISTRY(REGISTRY_CLASS) \
139 template<typename T> typename Registry<T>::node *Registry<T>::Head = nullptr;\
140 template<typename T> typename Registry<T>::node *Registry<T>::Tail = nullptr;\
141 template<typename T> \
142 void Registry<T>::add_node(typename Registry<T>::node *N) { \
149 template<typename T> typename Registry<T>::iterator Registry<T>::begin() { \
150 return iterator(Head); \
152 template REGISTRY_CLASS::node *Registry<REGISTRY_CLASS::type>::Head; \
153 template REGISTRY_CLASS::node *Registry<REGISTRY_CLASS::type>::Tail; \
155 void Registry<REGISTRY_CLASS::type>::add_node(REGISTRY_CLASS::node*); \
156 template REGISTRY_CLASS::iterator Registry<REGISTRY_CLASS::type>::begin(); \
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
A static registration template.
Add(StringRef Name, StringRef Desc)
Iterators for registry entries.
const entry & operator*() const
bool operator==(const iterator &That) const
Node in linked list of entries.
A global registry used in conjunction with static constructors to make pluggable components (like tar...
static iterator_range< iterator > entries()
SimpleRegistryEntry< T > entry
static void add_node(node *N)
Add a node to the Registry: this is the interface between the plugin and the executable.
A simple registry entry which provides only a name, description, and no-argument constructor.
SimpleRegistryEntry(StringRef N, StringRef D, std::unique_ptr< T >(*C)())
StringRef getName() const
StringRef getDesc() const
std::unique_ptr< T > instantiate() const
StringRef - Represent a constant reference to a string, i.e.
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
A range adaptor for a pair of iterators.
This provides a very simple, boring adaptor for a begin and end iterator into a range type.
@ C
The default llvm calling convention, compatible with C.
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
Description of the encoding of one expression Op.