LLVM  6.0.0svn
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>
Include dependency graph for Registry.h:
This graph shows which files directly or indirectly include this file:

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

 llvm
 Compute iterated dominance frontiers using a linear time algorithm.
 

Macros

#define LLVM_INSTANTIATE_REGISTRY(REGISTRY_CLASS)
 Instantiate a registry class. More...
 

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> \
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(); \
}
Compute iterated dominance frontiers using a linear time algorithm.
Definition: AllocatorList.h:24
static void add_node(node *N)
Add a node to the Registry: this is the interface between the plugin and the executable.
friend class node
Definition: Registry.h:56
static iterator begin()
#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 138 of file Registry.h.