[llvm-commits] [llvm] r54902 - in /llvm/trunk: include/llvm/Support/Registry.h lib/CodeGen/GCMetadataPrinter.cpp lib/CodeGen/GCStrategy.cpp lib/Target/TargetMachineRegistry.cpp
Gordon Henriksen
gordonhenriksen at mac.com
Sun Aug 17 12:08:36 PDT 2008
Author: gordon
Date: Sun Aug 17 14:08:34 2008
New Revision: 54902
URL: http://llvm.org/viewvc/llvm-project?rev=54902&view=rev
Log:
Don't require Registry specializations to define random static variables.
Modified:
llvm/trunk/include/llvm/Support/Registry.h
llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp
llvm/trunk/lib/CodeGen/GCStrategy.cpp
llvm/trunk/lib/Target/TargetMachineRegistry.cpp
Modified: llvm/trunk/include/llvm/Support/Registry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Registry.h?rev=54902&r1=54901&r2=54902&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Registry.h (original)
+++ llvm/trunk/include/llvm/Support/Registry.h Sun Aug 17 14:08:34 2008
@@ -44,8 +44,8 @@
public:
typedef SimpleRegistryEntry<T> 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 @@
};
+
+ 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 U>
+ typename Registry<T,U>::listener *Registry<T,U>::ListenerHead;
+
+ template <typename T, typename U>
+ typename Registry<T,U>::listener *Registry<T,U>::ListenerTail;
+
}
#endif
Modified: llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp?rev=54902&r1=54901&r2=54902&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/GCMetadataPrinter.cpp Sun Aug 17 14:08:34 2008
@@ -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() { }
Modified: llvm/trunk/lib/CodeGen/GCStrategy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/GCStrategy.cpp?rev=54902&r1=54901&r2=54902&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/GCStrategy.cpp (original)
+++ llvm/trunk/lib/CodeGen/GCStrategy.cpp Sun Aug 17 14:08:34 2008
@@ -88,13 +88,6 @@
// -----------------------------------------------------------------------------
-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),
Modified: llvm/trunk/lib/Target/TargetMachineRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachineRegistry.cpp?rev=54902&r1=54901&r2=54902&view=diff
==============================================================================
--- llvm/trunk/lib/Target/TargetMachineRegistry.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachineRegistry.cpp Sun Aug 17 14:08:34 2008
@@ -18,13 +18,6 @@
#include <algorithm>
using namespace llvm;
-template<> Registry<TargetMachine>::node *Registry<TargetMachine>::Head = 0;
-template<> Registry<TargetMachine>::node *Registry<TargetMachine>::Tail = 0;
-template<> Registry<TargetMachine>::listener *Registry<TargetMachine>::
-ListenerHead = 0;
-template<> Registry<TargetMachine>::listener *Registry<TargetMachine>::
-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.
More information about the llvm-commits
mailing list