[llvm] r257729 - [GC] Remove more dead code from Registry [NFCI]
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 13 17:06:05 PST 2016
Author: reames
Date: Wed Jan 13 19:06:05 2016
New Revision: 257729
URL: http://llvm.org/viewvc/llvm-project?rev=257729&view=rev
Log:
[GC] Remove more dead code from Registry [NFCI]
Modified:
llvm/trunk/include/llvm/Support/Registry.h
Modified: llvm/trunk/include/llvm/Support/Registry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Registry.h?rev=257729&r1=257728&r2=257729&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Registry.h (original)
+++ llvm/trunk/include/llvm/Support/Registry.h Wed Jan 13 19:06:05 2016
@@ -37,29 +37,13 @@ namespace llvm {
std::unique_ptr<T> instantiate() const { return Ctor(); }
};
- /// Traits for registry entries. If using other than SimpleRegistryEntry, it
- /// is necessary to define an alternate traits class.
- template <typename T>
- class RegistryTraits {
- RegistryTraits() = delete;
-
- public:
- typedef SimpleRegistryEntry<T> entry;
-
- /// nameof/descof - Accessors for name and description of entries. These are
- // used to generate help for command-line options.
- static const char *nameof(const entry &Entry) { return Entry.getName(); }
- static const char *descof(const entry &Entry) { return Entry.getDesc(); }
- };
-
/// 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.
- template <typename T, typename U = RegistryTraits<T> >
+ template <typename T>
class Registry {
public:
- typedef U traits;
- typedef typename U::entry entry;
+ typedef SimpleRegistryEntry<T> entry;
class node;
class iterator;
@@ -119,14 +103,6 @@ namespace llvm {
/// Use of this template requires that:
///
/// 1. The registered subclass has a default constructor.
- //
- /// 2. The registry entry type has a constructor compatible with this
- /// signature:
- ///
- /// entry(const char *Name, const char *ShortDesc, T *(*Ctor)());
- ///
- /// If you have more elaborate requirements, then copy and modify.
- ///
template <typename V>
class Add {
entry Entry;
@@ -140,14 +116,14 @@ namespace llvm {
};
};
+
// Since these are defined in a header file, plugins must be sure to export
// these symbols.
+ template <typename T>
+ typename Registry<T>::node *Registry<T>::Head;
- template <typename T, typename U>
- typename Registry<T,U>::node *Registry<T,U>::Head;
-
- template <typename T, typename U>
- typename Registry<T,U>::node *Registry<T,U>::Tail;
+ template <typename T>
+ typename Registry<T>::node *Registry<T>::Tail;
} // end namespace llvm
#endif // LLVM_SUPPORT_REGISTRY_H
More information about the llvm-commits
mailing list