Implement target specific getDebugValueLocation().
[oota-llvm.git] / lib / Target / PowerPC / TargetInfo / PowerPCTargetInfo.cpp
index 7fc73c139a12575bd09707a8e8d5678e2dbd7d23..ad607d0ade6abfaaae35b91fd0cfa14530b8edd9 100644 (file)
 #include "llvm/Target/TargetRegistry.h"
 using namespace llvm;
 
-Target llvm::ThePPC32Target;
-
-static unsigned PPC32_TripleMatchQuality(const std::string &TT) {
-  // We strongly match "powerpc-*".
-  if (TT.size() >= 8 && std::string(TT.begin(), TT.begin()+8) == "powerpc-")
-    return 20;
-
-  return 0;
-}
-
-Target llvm::ThePPC64Target;
-
-static unsigned PPC64_TripleMatchQuality(const std::string &TT) {
-  // We strongly match "powerpc64-*".
-  if (TT.size() >= 10 && std::string(TT.begin(), TT.begin()+10) == "powerpc64-")
-    return 20;
-
-  return 0;
-}
+Target llvm::ThePPC32Target, llvm::ThePPC64Target;
 
 extern "C" void LLVMInitializePowerPCTargetInfo() { 
-  TargetRegistry::RegisterTarget(ThePPC32Target, "ppc32",
-                                  "PowerPC 32",
-                                  &PPC32_TripleMatchQuality,
-                                 /*HasJIT=*/true);
+  RegisterTarget<Triple::ppc, /*HasJIT=*/true>
+    X(ThePPC32Target, "ppc32", "PowerPC 32");
 
-  TargetRegistry::RegisterTarget(ThePPC64Target, "ppc64",
-                                  "PowerPC 64",
-                                  &PPC64_TripleMatchQuality,
-                                 /*HasJIT=*/true);
+  RegisterTarget<Triple::ppc64, /*HasJIT=*/true>
+    Y(ThePPC64Target, "ppc64", "PowerPC 64");
 }