LLVM 19.0.0git
Classes | Namespaces | Macros
Registry.h File Reference
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/DynamicLibrary.h"
#include <memory>

Go to the source code of this file.

Classes

class  llvm::SimpleRegistryEntry< T >
 A simple registry entry which provides only a name, description, and no-argument constructor. More...
 
class  llvm::Registry< T >
 A global registry used in conjunction with static constructors to make pluggable components (like targets or garbage collectors) "just work" when linked with an executable. More...
 
class  llvm::Registry< T >::node
 Node in linked list of entries. More...
 
class  llvm::Registry< T >::iterator
 Iterators for registry entries. More...
 
class  llvm::Registry< T >::Add< V >
 A static registration template. More...
 

Namespaces

namespace  llvm
 This is an optimization pass for GlobalISel generic memory operations.
 

Macros

#define LLVM_INSTANTIATE_REGISTRY(REGISTRY_CLASS)
 Instantiate a registry class.
 

Macro Definition Documentation

◆ LLVM_INSTANTIATE_REGISTRY

#define LLVM_INSTANTIATE_REGISTRY (   REGISTRY_CLASS)
Value:
namespace llvm { \
template<typename T> typename Registry<T>::node *Registry<T>::Head = nullptr;\
template<typename T> typename Registry<T>::node *Registry<T>::Tail = nullptr;\
template<typename T> \
void Registry<T>::add_node(typename Registry<T>::node *N) { \
if (Tail) \
Tail->Next = N; \
else \
Head = N; \
Tail = N; \
} \
template<typename T> typename Registry<T>::iterator Registry<T>::begin() { \
return iterator(Head); \
} \
template REGISTRY_CLASS::node *Registry<REGISTRY_CLASS::type>::Head; \
template REGISTRY_CLASS::node *Registry<REGISTRY_CLASS::type>::Tail; \
template \
void Registry<REGISTRY_CLASS::type>::add_node(REGISTRY_CLASS::node*); \
template REGISTRY_CLASS::iterator Registry<REGISTRY_CLASS::type>::begin(); \
}
static iterator begin()
static void add_node(node *N)
Add a node to the Registry: this is the interface between the plugin and the executable.
@ Tail
Attemps to make calls as fast as possible while guaranteeing that tail call optimization can always b...
Definition: CallingConv.h:76
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
#define N

Instantiate a registry class.

This provides template definitions of add_node, begin, and the Head and Tail pointers, then explicitly instantiates them. We could explicitly specialize them, instead of the two-step process of define then instantiate, but strictly speaking that's not allowed by the C++ standard (we would need to have explicit specialization declarations in all translation units where the specialization is used) so we don't.

Definition at line 137 of file Registry.h.