Unbreak
[oota-llvm.git] / lib / Target / SystemZ / SystemZTargetMachine.cpp
index 4be8ea9936499f4613975e99d3e69bf9cc766e55..01be4edf7d70f36cd20cf72a042ba25521059145 100644 (file)
 #include "llvm/Target/TargetMachineRegistry.h"
 using namespace llvm;
 
-/// SystemZTargetMachineModule - Note that this is used on hosts that
-/// cannot link in a library unless there are references into the
-/// library.  In particular, it seems that it is not possible to get
-/// things to work on Win32 without this.  Though it is unused, do not
-/// remove it.
-extern "C" int SystemZTargetMachineModule;
-int SystemZTargetMachineModule = 0;
+extern Target TheSystemZTarget;
+namespace {
+  // Register the target.
+  RegisterTarget<SystemZTargetMachine> X(TheSystemZTarget,
+                                         "systemz",
+                                         "SystemZ [experimental]");
+}
+
+// Force static initialization.
+extern "C" void LLVMInitializeSystemZTarget() {
 
-// Register the target.
-static RegisterTarget<SystemZTargetMachine>
-X("systemz", "SystemZ [experimental]");
+}
 
 const TargetAsmInfo *SystemZTargetMachine::createTargetAsmInfo() const {
   // FIXME: Handle Solaris subtarget someday :)
@@ -37,9 +38,13 @@ const TargetAsmInfo *SystemZTargetMachine::createTargetAsmInfo() const {
 
 /// SystemZTargetMachine ctor - Create an ILP64 architecture model
 ///
-SystemZTargetMachine::SystemZTargetMachine(const Module &M, const std::string &FS)
-  : Subtarget(*this, M, FS),
-    DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-a0:16:16"),
+SystemZTargetMachine::SystemZTargetMachine(const Target &T,
+                                           const Module &M,
+                                           const std::string &FS)
+  : LLVMTargetMachine(T),
+    Subtarget(*this, M, FS),
+    DataLayout("E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-i64:64:64-f32:32:32"
+               "-f64:64:64-f128:128:128-a0:16:16"),
     InstrInfo(*this), TLInfo(*this),
     FrameInfo(TargetFrameInfo::StackGrowsDown, 8, -160) {
 
@@ -54,15 +59,6 @@ bool SystemZTargetMachine::addInstSelector(PassManagerBase &PM,
   return false;
 }
 
-bool SystemZTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
-                                             CodeGenOpt::Level OptLevel,
-                                             bool Verbose,
-                                             raw_ostream &Out) {
-  // Output assembly language.
-  PM.add(createSystemZCodePrinterPass(Out, *this, OptLevel, Verbose));
-  return false;
-}
-
 unsigned SystemZTargetMachine::getModuleMatchQuality(const Module &M) {
   std::string TT = M.getTargetTriple();