13#ifndef LLVM_SUPPORT_REGISTRY_H
14#define LLVM_SUPPORT_REGISTRY_H
29 std::unique_ptr<T> (*Ctor)();
33 : Name(
N), Desc(
D), Ctor(
C) {}
110 static iterator
begin() {
return iterator(Head); }
111 static iterator
end() {
return iterator(
nullptr); }
125 template <
typename V>
130 static std::unique_ptr<T> CtorFn() {
return std::make_unique<V>(); }
134 : Entry(Name,
Desc, CtorFn), Node(Entry) {
144#define LLVM_INSTANTIATE_REGISTRY(REGISTRY_CLASS) \
146 template <typename T> \
147 typename Registry<T>::node *Registry<T>::Head = nullptr; \
148 template <typename T> \
149 typename Registry<T>::node *Registry<T>::Tail = nullptr; \
150 template class LLVM_ABI_EXPORT Registry<REGISTRY_CLASS::type>; \
153#define LLVM_INSTANTIATE_REGISTRY(REGISTRY_CLASS) \
155 template <typename T> \
156 typename Registry<T>::node *Registry<T>::Head = nullptr; \
157 template <typename T> \
158 typename Registry<T>::node *Registry<T>::Tail = nullptr; \
159 template class Registry<REGISTRY_CLASS::type>; \
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
Add(StringRef Name, StringRef Desc)
const entry & operator*() const
bool operator==(const iterator &That) const
Node in linked list of entries.
static iterator_range< iterator > entries()
SimpleRegistryEntry< GCMetadataPrinter > 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.
MachinePassRegistry< typename RegisterRegAllocBase< T >::FunctionPassCtor > RegisterRegAllocBase< T >::Registry
RegisterRegAlloc's global Registry tracks allocator registration.