[llvm-commits] [llvm] r75774 - in /llvm/trunk: include/llvm/Target/TargetMachineRegistry.h include/llvm/Target/TargetRegistry.h lib/Target/TargetMachineRegistry.cpp

Daniel Dunbar daniel at zuster.org
Wed Jul 15 04:48:39 PDT 2009


Author: ddunbar
Date: Wed Jul 15 06:48:36 2009
New Revision: 75774

URL: http://llvm.org/viewvc/llvm-project?rev=75774&view=rev
Log:
Kill off unused TargetMachineRegistry methods and ivars.

Removed:
    llvm/trunk/lib/Target/TargetMachineRegistry.cpp
Modified:
    llvm/trunk/include/llvm/Target/TargetMachineRegistry.h
    llvm/trunk/include/llvm/Target/TargetRegistry.h

Modified: llvm/trunk/include/llvm/Target/TargetMachineRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetMachineRegistry.h?rev=75774&r1=75773&r2=75774&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetMachineRegistry.h (original)
+++ llvm/trunk/include/llvm/Target/TargetMachineRegistry.h Wed Jul 15 06:48:36 2009
@@ -30,17 +30,10 @@
     const Target &TheTarget;
     const char *Name;
     const char *ShortDesc;
-    TargetMachine *(*CtorFn)(const Module &, const std::string &);
-    unsigned (*ModuleMatchQualityFn)(const Module &M);
-    unsigned (*JITMatchQualityFn)();
 
   public:
-    TargetMachineRegistryEntry(const Target &T, const char *N, const char *SD,
-                      TargetMachine *(*CF)(const Module &, const std::string &),
-                               unsigned (*MMF)(const Module &M),
-                               unsigned (*JMF)())
-      : TheTarget(T), Name(N), ShortDesc(SD), CtorFn(CF), 
-        ModuleMatchQualityFn(MMF), JITMatchQualityFn(JMF) {}
+    TargetMachineRegistryEntry(const Target &T, const char *N, const char *SD)
+      : TheTarget(T), Name(N), ShortDesc(SD) {}
   };
 
   template<>
@@ -53,24 +46,15 @@
   };
 
   struct TargetMachineRegistry : public Registry<TargetMachine> {
-    /// 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.
-    static const entry *getClosestStaticTargetForModule(const Module &M,
-                                                        std::string &Error);
-
-    /// getClosestTargetForJIT - Pick the best target that is compatible with
-    /// the current host.  If no close target can be found, this returns null
-    /// and sets the Error string to a reason.
-    static const entry *getClosestTargetForJIT(std::string &Error);
 
   };
 
   //===--------------------------------------------------------------------===//
   /// RegisterTarget - This class is used to make targets automatically register
-  /// themselves with the tool they are linked.  Targets should define an
-  /// instance of this and implement the static methods described in the
-  /// TargetMachine comments.
+  /// themselves with the tools they are linked with.  Targets should define an
+  /// single global Target instance and register it using the TargetRegistry
+  /// interfaces. Targets must also include a static instance of this class.
+  ///
   /// The type 'TargetMachineImpl' should provide a constructor with two
   /// parameters:
   /// - const Module& M: the module that is being compiled:
@@ -80,9 +64,7 @@
   template<class TargetMachineImpl>
   struct RegisterTarget {
     RegisterTarget(Target &T, const char *Name, const char *ShortDesc)
-      : Entry(T, Name, ShortDesc, &Allocator,
-              &TargetMachineImpl::getModuleMatchQuality,
-              &TargetMachineImpl::getJITMatchQuality),
+      : Entry(T, Name, ShortDesc),
         Node(Entry) {
       TargetRegistry::RegisterTargetMachine(T, &Allocator);
     }

Modified: llvm/trunk/include/llvm/Target/TargetRegistry.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Target/TargetRegistry.h?rev=75774&r1=75773&r2=75774&view=diff

==============================================================================
--- llvm/trunk/include/llvm/Target/TargetRegistry.h (original)
+++ llvm/trunk/include/llvm/Target/TargetRegistry.h Wed Jul 15 06:48:36 2009
@@ -49,8 +49,6 @@
                                               bool);
 
     friend struct TargetRegistry;
-    // FIXME: Temporary hack, please remove.
-    friend struct TargetMachineRegistry;
 
     /// Next - The next registered target in the linked list, maintained by the
     /// TargetRegistry.

Removed: llvm/trunk/lib/Target/TargetMachineRegistry.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/TargetMachineRegistry.cpp?rev=75773&view=auto

==============================================================================
--- llvm/trunk/lib/Target/TargetMachineRegistry.cpp (original)
+++ llvm/trunk/lib/Target/TargetMachineRegistry.cpp (removed)
@@ -1,51 +0,0 @@
-//===-- TargetMachineRegistry.cpp - Target Auto Registration Impl ---------===//
-//
-//                     The LLVM Compiler Infrastructure
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-//
-// This file exposes the RegisterTarget class, which TargetMachine
-// implementations should use to register themselves with the system.  This file
-// also exposes the TargetMachineRegistry class, which allows tools to inspect
-// all of registered targets.
-//
-//===----------------------------------------------------------------------===//
-
-#include "llvm/Target/TargetMachineRegistry.h"
-#include <algorithm>
-using namespace llvm;
-
-/// 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.
-const TargetMachineRegistry::entry *
-TargetMachineRegistry::getClosestStaticTargetForModule(const Module &M,
-                                                       std::string &Error) {
-  const Target *T = TargetRegistry::getClosestStaticTargetForModule(M, Error);
-  if (!T)
-    return 0;
-  // FIXME: Temporary hack, please remove.
-  return new TargetMachineRegistry::entry(*T, T->Name, T->ShortDesc,
-                                          T->TargetMachineCtorFn,
-                                          T->ModuleMatchQualityFn,
-                                          T->JITMatchQualityFn); 
-}
-
-/// getClosestTargetForJIT - Pick the best target that is compatible with
-/// the current host.  If no close target can be found, this returns null
-/// and sets the Error string to a reason.
-const TargetMachineRegistry::entry *
-TargetMachineRegistry::getClosestTargetForJIT(std::string &Error) {
-  const Target *T = TargetRegistry::getClosestTargetForJIT(Error);
-  if (!T)
-    return 0;
-  // FIXME: Temporary hack, please remove.
-  return new TargetMachineRegistry::entry(*T, T->Name, T->ShortDesc,
-                                          T->TargetMachineCtorFn,
-                                          T->ModuleMatchQualityFn,
-                                          T->JITMatchQualityFn); 
-}
-





More information about the llvm-commits mailing list