diff --git a/include/llvm/Support/Registry.h b/include/llvm/Support/Registry.h index da8667b6649..2d18df55138 100644 --- a/include/llvm/Support/Registry.h +++ b/include/llvm/Support/Registry.h @@ -116,15 +116,14 @@ namespace llvm { }; }; - // Use this macro to stamp out definitions for required static symbols in an - // appropriate source file. This is required to avoid getting multiple - // definitions of the Registry's fields in different translation or linkage - // units. -#define DEFINE_REGISTRY(T) \ - template <> \ - typename Registry::node *Registry::Head = nullptr; \ - template <> \ - typename Registry::node *Registry::Tail = nullptr; + + // Since these are defined in a header file, plugins must be sure to export + // these symbols. + template + typename Registry::node *Registry::Head; + + template + typename Registry::node *Registry::Tail; } // end namespace llvm #endif // LLVM_SUPPORT_REGISTRY_H diff --git a/lib/CodeGen/GCMetadataPrinter.cpp b/lib/CodeGen/GCMetadataPrinter.cpp index 8003219de39..bb8cfa1cc80 100644 --- a/lib/CodeGen/GCMetadataPrinter.cpp +++ b/lib/CodeGen/GCMetadataPrinter.cpp @@ -17,7 +17,3 @@ using namespace llvm; GCMetadataPrinter::GCMetadataPrinter() {} GCMetadataPrinter::~GCMetadataPrinter() {} - -// Stamp out the registry of GCMetadataPrinter objects so that pulgins can load -// new Strategies. -DEFINE_REGISTRY(GCMetadataPrinter) diff --git a/lib/CodeGen/GCStrategy.cpp b/lib/CodeGen/GCStrategy.cpp index 073d4b54d30..554d326942e 100644 --- a/lib/CodeGen/GCStrategy.cpp +++ b/lib/CodeGen/GCStrategy.cpp @@ -20,7 +20,3 @@ GCStrategy::GCStrategy() : UseStatepoints(false), NeededSafePoints(0), CustomReadBarriers(false), CustomWriteBarriers(false), CustomRoots(false), InitRoots(true), UsesMetadata(false) {} - -// Stamp out the registry of GCStrategy objects so that pulgins can load new -// Strategies. -DEFINE_REGISTRY(GCStrategy)