From 8715367182244e784b9f5688baf1ed607768e687 Mon Sep 17 00:00:00 2001 From: Gordon Henriksen Date: Sun, 17 Aug 2008 19:08:34 +0000 Subject: [PATCH] Don't require Registry specializations to define random static variables. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54902 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/Registry.h | 17 +++++++++++++++-- lib/CodeGen/GCMetadataPrinter.cpp | 11 ----------- lib/CodeGen/GCStrategy.cpp | 7 ------- lib/Target/TargetMachineRegistry.cpp | 7 ------- 4 files changed, 15 insertions(+), 27 deletions(-) diff --git a/include/llvm/Support/Registry.h b/include/llvm/Support/Registry.h index d89425664ab..c9fb0a1d3e4 100644 --- a/include/llvm/Support/Registry.h +++ b/include/llvm/Support/Registry.h @@ -44,8 +44,8 @@ namespace llvm { public: typedef SimpleRegistryEntry entry; - /// Accessors for . - /// + /// 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(); } }; @@ -234,6 +234,19 @@ namespace llvm { }; + + template + typename Registry::node *Registry::Head; + + template + typename Registry::node *Registry::Tail; + + template + typename Registry::listener *Registry::ListenerHead; + + template + typename Registry::listener *Registry::ListenerTail; + } #endif diff --git a/lib/CodeGen/GCMetadataPrinter.cpp b/lib/CodeGen/GCMetadataPrinter.cpp index 07ec0bd0359..496450325b3 100644 --- a/lib/CodeGen/GCMetadataPrinter.cpp +++ b/lib/CodeGen/GCMetadataPrinter.cpp @@ -15,17 +15,6 @@ using namespace llvm; -// ----------------------------------------------------------------------------- - -template<> GCMetadataPrinterRegistry::node *GCMetadataPrinterRegistry::Head = 0; -template<> GCMetadataPrinterRegistry::node *GCMetadataPrinterRegistry::Tail = 0; -template<> GCMetadataPrinterRegistry::listener * -GCMetadataPrinterRegistry::ListenerHead = 0; -template<> GCMetadataPrinterRegistry::listener * -GCMetadataPrinterRegistry::ListenerTail = 0; - -// ----------------------------------------------------------------------------- - GCMetadataPrinter::GCMetadataPrinter() { } GCMetadataPrinter::~GCMetadataPrinter() { } diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp index 26667759964..6ca368240d2 100644 --- a/lib/CodeGen/GCStrategy.cpp +++ b/lib/CodeGen/GCStrategy.cpp @@ -88,13 +88,6 @@ namespace { // ----------------------------------------------------------------------------- -template<> GCRegistry::node *GCRegistry::Head = 0; -template<> GCRegistry::node *GCRegistry::Tail = 0; -template<> GCRegistry::listener *GCRegistry::ListenerHead = 0; -template<> GCRegistry::listener *GCRegistry::ListenerTail = 0; - -// ----------------------------------------------------------------------------- - GCStrategy::GCStrategy() : NeededSafePoints(0), CustomReadBarriers(false), diff --git a/lib/Target/TargetMachineRegistry.cpp b/lib/Target/TargetMachineRegistry.cpp index 72e5401422c..c1a4777c631 100644 --- a/lib/Target/TargetMachineRegistry.cpp +++ b/lib/Target/TargetMachineRegistry.cpp @@ -18,13 +18,6 @@ #include using namespace llvm; -template<> Registry::node *Registry::Head = 0; -template<> Registry::node *Registry::Tail = 0; -template<> Registry::listener *Registry:: -ListenerHead = 0; -template<> Registry::listener *Registry:: -ListenerTail = 0; - /// getClosestStaticTargetForModule - Given an LLVM module, pick the best target /// that is compatible with the module. If no close target can be found, this /// returns null and sets the Error string to a reason. -- 2.34.1