summaryrefslogtreecommitdiff
path: root/lib/Target/Sparc/SparcTargetMachine.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Target/Sparc/SparcTargetMachine.cpp')
-rw-r--r--lib/Target/Sparc/SparcTargetMachine.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lib/Target/Sparc/SparcTargetMachine.cpp b/lib/Target/Sparc/SparcTargetMachine.cpp
index ca275daec1..fd0f12429a 100644
--- a/lib/Target/Sparc/SparcTargetMachine.cpp
+++ b/lib/Target/Sparc/SparcTargetMachine.cpp
@@ -18,17 +18,13 @@
#include "llvm/Target/TargetMachineRegistry.h"
using namespace llvm;
-/// SparcTargetMachineModule - 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 SparcTargetMachineModule;
-int SparcTargetMachineModule = 0;
-
// Register the target.
static RegisterTarget<SparcTargetMachine> X("sparc", "SPARC");
+// No assembler printer by default
+SparcTargetMachine::AsmPrinterCtorFn SparcTargetMachine::AsmPrinterCtor = 0;
+
+
// Force static initialization when called from llvm/InitializeAllTargets.h
namespace llvm {
void InitializeSparcTarget() { }
@@ -94,6 +90,8 @@ bool SparcTargetMachine::addAssemblyEmitter(PassManagerBase &PM,
bool Verbose,
raw_ostream &Out) {
// Output assembly language.
- PM.add(createSparcCodePrinterPass(Out, *this, OptLevel, Verbose));
+ assert(AsmPrinterCtor && "AsmPrinter was not linked in");
+ if (AsmPrinterCtor)
+ PM.add(AsmPrinterCtor(Out, *this, OptLevel, Verbose));
return false;
}