Reapply TargetRegistry refactoring commits.
[oota-llvm.git] / lib / Target / IA64 / IA64TargetMachine.cpp
index 00fdd5e8a65e5341c1074a2035c8dd4421a6bcf8..5355075f8b387307f0373017924d329a1a76af7a 100644 (file)
@@ -20,7 +20,8 @@
 using namespace llvm;
 
 // Register the target
-static RegisterTarget<IA64TargetMachine> X("ia64",
+extern Target TheIA64Target;
+static RegisterTarget<IA64TargetMachine> X(TheIA64Target, "ia64",
                                            "IA-64 (Itanium) [experimental]");
 
 // No assembler printer by default
@@ -33,36 +34,12 @@ const TargetAsmInfo *IA64TargetMachine::createTargetAsmInfo() const {
   return new IA64TargetAsmInfo(*this);
 }
 
-unsigned IA64TargetMachine::getModuleMatchQuality(const Module &M) {
-  // we match [iI][aA]*64
-  bool seenIA64=false;
-  std::string TT = M.getTargetTriple();
-
-  if (TT.size() >= 4) {
-    if( (TT[0]=='i' || TT[0]=='I') &&
-        (TT[1]=='a' || TT[1]=='A') ) {
-      for(unsigned int i=2; i<(TT.size()-1); i++)
-        if(TT[i]=='6' && TT[i+1]=='4')
-          seenIA64=true;
-    }
-
-    if (seenIA64)
-      return 20; // strong match
-  }
-  // If the target triple is something non-ia64, we don't match.
-  if (!TT.empty()) return 0;
-
-#if defined(__ia64__) || defined(__IA64__)
-  return 5;
-#else
-  return 0;
-#endif
-}
-
 /// IA64TargetMachine ctor - Create an LP64 architecture model
 ///
-IA64TargetMachine::IA64TargetMachine(const Module &M, const std::string &FS)
-  : DataLayout("e-f80:128:128"),
+IA64TargetMachine::IA64TargetMachine(const Target &T, const Module &M, 
+                                     const std::string &FS)
+  : LLVMTargetMachine(T),
+    DataLayout("e-f80:128:128"),
     FrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0),
     TLInfo(*this) { // FIXME? check this stuff
 }