From ff9834ab9daeee25dbb67ae5e2341930cde46c86 Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Thu, 16 Jul 2009 02:41:19 +0000 Subject: [PATCH] Kill off last uses of TargetMachineRegistry class. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75892 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Target/TargetMachineRegistry.h | 31 +-------------------- tools/llvm-ld/llvm-ld.cpp | 1 - tools/lto/LTOCodeGenerator.cpp | 2 +- tools/lto/LTOModule.cpp | 4 +-- 4 files changed, 4 insertions(+), 34 deletions(-) diff --git a/include/llvm/Target/TargetMachineRegistry.h b/include/llvm/Target/TargetMachineRegistry.h index 6b78a58ab0e..a1b13d360d0 100644 --- a/include/llvm/Target/TargetMachineRegistry.h +++ b/include/llvm/Target/TargetMachineRegistry.h @@ -18,7 +18,6 @@ #define LLVM_TARGET_TARGETMACHINEREGISTRY_H #include "llvm/Module.h" -#include "llvm/Support/Registry.h" #include "llvm/Target/TargetRegistry.h" namespace llvm { @@ -26,29 +25,6 @@ namespace llvm { class Target; class TargetMachine; - struct TargetMachineRegistryEntry { - const Target &TheTarget; - const char *Name; - const char *ShortDesc; - - public: - TargetMachineRegistryEntry(const Target &T, const char *N, const char *SD) - : TheTarget(T), Name(N), ShortDesc(SD) {} - }; - - template<> - class RegistryTraits { - public: - typedef TargetMachineRegistryEntry entry; - - static const char *nameof(const entry &Entry) { return Entry.Name; } - static const char *descof(const entry &Entry) { return Entry.ShortDesc; } - }; - - struct TargetMachineRegistry : public Registry { - - }; - //===--------------------------------------------------------------------===// /// RegisterTarget - This class is used to make targets automatically register /// themselves with the tools they are linked with. Targets should define an @@ -63,16 +39,11 @@ namespace llvm { template struct RegisterTarget { - RegisterTarget(Target &T, const char *Name, const char *ShortDesc) - : Entry(T, Name, ShortDesc), - Node(Entry) { + RegisterTarget(Target &T, const char *Name, const char *ShortDesc) { TargetRegistry::RegisterTargetMachine(T, &Allocator); } private: - TargetMachineRegistry::entry Entry; - TargetMachineRegistry::node Node; - static TargetMachine *Allocator(const Target &T, const Module &M, const std::string &FS) { return new TargetMachineImpl(T, M, FS); diff --git a/tools/llvm-ld/llvm-ld.cpp b/tools/llvm-ld/llvm-ld.cpp index 5828c3a21d5..ba517300b19 100644 --- a/tools/llvm-ld/llvm-ld.cpp +++ b/tools/llvm-ld/llvm-ld.cpp @@ -29,7 +29,6 @@ #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Support/CommandLine.h" #include "llvm/Support/FileUtilities.h" #include "llvm/Support/ManagedStatic.h" diff --git a/tools/lto/LTOCodeGenerator.cpp b/tools/lto/LTOCodeGenerator.cpp index 5176359e5d0..9aca59cd6a8 100644 --- a/tools/lto/LTOCodeGenerator.cpp +++ b/tools/lto/LTOCodeGenerator.cpp @@ -41,7 +41,7 @@ #include "llvm/Target/TargetAsmInfo.h" #include "llvm/Target/TargetData.h" #include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetMachineRegistry.h" +#include "llvm/Target/TargetRegistry.h" #include "llvm/Target/TargetSelect.h" #include "llvm/Transforms/IPO.h" #include "llvm/Transforms/Scalar.h" diff --git a/tools/lto/LTOModule.cpp b/tools/lto/LTOModule.cpp index be6543c8f7f..9ccac2b028e 100644 --- a/tools/lto/LTOModule.cpp +++ b/tools/lto/LTOModule.cpp @@ -27,9 +27,9 @@ #include "llvm/System/Path.h" #include "llvm/System/Process.h" #include "llvm/Target/SubtargetFeature.h" -#include "llvm/Target/TargetMachine.h" -#include "llvm/Target/TargetMachineRegistry.h" #include "llvm/Target/TargetAsmInfo.h" +#include "llvm/Target/TargetMachine.h" +#include "llvm/Target/TargetRegistry.h" #include -- 2.34.1