Displaying 1 result from an estimated 1 matches for "simpleregistryentry".
2007 Aug 31
3
[LLVMdev] PATCH: Registry template
...--
-===//
+
+#ifndef LLVM_SUPPORT_REGISTRY_H
+#define LLVM_SUPPORT_REGISTRY_H
+
+#include "llvm/Support/CommandLine.h"
+
+namespace llvm {
+ /// A simple registry entry which provides only a name,
description, and
+ /// no-argument constructor.
+ template <typename T>
+ class SimpleRegistryEntry {
+ const char *Name, *Desc;
+ T *(*Ctor)();
+
+ public:
+ SimpleRegistryEntry(const char *N, const char *D, T *(*C)())
+ : Name(N), Desc(D), Ctor(C)
+ {}
+
+ const char *getName() const { return Name; }
+ const char *getDesc() const { return Desc; }
+ T *instantiate() co...