aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/Sparc/SparcTargetMachine.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-06-19 15:48:10 +0000
committerChris Lattner <sabre@nondot.org>2009-06-19 15:48:10 +0000
commit3773afe93134cfcf273c037a727914008a8f76fd (patch)
tree39679ab7f75dc256e84ac7a0d77a8e531be7be81 /llvm/lib/Target/Sparc/SparcTargetMachine.cpp
parent0de39b42ff7d98f2fae66863c92c379386397903 (diff)
downloadllvm-3773afe93134cfcf273c037a727914008a8f76fd.zip
llvm-3773afe93134cfcf273c037a727914008a8f76fd.tar.gz
llvm-3773afe93134cfcf273c037a727914008a8f76fd.tar.bz2
fix the sparc codegen to not depend on the sparc asmprinter.
llvm-svn: 73767
Diffstat (limited to 'llvm/lib/Target/Sparc/SparcTargetMachine.cpp')
-rw-r--r--llvm/lib/Target/Sparc/SparcTargetMachine.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/llvm/lib/Target/Sparc/SparcTargetMachine.cpp b/llvm/lib/Target/Sparc/SparcTargetMachine.cpp
index ca275da..fd0f124 100644
--- a/llvm/lib/Target/Sparc/SparcTargetMachine.cpp
+++ b/llvm/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;
}