Patch up omissions in DebugLoc propagation.
[oota-llvm.git] / lib / Target / Alpha / AlphaTargetMachine.cpp
index 0887b952bb53f897575d8dc3d7c7e9f11ad56d0f..c65485b061ca8bdd384a714f53cfd07806e3c8ac 100644 (file)
 #include "llvm/Module.h"
 #include "llvm/PassManager.h"
 #include "llvm/Target/TargetMachineRegistry.h"
+#include "llvm/Support/raw_ostream.h"
 
 using namespace llvm;
 
-namespace {
-  // Register the targets
-  RegisterTarget<AlphaTargetMachine> X("alpha", "  Alpha (incomplete)");
-}
+/// AlphaTargetMachineModule - 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 AlphaTargetMachineModule;
+int AlphaTargetMachineModule = 0;
+
+// Register the targets
+static RegisterTarget<AlphaTargetMachine> X("alpha", "Alpha [experimental]");
 
 const TargetAsmInfo *AlphaTargetMachine::createTargetAsmInfo() const {
   return new AlphaTargetAsmInfo(*this);
@@ -80,7 +86,7 @@ bool AlphaTargetMachine::addPreEmitPass(PassManagerBase &PM, bool Fast) {
   return false;
 }
 bool AlphaTargetMachine::addAssemblyEmitter(PassManagerBase &PM, bool Fast, 
-                                            std::ostream &Out) {
+                                            raw_ostream &Out) {
   PM.add(createAlphaLLRPPass(*this));
   PM.add(createAlphaCodePrinterPass(Out, *this));
   return false;
@@ -89,7 +95,7 @@ bool AlphaTargetMachine::addCodeEmitter(PassManagerBase &PM, bool Fast,
                                         bool DumpAsm, MachineCodeEmitter &MCE) {
   PM.add(createAlphaCodeEmitterPass(*this, MCE));
   if (DumpAsm)
-    PM.add(createAlphaCodePrinterPass(*cerr.stream(), *this));
+    PM.add(createAlphaCodePrinterPass(errs(), *this));
   return false;
 }
 bool AlphaTargetMachine::addSimpleCodeEmitter(PassManagerBase &PM,